2016-12-28 54 views

回答

0

打開webhook功能的意圖。您將能夠獲得請求以及與其相關的所有數據。您也可以發送回API.AI。下面是完整的圓:

{ 
    "id": "891db09a-851c-43dc-81c6-4c6705c94f85", 
    "timestamp": "2017-01-03T10:31:18.676Z", 
    "result": { 
    "source": "agent", 
    "resolvedQuery": "yes, France", 
    "action": "show.news", 
    "actionIncomplete": false, 
    "parameters": { 
     "adjective": "", 
     "subject": "France" 
    }, 
    "contexts": [ 
     { 
     "name": "subject", 
     "parameters": { 
      "subject.original": "France", 
      "adjective": "", 
      "subject": "France", 
      "adjective.original": "" 
     }, 
     "lifespan": 5 
     }, 
     { 
     "name": "region", 
     "parameters": { 
      "subject.original": "France", 
      "adjective": "", 
      "subject": "France", 
      "adjective.original": "" 
     }, 
     "lifespan": 5 
     } 
    ], 
    "metadata": { 
     "intentId": "34773849-4ac2-4e28-95a5-7abfc061044e", 
     "webhookUsed": "true", 
     "webhookForSlotFillingUsed": "false", 
     "intentName": "subject" 
    }, 
    "fulfillment": { 
     "speech": "Here is the latest news\n\n According to Watson the main emotion expressed in the article is: ;((sadness)\n\n Son of Equatorial Guinea’s president facing trial in France\n\nPARIS — After years of investigation, France on Monday put the son of the president of Equatorial Guinea on trial for corruption, charged with spending many millions in state funds — much of it allegedly in cash — to feed an opulent lifestyle of fast cars, designer clothes, works of art and...\n\nRead more: https://www.washingtonpost.com/world/europe/son-of-equatorial-guineas-president-facing-trial-in-france/2017/01/02/b03d30d0-d0cb-11e6-9651-54a0154cf5b3_story.html", 
     "source": "Washington Post", 
     "displayText": "Here is the latest news. According to Watson the main emotion expressed in the article is: sadness", 
     "messages": [ 
     { 
      "type": 0, 
      "speech": "Here is the latest news\n\n According to Watson the main emotion expressed in the article is: ;((sadness)\n\n Son of Equatorial Guinea’s president facing trial in France\n\nPARIS — After years of investigation, France on Monday put the son of the president of Equatorial Guinea on trial for corruption, charged with spending many millions in state funds — much of it allegedly in cash — to feed an opulent lifestyle of fast cars, designer clothes, works of art and...\n\nRead more: https://www.washingtonpost.com/world/europe/son-of-equatorial-guineas-president-facing-trial-in-france/2017/01/02/b03d30d0-d0cb-11e6-9651-54a0154cf5b3_story.html" 
     } 
     ], 
     "data": { 
     "newsAgent": { 
      "adjective": "", 
      "subject": "France", 
      "intent": "subject", 
      "action": "show.news", 
      "news": { 
      "title": "Son of Equatorial Guinea’s president facing trial in France", 
      "source": "Washington Post", 
      "link": "https://www.washingtonpost.com/world/europe/son-of-equatorial-guineas-president-facing-trial-in-france/2017/01/02/b03d30d0-d0cb-11e6-9651-54a0154cf5b3_story.html", 
      "language": "english", 
      "body": "PARIS — After years of investigation, France on Monday put the son of the president of Equatorial Guinea on trial for corruption, charged with spending many millions in state funds — much of it allegedly in cash — to feed an opulent lifestyle of fast cars, designer clothes, works of art and...", 
      "emotion": "sadness", 
      "emoticon": ";(" 
      }, 
      "speech": "Here is the latest news", 
      "sessionId": "0856125a-d0bc-4cba-990d-cbcfaea536db" 
     } 
     } 
    }, 
    "score": 1 
    }, 
    "status": { 
    "code": 206, 
    "errorType": "partial_content", 
    "errorDetails": "Webhook call failed. Error message: Webhook contains contexts with empty names or names containing whitespaces. ErrorId: 131000fa-0ec1-4efb-b47c-64301ac7bb2b" 
    }, 
    "sessionId": "0856125a-d0bc-4cba-990d-cbcfaea536db" 
} 

result對象是API.AI向您發送請求時,你得到的contexts對象也是如此。

fulfilment對象是我的終點送回API.AI響應

Check the documentation

+0

嘿薩繆爾 - 感謝您的幫助,我現在纔看到它(回休假),事情是,我一直一直陷入同樣的​​問題 - 如果我意圖使用webhook功能,它實際上(據我瞭解)意味着我需要進入履行部分並啓用webhook =>意味着我需要實現履行響應內容API.AI,否則意圖不會知道「該回答什麼」用戶...因此,我不想現在構建所有的履行邏輯,我只想獲取數據並響應wi雖然好的200,但似乎API.AI不知道如何在不破壞我的機器人。 –

相關問題