2

我已经下载了 program-ab-0.0.4.3,这样我就可以使用 AIML 2.0 的特性了。

我想根据用户输入进行 API 调用。关于我该怎么做的任何指导?

我阅读了有关 oob 标签和 sraix 的内容,program-ab-0.0.4.3 的 aiml 文件夹中有一些 oob 标签示例,但是当我运行它以了解它的工作原理时,它只是输出标签作为结果

    Ex: Human: what is the weather like?
    Sraix ‘WHAT+IS+THE+WEATHER+LIKE’ failed
    Robot: I used my lifeline to ask another robot, but he didn’t know.
    Perhaps we should try a web search.
    <oob><search>what is the weather like</search></oob>

请帮助我了解如何根据用户输入调用任何 API,并根据 API 响应向用户提供自定义输出

谢谢

4

1 回答 1

0

Your api call should look something like this. Change service to XML if you are using an XML to pass data.

For more details refer here https://www.botlibre.com/forum-post?id=13020078

<category>
        <pattern>*</pattern>
        <that>What is your postal code</that>
        <template>You live in <sraix service="JSON" hint="code/name">URL_GOES_HERE</sraix>.</template>
    </category>
于 2017-02-01T11:12:22.173 回答