Kalpesh
Kalpesh

Reputation: 1

IBM Watson conversion for dialog

I created one project with watson conversion. Flow is like:(sorry i can't show my dialog flow but i will try to explain it)

(W:Watson,U:User)

U:what documents required for open account? W: Name, Email, Contact. Can I open it for you? U:Yes W:Great, Please enter your Name. U: XYZ W: XYZ please enter your contact number. U: 9999999999 W: XYZ, you are doing great please enter your email. U: [email protected]

now come to watson dialog part.

W:Great, Please enter your name.(i used " < ? input.text ?>" to take user input)
{
"context":{"name":"< ? input.text ?>"}
"output":{"text":"Great,Please enter your name."}
}

U:XYZ

W:XYZ please enter your contact number
{
"context":{"contact":"< ? input.text ?>"}
"output":{"text":"$name, Please enter your contact number"}
}

U:9999999999

W: XYZ, you are doing great please enter your email.
{
"context":{"email":"< ? input.text ?>"}
"output":{"text":"$name, you are doing great please enter your email."}
}

U: [email protected]

This is my flow and it is working perfect when I run it inside the watson. But when i am trying to run it from my own application then it takes only my name but not entered in loop means it is not taking other information.

reason is in json it pass:

{
"text":"XYZ"
}

but watson shows it's intent as irrelevant.

in my project i just want to pass user data from my application to watson and it display output as mention above.

is it support < ? input.text ?>...?

Upvotes: 0

Views: 169

Answers (1)

Ritu Singhal
Ritu Singhal

Reputation: 41

For the part where Watson Conversation is giving intent as irrelevant, it is so because you be missing to send parameter conversation_id as context parameter.

You will get conversation_id in response and pass it in subsequest calls. If you do not pass that, then a new id will be generated everytime

//Extract converstaionId from first call 
String conversationId=msgResponse.getContext().get("conversation_id")

//Second call in which user gives his name
Map contextData=new HashMap();
context.put("conversation_id", conversationId); // conversationId will be in the response of previous call

Upvotes: 0

Related Questions