I've been implementing a chatbot using Python to manage the backend and DialogFlow to handle the natural language processing. Trying to learn python and DialogFlow at the same time has definitely been a challenge.
For multiple reasons I want the app to serve as the main webhook point for the clients. Mainly because I'd like to keep it decoupled from DialogFlow, and since I'll most likely have multiple types of clients (facebook messenger, alexa, twitter, web chat, etc) and multiple clients of each type (many facebook pages, several skills, etc) I'd rather have 1 central location I can point everything to in case I need to change it later.
I'm definitely nervous about being reliant on outside entities after going through the huge pain of switching from Stats Inc to the local NFL feeds when we sold FanNation to Sports Illustrated, so I try to avoid it whenever possible.
There will also be a lot of customization depending on where the requests are coming from. I'm pretty sure this could all be handled in the DialogFlow webhook, I wanted to also leave the possibility open to manage it directly from the client webhooks.
To make things easier on myself, I've started calling it the Primobot Client Handler (PCH) and Primobot DialogFlow Handler(PDH).
The Primobot Client Handler flow is:
I was originally struggling with this because the two processes kept merging in my head since the code was right next to each other. Once I split it up into Client Handling and DialogFlow Handling it started to become much more clear to me. They are definitley disctinct processes and should be handled completely differently. They wouldn't even need to be served by the same app.
We'll see where it goes from here!
Let me know in the comments below.