Where will the reply of a Carousel Selector be sent when using Dialogflow fulfillment server?

前端 未结 1 1562
不思量自难忘°
不思量自难忘° 2021-01-25 17:36

I am trying to figure out how I can embed Google Actions responses, such as the carousel, in a webhook response for DialogFlow.

As epxlained in Is there a way to simply

1条回答
  •  囚心锁ツ
    2021-01-25 18:23

    For starters - rest assured. You need only one webhook and that is the one that you're already using to work with Dialogflow. Responses will go through Dialogflow, but you need to make sure you've added an Intent to handle it.

    The intent needs to be set to use an Event of actions_intent_OPTION. You should not give it any training phrases, but do make sure you set the Action and turn on the fulfillment selector.

    When you handle this in your webhook, if you're using the Node.js API, the key of the option will be in a context named actions_intent_option. You can access it with something like this:

    const param = app.getContextArgument('actions_intent_option', 'OPTION').value;
    

    If you prefer to use JSON, you can find the information under

    originalRequest.data.inputs[0].arguments[0].textValue
    

    0 讨论(0)
提交回复
热议问题