Search code examples
dialogflow-eschatbot

How to use custom logic with Chatbot frameworks


I am working on a chatbot, I have implemented it with Dialogflow (Dialogflow ES). I found that Dialogflow has the following Pros

  • Easy to use
  • Good at Intent classification
  • Good at extracting Entities (prebuilt/custom)
  • Conversations can be chained to a certain extent using input/output contexts and lifespan

But in my use case, there are certain situations where human level judgment is required and it cannot be done using Dialogflow. Can we add our custom logic to process certain user requests in Dialogflow or any other chatbot framework which provide more flexibility?


Solution

  • You're a bit vague what you mean by "custom logic", but this sounds like fulfillment is what you're looking for.

    With this, you can enable Intents so they send JSON to code that you run (either by a webhook you run or via some deployed through an inline editor which manages the deployment for you). Your code can apply your business logic to determine what the response might be, including what replies to send, what Output Contexts are set, and any parameters that are in those Contexts.