input: Write a function to create a simple chatbot in Python using Flask and Dialogflow, which can answer questions about the current days of the week. The function should initialize a Flask app, define an endpoint that invokes Dialogflow's detect_intent_texts function to process the user's input, and return the fulfillment text from Dialogflow. If the session ID is not present, it should create one.
  assert detect_intent_text("What day is it today?") == "Today is Monday."
  assert detect_intent_text("What are the days of the week?") == "The days of the week are Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, and Sunday."
  assert detect_intent_text("Is today Friday?") == "No, today is not Friday."
output: from flask import Flask, request, jsonify
  import dialogflow
  import uuid
  
  app = Flask(__name__)
  
  @app.route('/chat', methods=['POST'])
  def detect_intent_text():
      data = request.get_json()
      text = data.get('text')
      session_id = data.get('session_id', str(uuid.uuid4()))
      
      session_client = dialogflow.SessionsClient()
      session = session_client.session_path('your-project-id', session_id)
      
      text_input = dialogflow.types.TextInput(text=text, language_code='en')
      query_input = dialogflow.types.QueryInput(text=text_input)
      
      response = session_client.detect_intent(session=session, query_input=query_input)
      
      return jsonify({'response': response.query_result.fulfillment_text})