Shaveta Arya
Shaveta Arya

Reputation: 21

Saving user utterance in a parameter during no match intent on start page

I am trying to implement a search functionality using webhook. I want to save user utterance in a parameter in case user query does not match any intent on start page. Is there any way to save user utterances in parameter so that it can be used by webhook . Currently no match intent is invoked correctly but utterance does not go to webhook.

Upvotes: 0

Views: 1272

Answers (2)

hannah
hannah

Reputation: 228

You should be able to extract the original user query and pass it as a parameter to your CX agents using webhook.

To do so, you should enable the “Use Webhook” option on the specific route where you want the user query to be extracted. When that route is triggered, you should be able to extract the original user query in your Webhook Request’s query union field. Here are the four possible Webhook Request fields where you can extract the relevant data based on the input type that the user provided:

The user query that you extracted can then be passed as a parameter to your CX agent by adding it to your WebhookResponse body inside either of the following field:

Here’s an example webhook response containing a session parameter:

jsonResponse = { 
"session_info": 
  { 
    "parameters": 
    { 
      "parameter_name": "parameter value" 
    } 
  } 
};

Upvotes: 3

Teresa
Teresa

Reputation: 373

What you can do:

  • Create an intent (e.g. 'NoMatchUtterance')
  • Fully label any training frases (this could just be some random phrases) for this intent with the parameter-id no-match-utterance (or something else) of type @sys.any. This will make sure that any reply is caught.
  • Create a route with this intent, below routes that match any other, preset intents. In the fulfillment of this route, you can now use $session.params.no-match-utterance.

An example from my projects: enter image description here

Upvotes: 1

Related Questions