2017-06-06 43 views
0

我想引導用戶基於webhook迴應建議芯片。從網絡掛接樣,我見以下結構:Webhook迴應「建議芯片」

"fulfillment": { 
    "speech": "Today in Boston: Fair, the temperature is 37 F", 
    "source": "apiai-weather-webhook-sample", 
    "displayText": "Today in Boston: Fair, the temperature is 37 F" 
} 

但是,如果我想建議用戶下一步您可以要求繼續交談,然後我如何通過建議芯片網絡掛接回應?

+0

你在看什麼樣的webhook樣本? – Prisoner

+0

@Prisoner - 從這些鏈接:https://docs.api.ai/docs/webhook&https://developers.google.com/actions/assistant/responses#json,我不知道如何合併兩者。 –

回答

4

您顯示的響應是基本的API.AI響應格式。然而,在谷歌的行動對此進行了擴展,並主要採用data.google字段介紹如下:

{ 
    "speech":"This is a simple response with suggestion chips", 
    "data": { 
    "google": 
    { 
     "expectUserResponse":true, 
     "richResponse": 
     { 
     "items": 
     [ 
      { 
      "simpleResponse": 
      { 
       "textToSpeech":"This is a simple response for with suggestion chips" 
      } 
      } 
     ], 
     "suggestions": 
     [ 
      { 
      "title":"Option 1" 
      }, 
      { 
      "title":"Option 2" 
      } 
     ] 
     } 
    } 
    } 
} 

這要注意的是,這只是一個動作上,谷歌應用程序顯示的建議,它贏得了」不要爲Facebook等東西做任何事情。