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 请提供一个符合要求的网页链接。
  • ¥20 用HslCommunication 连接欧姆龙 plc有时会连接失败。报异常为“未知错误”
  • ¥15 网络设备配置与管理这个该怎么弄
  • ¥20 机器学习能否像多层线性模型一样处理嵌套数据
  • ¥20 西门子S7-Graph,S7-300,梯形图
  • ¥50 用易语言http 访问不了网页
  • ¥50 safari浏览器fetch提交数据后数据丢失问题
  • ¥15 matlab不知道怎么改,求解答!!
  • ¥15 永磁直线电机的电流环pi调不出来
  • ¥15 用stata实现聚类的代码