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 乌班图ip地址配置及远程SSH
  • ¥15 怎么让点阵屏显示静态爱心,用keiluVision5写出让点阵屏显示静态爱心的代码,越快越好
  • ¥15 PSPICE制作一个加法器
  • ¥15 javaweb项目无法正常跳转
  • ¥15 VMBox虚拟机无法访问
  • ¥15 skd显示找不到头文件
  • ¥15 机器视觉中图片中长度与真实长度的关系
  • ¥15 fastreport table 怎么只让每页的最下面和最顶部有横线
  • ¥15 java 的protected权限 ,问题在注释里
  • ¥15 这个是哪里有问题啊?