drz73366 2018-07-18 04:01
浏览 46
已采纳

Watson Assistant CURL API:如何使用OPTIONS处理响应?

I'm trying out IBM Watson Assistant. Ultimate goal is to integrate it with my custom PHP backend, via it's Watson Assistant's cURL API Endpoints (because there's no complete PHP SDK yet).

When I setup a Dialog with the OPTIONS (other than, TEXT) as the Respond, the OPTIONS are perfectly working inside it's own "Try it out" Chat Window. But when I query it through the cURL API as usual, everything else is working except for that Dialogs with OPTIONS.

Here's the working example inside Try it out Window:

enter image description here

But then, here's the return from cURL API (for the same question asked):

stdClass Object
(
    [intents] => Array
        (
            [0] => stdClass Object
                (
                    [intent] => SOexchangenetworks
                    [confidence] => 1
                )

        )

    [entities] => Array
        (
        )

    [input] => stdClass Object
        (
            [text] => Which Stack Exchange Network should I go to look for an answer?
        )

    [output] => stdClass Object
        (
            [text] => Array
                (
                )

            [nodes_visited] => Array
                (
                    [0] => node_1_1531885028865
                )

            [log_messages] => Array
                (
                )

        )

    [context] => stdClass Object
        (
            [conversation_id] => 77ec8fc6-fb6a-4890-92b4-c58cdbc85ba3
            [system] => stdClass Object
                (
                    [dialog_stack] => Array
                        (
                            [0] => stdClass Object
                                (
                                    [dialog_node] => root
                                )

                        )

                    [dialog_turn_counter] => 1
                    [dialog_request_counter] => 1
                    [branch_exited] => 1
                    [branch_exited_reason] => completed
                )

        )

)

Problem Highlight:

You can see that [output][text] section is totally blank, when the Dialog Respond contains OPTIONS.

Note: Normally, the [output][text] section contains the reply from Watson, if the Respond type is Text. I've been keep using this cURL API for a while.

How do I solve this please?

  • 写回答

1条回答 默认 最新

  • drrw8672 2018-07-18 07:15
    关注

    Based on the Watson Assistant release notes so called "rich responses" were added July 2018. The current API version is 2018-07-10. In your curl command you are using the API version 2018-02-16. Try the curl command again, but we the current API version.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 MapReduce结果输出到HBase,一直连接不上MySQL
  • ¥15 扩散模型sd.webui使用时报错“Nonetype”
  • ¥15 stm32流水灯+呼吸灯+外部中断按键
  • ¥15 将二维数组,按照假设的规定,如0/1/0 == "4",把对应列位置写成一个字符并打印输出该字符
  • ¥15 NX MCD仿真与博途通讯不了啥情况
  • ¥15 win11家庭中文版安装docker遇到Hyper-V启用失败解决办法整理
  • ¥15 gradio的web端页面格式不对的问题
  • ¥15 求大家看看Nonce如何配置
  • ¥15 Matlab怎么求解含参的二重积分?
  • ¥15 苹果手机突然连不上wifi了?