2016-08-01 40 views
0

我已經創建了一個工作空間併爲對話服務創建了意圖,實體和對話框 在我們使用啓動工具並「試用」的地方,我可以看到watson文本回答我問的問題。但是,當我通過休息客戶端使用api命令時,它不會返回文本輸出。 我用於API的輸入是如何在使用watson對話API時獲取輸出文本

{ 
    "input": { 
    "text": "increase the temperature of ac" 
    } 
} 

並且作爲響應我得到了以下

{ 
"input": { 
"text": "increase the temperature of ac" 
}- 
"context": { 
"conversation_id": "5a7ce4c2-c6be-4cb8-b728-19136457bf28" 
"system": { 
"dialog_stack": [1] 
0: "root" 
- 
"dialog_turn_counter": 1 
"dialog_request_counter": 1 
}- 
}- 
"entities": [1] 
0: { 
"entity": "appliance" 
"location": [2] 
0: 28 
1: 30 
- 
"value": "ac" 
}- 
- 
"intents": [1] 
0: { 
"intent": "turn_up" 
"confidence": 0.9854193755106732 
}- 
- 
"output": { 
"log_messages": [0] 
"text": [0] 
"nodes_visited": [1] 
0: "node_1_1469526692057" 
- 
}- 
} 

它不列入具有在JSON輸出

+0

您確定應該爲該節點輸出文本嗎?在我看來,前端會根據intent'turn_up'採取行動。 –

+0

當使用curl嘗試相同的輸入時,我會得到預期的文本響應。您是否嘗試了API資源管理器[https://watson-api-explorer.mybluemix.net/apis/conversation-v1#!/message/post_v1_workspaces_workspace_id_message](https://watson-api-explorer.mybluemix.net/apis/談話-V1#!/消息/ post_v1_workspaces_workspace_id_message)?它顯示了要使用的curl命令以及可用於檢查REST客戶端的許多其他詳細信息。 – jagat

+0

http://stackoverflow.com/users/903526/jagat當您使用資源管理器嘗試時,您獲得了什麼文本回復。我得到了和我以上引用的相同的迴應,即使是來自探險家。我期待「log_messages」:[],有一些文字 –

回答

1

這是作爲預期工作的任何文本消息。

使用Github Conversation demo,您可以通過搜索"conditions": "#turn_up"在JSON中找到相關節點。這是相關的塊。

{ 
    "go_to": { 
    "return": null, 
    "selector": "condition", 
    "dialog_node": "node_11_1467233013716" 
    }, 
    "output": {}, 
    "parent": null, 
    "context": null, 
    "created": "2016-07-22T04:55:54.661Z", 
    "metadata": null, 
    "conditions": "#turn_up", 
    "description": null, 
    "dialog_node": "node_10_1467233003109", 
    "previous_sibling": "node_7_1467232789215" 
}, 

或者你可以看一下在對話UI尋找#turn_up塊。例如。

enter image description here

輸出字段爲空。所以輸出文本不會被Conversation處理。

它必須在應用程序層處理。這樣做有正當理由。例如,獨立創建答案存儲區使非技術用戶更容易更新。或者如果你想交給像Retrieve和Rank這樣的人來找到答案。

在這種情況下,Car演示如何處理這個問題將在教程視頻中詳細介紹,您可以在這裏看到。

https://youtu.be/wG2fuliRVNk

相關問題