2016-08-18 45 views
1

我已經下載了程序-ab-0.0.4.3,以便我可以使用AIML 2.0功能。如何使用程序AB

我想根據用戶輸入進行API調用。我如何做的任何指導?

我讀過oob標籤和sraix,在programl-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響應用戶

感謝

回答

0

你的API調用應該是這個樣子。如果您使用XML傳遞數據,請將服務更改爲XML。

更多詳細信息請點擊這裏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>