2
Good morning, I’m trying to use the IBM chatbot service Watson. As a test I created my support workflow for a simple pizza order.
At the beginning of the call he welcomes you and asks what pizza I want.
It validates 3 information 1- Quantity 2- flavour 3- goes soda together
in the Watson test on the web panel it runs the Conversation perfectly as programmed. but when I input Curl it keeps repeating the start even though I answer the information the same way I did in the ibm website’s test chatweb input
follow my Cod Curl
curl -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' --header 'Authorization: Basic NDkzYzBmZWItMzg2MC00O6RiLTkyMjUtM2E0ODc4MDMxODY3OmGFTFUzdUd1a0NDRg==' -d '{ \
"input": { \
"text": "" \
} \
}' 'https://watson-api-explorer.mybluemix.net/conversation/api/v1/workspaces/9ec1ac11-786d-4c2d-9d8a-528265e3bcbb/message?version=2017-02-03'
and he gives me back this json
{
"intents": [],
"entities": [],
"input": {
"text": ""
},
"output": {
"log_messages": [],
"text": [
"bem vindo a pizzaria smartphone. quantas pizzas o senhor deseja pedir hoje?"
],
"nodes_visited": [
"inicio"
]
},
"context": {
"conversation_id": "3f4b12da-2c3c-4b04-a94e-2da688ece806",
"system": {
"dialog_stack": [
{
"dialog_node": "inicio"
}
],
"dialog_turn_counter": 1,
"dialog_request_counter": 1,
"_node_output_map": {
"inicio": [
0
]
}
}
}
}
how I should forward another request so that it continues in the same conversation and does not show me the start again every time I do Curl.
I tried to send it the following way and it continues with problems:
curl -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' --header 'Authorization: Basic NDkzYzBmZWItMzg2MC00O6RiLTkyMjUtM2E0ODc4MDMxODY3OmGFTFUzdUd1a0NDRg==' -d '{ \
"input": { \
"text": "quero uma pizza" \
}, \
"context": { \
"conversation_id": "3f4b12da-2c3c-4b04-a94e-2da688ece806" \
} \
}' 'https://watson-api-explorer.mybluemix.net/conversation/api/v1/workspaces/9ec1ac11-786d-4c2d-9d8a-528265e3bcbb/message?version=2017-02-03'
and he returns to me again the beginning:
{
"intents": [
{
"intent": "qtd-pizza",
"confidence": 0.9523983001708984
}
],
"entities": [
{
"entity": "qtd-pizza",
"location": [
6,
9
],
"value": "1",
"confidence": 1
},
{
"entity": "sys-number",
"location": [
6,
9
],
"value": "1",
"confidence": 1,
"metadata": {
"numeric_value": 1
}
}
],
"input": {
"text": "quero uma pizza"
},
"output": {
"log_messages": [],
"text": [
"bem vindo a pizzaria smartphone. quantas pizzas o senhor deseja pedir hoje?"
],
"nodes_visited": [
"inicio"
]
},
"context": {
"conversation_id": "3f4b12da-2c3c-4b04-a94e-2da688ece806",
"system": {
"dialog_stack": [
{
"dialog_node": "inicio"
}
],
"dialog_turn_counter": 1,
"dialog_request_counter": 1,
"_node_output_map": {
"inicio": [
0
]
}
}
}
}
I would like some guidance on how to proceed. Reading the json, Curl and etc I’m doing through a php and just need help with the working logic of Watson. Thanks in advance for your attention.
follows Watson api link and explorer api for online testing
https://www.ibm.com/watson/developercloud/conversation/api/v1/#send_message
https://watson-api-explorer.mybluemix.net/apis/conversation-v1#! /message/message
Please put the link to the Watson API.
– Diego Souza
added in the main post
– Jasar Orion