Hello , I've created workspace(Skill) "API Test For Chat". On Watson tool's try it panel and preview chat window everything works well, but when i try to chat using API calling then child dialog node never process. So i want to know that is any thing extra param which need to pass using API. I've referred following document link : https://cloud.ibm.com/apidocs/assistant?code=node#get-response-to-user-input.
Following is my API calling code :
let params = {
'workspace_id': workspace,
'input': {
'text': userInput
},
'nodes_visited_details': true
};
First, I'm sending a blank message to Watson using API , so it trigger welcome dialog. After next message i pass extra param in previous param example , i.e. added a conversation id like below :
let params = {
'workspace_id': workspace,
'input': {
'text': userInput
},
'nodes_visited_details': true,
'context':{
'conversation_id' : conversation_id
}
};
Here is step of user input :
1) About mellow
2) Advertiser
On first user input it trigger dialog About mellow jane and return response based on it. But after next user input advertiser, it trigger the fallback dialog. So i do not understand why it trigger fallback dialog. If user directly type advertiser then its OK, Watson can trigger fallback dialog as there is no root level dialog set for advertiser.
So can you please help me that what I'm missing when calling user input using API.
Also, here I'm attaching a screenshot of try it panel and preview link screenshot and workspace json.
I want that child node should trigger after its parents based on condition using API calling.
[1]: /answers/storage/temp/29116-skill-test-api-chat.txt
Answer by @chughts (12979) | Aug 08 at 04:33 AM
You are using the V1 API. In that you must send the full context object that is returned to you as part of the response. You can modify the context, to control the flow, but the context allows the dialog to continue from its last point. If you don't pass in the full context then the dialog will always start from the top.
You can avoid having to return the context in this way by using the V2 API - https://cloud.ibm.com/apidocs/assistant-v2 . The context is saved as part of the session, so you still need to establish and return a session id. You can start a fresh dialog by not sending a session id.
Hello @chughts, thanks for your reply. As per your suggestion I've passed the whole context with next user input using V1 API. And child dialog execute perfectly. But I've one concern on that when user first type invalid input and then type correct input in this case Watson also goes to fallback. So how can i make user on track.
As per my case user first type About mellow and Watson trigger parent level dialog after that if user type any invalid input then it goes to fallback and then if user type advertiser in this user also goes to fallback. But i want to trigger child advertiser dialog after getting advertiser input from user. So is that possible or not?
And for V2 API we need assistant id and right now i think Watson not providing API to create an assistant, so i can not able to use V2 API.
If you want to capture fall out conditions like this, you will need to add clauses or nodes that trigger on true
to handle any condition that you were not expecting. You can then route the dialog to the appropriate response.
Disambiguation does not work on WordPress plugin website 1 Answer
In Watson assistant what is the maximum no of responses per dialog 0 Answers
Watson assistant how can we set Standard and Frame type node in single dialog 1 Answer
Watson Assistant : How to call child node more than one time in a flow 1 Answer
Test for an empty JSON object? 1 Answer