Ricardo
Ricardo

Reputation: 1

DialogFlow, modify user request

for my dialogflow project I would like to intercept the user request before the dialogflow responds with the appropriated intent.

My goal:

-The user sends a request with an input message

-I access this message, I transform it (I apply a function to it) and then it is delivered to the dialogflow (so dialog.

I'm using a webhook linked to an specific intent. I'm using cloud functions to handle the webhook.

I would like to access the request using this webhook, modify the original request and allow dialogflow to respond according to this new modified request.

I hope I've made myself clear. Thank you very much in advance!

Upvotes: -2

Views: 238

Answers (1)

Noe Romero
Noe Romero

Reputation: 400

I think it is not possible using a webhook, I suggest you to take a look at the Dialogflow fulfillment documentation. As you can see in the architecture representation, your webhook is behind of the intent matched, so the user request has been processed by Dialogflow and the fulfillment will perform actions based on the matched intent, so you only be able to modify the task on the service that you defined within the fulfillment and its response.

You could be able to do this according to your use-case, if you're using a custom development to make calls to the Dialogflow API, you can add an additional step between End-User and Dialogflow where you could intercept the user request, modify it and then send it to the Dialogflow API.

If you’re using any integrations such as Action on Google or Dialogflow Hangouts, this will not be possible since these services are the ones that manage the calls to the Dialogflow API.

Upvotes: 0

Related Questions