1
votes

Is it possible to disable a response via webhook fulfillment? I'm using v2 of the DialogFlow API.

I'd like to add a 'live agent takeover' option to our bot -- but can't seem to disable a response when using fulfillment webhooks. I've tried responding to fulfillment with empty, false and null values for fulfillmentText or fulfillmentMessages, but to no avail. When I empty these values DialogFlow simply repopulates with the default text.

{
  "fulfillmentText": "",
  "fulfillmentMessages": [],
  "outputContexts": [
    {
      "name": "projects/${PROJECT_ID}/agent/sessions/${SESSION_ID}/contexts/context name",
      "lifespanCount": 5,
      "parameters": {
        "param": "param value"
      }
    }
  ]
}

Suggestions?

2

2 Answers

0
votes

It sounds like what you want in this case is to short-circuit Dialogflow directly and, instead of talking to the bot, talk to another person using the chat platform. That isn't really possible.

Dialogflow expects responses within about 5-10 seconds, or it thinks the webhook isn't responding at all. So while you could potentially build a bot that either gets internal replies if there is no live agent, and lets a person enter in replies otherwise, that person would have to reply quickly, and there isn't any way for that person to send multiple replies.

-1
votes

In the Dialogflow, you can scroll down the intent and disable the webhook if you do not want the response served from fulfilment.