title: How to use Detect Intent(Text) in Django Python?
body: <p>I'm creating a chatbot with Dialogflow and Django-python. Right now, I already created an agent in Dialogflow, already have a Django app, used ngork, and other necessary stuffs except for connecting Dialogflow to Django app's fulfillment/and calling APIs.</p>
  
  <p>I stumbled across this documentation <a href="https://github.com/googleapis/dialogflow-python-client-v2" rel="nofollow noreferrer">https://github.com/googleapis/dialogflow-python-client-v2</a> and successfully did all the steps needed. In the last part of the documentation, it seems that what I finally need to do is use the dialogflow detect intent text , so I copied it and put it into my Django app(<em>views.py</em>).</p>
  
  <pre><code>def detect_intent_texts(project_id, session_id, texts, language_code):
      """Returns the result of detect intent with texts as inputs.
  
      Using the same `session_id` between requests allows continuation
      of the conversation."""
  
      import dialogflow_v2 as dialogflow
      session_client = dialogflow.SessionsClient()
  
      session = session_client.session_path(project_id, session_id)
      print('Session path: {}\n'.format(session))
  
      for text in texts:
          text_input = dialogflow.types.TextInput(
              text=text, language_code=language_code)
  
          query_input = dialogflow.types.QueryInput(text=text_input)
  
          response = session_client.detect_intent(
              session=session, query_input=query_input)
  
          print('=' * 20)
          print('Query text: {}'.format(response.query_result.query_text))
          print('Detected intent: {} (confidence: {})\n'.format(
              response.query_result.intent.display_name,
              response.query_result.intent_detection_confidence))
          print('Fulfillment text: {}\n'.format(
              response.query_result.fulfillment_text))
  </code></pre>
  
  <p>Now, I don't know what to do next. Unfortunately, I don't know how to use it or how it exactly works as I am still new to this. I already searched for answers in the web but I didn't get a clear understanding about it and got overwhelmed a bit(as it seems that there is a lot to do with this). I hope I could get an example or step by step procedure about it.</p>