如何通过Watson Assistant API动态检索响应类型

时间:2018-07-23 09:51:31

标签: watson-conversation

在Watson Assistant对话框中,我们现在可以指定各种响应类型(文本,选项,图像和暂停)

例如enter image description here

使用以下API调用,我只能接收“文本”响应,而不是“选项”响应。

有什么想法吗?

curl -X POST \
  'https://gateway.watsonplatform.net/assistant/api/v1/workspaces/<Workspace ID>/message/?version=2018-02-16' \
  -H 'Authorization: Basic <Token>==' \
  -H 'Cache-Control: no-cache' \
  -H 'Content-Type: application/json' \
  -d '{
    "input": {
        "text": "Hi"
    }
}'

1 个答案:

答案 0 :(得分:1)

之所以不起作用,是因为该功能非常新。我们需要使用API​​版本2018-07-10

curl -X POST \
  'https://gateway.watsonplatform.net/assistant/api/v1/workspaces/<Workspace ID>/message/?version=2018-07-10' \
  -H 'Authorization: Basic <Token>==' \
  -H 'Cache-Control: no-cache' \
  -H 'Content-Type: application/json' \
  -d '{
    "input": {
        "text": "Hi"
    }
}'