How to pass variables as context to IBM Cloud Watson Assistant with V2?
up vote
1
down vote
favorite
I am trying to use the new API version V2 for IBM Cloud Watson Assistant. Instead of sending a message for a workspace I need to send a message to an assistant. The context structure has global and skill-related sections now.
How would my app pass in values as context variables? Where in the structure would they need to be placed? I am using the Python SDK.
I am interested in sending information as part of client dialog actions.
python ibm-cloud watson-conversation
add a comment |
up vote
1
down vote
favorite
I am trying to use the new API version V2 for IBM Cloud Watson Assistant. Instead of sending a message for a workspace I need to send a message to an assistant. The context structure has global and skill-related sections now.
How would my app pass in values as context variables? Where in the structure would they need to be placed? I am using the Python SDK.
I am interested in sending information as part of client dialog actions.
python ibm-cloud watson-conversation
What language are you using?
– German Attanasio
Nov 22 at 15:58
added info about Python SDK
– data_henrik
Nov 22 at 16:02
There seems to be an issue with the SDK where only 3 documented variables are sent as part of the context github.com/watson-developer-cloud/python-sdk/issues/597. The developer is looking at the problem but I don't think it will get fixed before Monday
– German Attanasio
Nov 22 at 16:05
I tried context->skills->main skill->user_defined and it seems to work
– data_henrik
Nov 22 at 16:08
1
@GermanAttanasio I updated my answer with complete cURL request and response for your reference - stackoverflow.com/questions/53404249/…
– Vidyasagar Machupalli
Nov 23 at 2:24
add a comment |
up vote
1
down vote
favorite
up vote
1
down vote
favorite
I am trying to use the new API version V2 for IBM Cloud Watson Assistant. Instead of sending a message for a workspace I need to send a message to an assistant. The context structure has global and skill-related sections now.
How would my app pass in values as context variables? Where in the structure would they need to be placed? I am using the Python SDK.
I am interested in sending information as part of client dialog actions.
python ibm-cloud watson-conversation
I am trying to use the new API version V2 for IBM Cloud Watson Assistant. Instead of sending a message for a workspace I need to send a message to an assistant. The context structure has global and skill-related sections now.
How would my app pass in values as context variables? Where in the structure would they need to be placed? I am using the Python SDK.
I am interested in sending information as part of client dialog actions.
python ibm-cloud watson-conversation
python ibm-cloud watson-conversation
edited Nov 22 at 16:02
asked Nov 22 at 15:55
data_henrik
8,54021030
8,54021030
What language are you using?
– German Attanasio
Nov 22 at 15:58
added info about Python SDK
– data_henrik
Nov 22 at 16:02
There seems to be an issue with the SDK where only 3 documented variables are sent as part of the context github.com/watson-developer-cloud/python-sdk/issues/597. The developer is looking at the problem but I don't think it will get fixed before Monday
– German Attanasio
Nov 22 at 16:05
I tried context->skills->main skill->user_defined and it seems to work
– data_henrik
Nov 22 at 16:08
1
@GermanAttanasio I updated my answer with complete cURL request and response for your reference - stackoverflow.com/questions/53404249/…
– Vidyasagar Machupalli
Nov 23 at 2:24
add a comment |
What language are you using?
– German Attanasio
Nov 22 at 15:58
added info about Python SDK
– data_henrik
Nov 22 at 16:02
There seems to be an issue with the SDK where only 3 documented variables are sent as part of the context github.com/watson-developer-cloud/python-sdk/issues/597. The developer is looking at the problem but I don't think it will get fixed before Monday
– German Attanasio
Nov 22 at 16:05
I tried context->skills->main skill->user_defined and it seems to work
– data_henrik
Nov 22 at 16:08
1
@GermanAttanasio I updated my answer with complete cURL request and response for your reference - stackoverflow.com/questions/53404249/…
– Vidyasagar Machupalli
Nov 23 at 2:24
What language are you using?
– German Attanasio
Nov 22 at 15:58
What language are you using?
– German Attanasio
Nov 22 at 15:58
added info about Python SDK
– data_henrik
Nov 22 at 16:02
added info about Python SDK
– data_henrik
Nov 22 at 16:02
There seems to be an issue with the SDK where only 3 documented variables are sent as part of the context github.com/watson-developer-cloud/python-sdk/issues/597. The developer is looking at the problem but I don't think it will get fixed before Monday
– German Attanasio
Nov 22 at 16:05
There seems to be an issue with the SDK where only 3 documented variables are sent as part of the context github.com/watson-developer-cloud/python-sdk/issues/597. The developer is looking at the problem but I don't think it will get fixed before Monday
– German Attanasio
Nov 22 at 16:05
I tried context->skills->main skill->user_defined and it seems to work
– data_henrik
Nov 22 at 16:08
I tried context->skills->main skill->user_defined and it seems to work
– data_henrik
Nov 22 at 16:08
1
1
@GermanAttanasio I updated my answer with complete cURL request and response for your reference - stackoverflow.com/questions/53404249/…
– Vidyasagar Machupalli
Nov 23 at 2:24
@GermanAttanasio I updated my answer with complete cURL request and response for your reference - stackoverflow.com/questions/53404249/…
– Vidyasagar Machupalli
Nov 23 at 2:24
add a comment |
1 Answer
1
active
oldest
votes
up vote
1
down vote
accepted
Based on testing the Python SDK and the API V2 using a tool, I came to the following conclusion. Context is provided by the assistant if it is requested as part of the input options.
"context": {
"skills": {
"main skill": {
"user_defined": {
"topic": "some chatbot talk",
"skip_user_input": true
}
}
},
"global": {
"system": {
"turn_count": 2
}
}
}
To pass back values from my client / app to the assistant, I could use the context parameter. However, in contrast to the V1 API I needed to place the key / value pairs "down below" in the user_defined part:
context['skills']['main skill']['user_defined'].update({'mydateOUT':'2018-10-08'})
The above is a code snippet from this sample file for a client action. With that placement of my context variables everything works and I can implement client actions using the API Version 2.
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
accepted
Based on testing the Python SDK and the API V2 using a tool, I came to the following conclusion. Context is provided by the assistant if it is requested as part of the input options.
"context": {
"skills": {
"main skill": {
"user_defined": {
"topic": "some chatbot talk",
"skip_user_input": true
}
}
},
"global": {
"system": {
"turn_count": 2
}
}
}
To pass back values from my client / app to the assistant, I could use the context parameter. However, in contrast to the V1 API I needed to place the key / value pairs "down below" in the user_defined part:
context['skills']['main skill']['user_defined'].update({'mydateOUT':'2018-10-08'})
The above is a code snippet from this sample file for a client action. With that placement of my context variables everything works and I can implement client actions using the API Version 2.
add a comment |
up vote
1
down vote
accepted
Based on testing the Python SDK and the API V2 using a tool, I came to the following conclusion. Context is provided by the assistant if it is requested as part of the input options.
"context": {
"skills": {
"main skill": {
"user_defined": {
"topic": "some chatbot talk",
"skip_user_input": true
}
}
},
"global": {
"system": {
"turn_count": 2
}
}
}
To pass back values from my client / app to the assistant, I could use the context parameter. However, in contrast to the V1 API I needed to place the key / value pairs "down below" in the user_defined part:
context['skills']['main skill']['user_defined'].update({'mydateOUT':'2018-10-08'})
The above is a code snippet from this sample file for a client action. With that placement of my context variables everything works and I can implement client actions using the API Version 2.
add a comment |
up vote
1
down vote
accepted
up vote
1
down vote
accepted
Based on testing the Python SDK and the API V2 using a tool, I came to the following conclusion. Context is provided by the assistant if it is requested as part of the input options.
"context": {
"skills": {
"main skill": {
"user_defined": {
"topic": "some chatbot talk",
"skip_user_input": true
}
}
},
"global": {
"system": {
"turn_count": 2
}
}
}
To pass back values from my client / app to the assistant, I could use the context parameter. However, in contrast to the V1 API I needed to place the key / value pairs "down below" in the user_defined part:
context['skills']['main skill']['user_defined'].update({'mydateOUT':'2018-10-08'})
The above is a code snippet from this sample file for a client action. With that placement of my context variables everything works and I can implement client actions using the API Version 2.
Based on testing the Python SDK and the API V2 using a tool, I came to the following conclusion. Context is provided by the assistant if it is requested as part of the input options.
"context": {
"skills": {
"main skill": {
"user_defined": {
"topic": "some chatbot talk",
"skip_user_input": true
}
}
},
"global": {
"system": {
"turn_count": 2
}
}
}
To pass back values from my client / app to the assistant, I could use the context parameter. However, in contrast to the V1 API I needed to place the key / value pairs "down below" in the user_defined part:
context['skills']['main skill']['user_defined'].update({'mydateOUT':'2018-10-08'})
The above is a code snippet from this sample file for a client action. With that placement of my context variables everything works and I can implement client actions using the API Version 2.
answered Nov 23 at 7:54
data_henrik
8,54021030
8,54021030
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53434543%2fhow-to-pass-variables-as-context-to-ibm-cloud-watson-assistant-with-v2%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
What language are you using?
– German Attanasio
Nov 22 at 15:58
added info about Python SDK
– data_henrik
Nov 22 at 16:02
There seems to be an issue with the SDK where only 3 documented variables are sent as part of the context github.com/watson-developer-cloud/python-sdk/issues/597. The developer is looking at the problem but I don't think it will get fixed before Monday
– German Attanasio
Nov 22 at 16:05
I tried context->skills->main skill->user_defined and it seems to work
– data_henrik
Nov 22 at 16:08
1
@GermanAttanasio I updated my answer with complete cURL request and response for your reference - stackoverflow.com/questions/53404249/…
– Vidyasagar Machupalli
Nov 23 at 2:24