input: Write a function to create a simple chatbot using Python and Dialogflow that can answer questions about the current days of the week. The function should detect the intent of the text input and return the fulfillment text as a response. If the session_id is not present, the function should create one.
  
  from flask import Flask
  from flask_restful import Resource, Api
  from dialogflow import detect_intent_texts
  
  app = Flask(__name__)
  api = Api(app)
  
  
  @app.route('/', methods=['GET', 'POST'])
  def detect_intent_text():
      if 'session_id' not in request.args:
          session_id = generate_session_id()
      else:
          session_id = request.args['session_id']
      text = request.args['text']
      request = detect_intent_texts(session_id, text)
      response = request.fulfillment_text
      return response
  
  if __name__ == '__main__':
      app.run()
  
  assert detect_intent_text(session_id='12345', text='What day is today?')=='Today is Monday.'
  assert detect_intent_text(session_id='54321', text='What is the current day of the week?')=='The current day of the week is Tuesday.'
  assert detect_intent_text(session_id='', text='What day is today?')=='Today is Wednesday.'
  assert detect_intent_text(session_id='98765', text='Is today Thursday?')=='Yes, today is Thursday.'
  assert detect_intent_text(session_id=None, text='What day is it today?')=='Today is Friday.'
output: def detect_intent_text(session_id=None, text=None):
      if not session_id:
          session_id = generate_session_id()
      request = detect_intent_texts(session_id, text)
      response = request.fulfillment_text
      return response