Pedro Silva
Pedro Silva

Reputation: 147

How to put my DialogFlow chatbot with python on line?

I am developing a chatbot using DialogFlow, as my natural language processing handler, and Python as my client.

My application aims to talk with a human in a python environment (I am currently using a Jupyter Notebook), send the request to DialogFlow, get the response, then calculate the data using some python libraries and show the results to the user.

All the process described above is already working.

Now I must to find a way that lets the people uses my chatbot on line. Here is my problem, I don't know how to model this.

I think I should put my chatbot in a webpage and make it communicate with my python application stored in a server.

Did anybody make something similar?

Upvotes: 2

Views: 2506

Answers (1)

Daniel Situnayake
Daniel Situnayake

Reputation: 2904

Given your current architecture, you'll have to do the following:

  • Write a client for your chatbot in HTML and JavaScript
  • Write a server in Python that contains your application logic and makes the API calls to Dialogflow

This is a pretty normal architecture for a web application. Given that you're using Python, you might find Flask or Django helpful.

There should be plenty of samples out there that can help you figure out what to do; I just found this blog post that demonstrates how to build a simple chat client/server with Flask and websockets.

If you're willing to change your architecture so that the user interacts directly with Dialogflow, and all of your application logic lives in the Dialogflow fulfillment webhook, you can make use of Dialogflow's Web Demo integration that provides a pre-built chat widget you can embed into an HTML page.

Upvotes: 1

Related Questions