Virtual Agent API - Default Topic

viniciusoliveir
Kilo Expert

Hello community, we`ve successfully connected the VA Chatbot to WhatsApp using the new VA API that came out on the Paris release, through a 3rd party messaging provider (e.g. twilio).

The problem is, anytime a user starts a chat through the API, the fallback topic is triggered instead, rather than the default topic that we need. 

When configuring VA on the portal, we are able to set in the widget instance the default topic sys_id that we want users to meet, but we have not seen such a way to specify what should be the default topic when triggering the VA chatbot through the API.

 

Has anyone been able to figure out a way for this? 

Thanks in advance.

1 ACCEPTED SOLUTION

viniciusoliveir
Kilo Expert

So just to close this topic, we`ve found a solution for this.

1 - The first issue was related to setting appropriate roles to our VA topic. Since the conversation starts through a non-logged user on whatsapp, we had to add the "public" role to the topic. Once we've done that, the system was able to present the topic to the user.

2 - Now, since we are using keyword-based topics, we had to find a way to trigger that one topic, no matter what the user input - and for sure the user would not enter the keyword that could trigger our topic.

3 - To resolve this, we`ve ended up adding a condition to intercept the first user message in our VA API scripted REST resource, by capturing the "START_CONVERSATION" contextual action on the request, and then we've replaced that first user message with the topic keyword.

 

View solution in original post

13 REPLIES 13

DarrenJ
Kilo Contributor

I think this is the same issue I'm running into whereby when using the API I consistently get "Sorry I don't understand" type responses to questions that work absolutely fine when testing using the webchat instance.

That's the exact same issue that I'm facing... i need it to have the same behavior as the portal, but i can't figure a way to specify what topic must be triggered...

It should really run NLU and select the right topic. My theory is that NLU isn't being executed for some reason hence it's not identifying what topic to activate and going to fallback. NLU is however turned on more generally as it works fine in the webchat portal.

I've experimented with passing most combinations of data in the initial request including language in the contextVariables section in case the NLU needs that to find the NLU model but all combinations of "english", "en", "en-us" don't appear to work.

In our case we are not using NLU. I have also tried typing the same keywords configured in the topic, but it ends the same way.

It's very weird not being able to config this for the API scenario, since it's so simple to config the default topic to be used on the web client (portal).

 

For my scenario, it does not matter the initial user text, it should always be presented the same topic.

Shipra8
ServiceNow Employee
ServiceNow Employee

Are you using Keyword or NLU based topic discovery?

When the end user starts a chat by typing something that doesn't have a topic match, the VA will go to fallback topic. Here is the sample json via API and the same experience is exhibited on web portal too (Refer attachment).

 

Flow Designer output"{
"requestId":"291bas2be70-sadsa-we32-3eq2-1231rtz",
"clientSessionId":"",
"message":{
"text":"Hello",
"typed":true
},
"userId":"abel.tuter",
"body":[
{
"uiType":"OutputText",
"group":"DefaultText",
"value":"I am sorry but I didn't understand your request.",
"maskType":"NONE"
},
{
"uiType":"OutputText",
"group":"DefaultText",
"value":"Please try giving me your request in a different way. I'm currently better at understanding short sentences.",
"maskType":"NONE"
},
{
"uiType":"TopicPickerControl",
"group":"DefaultPicker",
"nluTextEnabled":false,
"promptMsg":"Hi guest, please enter your request or make a selection of what I can help with. You can type help any time when you need help.",
"label":"Show me everything",
"options":[
{
"label":"Test B2B 2",
"value":"8373e55cdb8120108249f7541d96196d",
"enabled":true
},
{
"label":"FAQ Conversation Builder_Global",
"value":"9f3114a3dbc520108249f7541d961981",
"enabled":true
},
{
"label":"Get to know you_Global",
"value":"b1a56b87db8120108249f7541d9619b2",
"enabled":true
},
{
"label":"Live Agent Support.",
"value":"ce2ee85053130010cf8cddeeff7b12bf",
"enabled":true
}
]
}
],
"score":0
}

 

On the other hand , if your user input maps to a keyword associated with a topic, you should see an appropriate response.In the following example, I typed "FAQ" as an end user and it landed me in appropriate topic :

"Flow Designer output"{
"requestId":"261bas2be70-sadsa-we32-3eq2-1231rtz",
"clientSessionId":"",
"message":{
"text":"FAQ",
"typed":true
},
"userId":"abel.tuter",
"body":[
{
"uiType":"InputText",
"group":"DefaultText",
"required":true,
"nluTextEnabled":false,
"label":"What do you want to search today?",
"maskType":"NONE"
}
],
"takeControl":true,
"score":0
}