2017-06-06 1 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

あなたはどんなウェブフックサンプルを見ていますか? – Prisoner

+0

@Prisoner - これらのリンク:https://docs.api.ai/docs/webhook&https://developers.google.com/actions/assistant/responses#jsonから、私は両方をマージする方法がわかりません。 –

答えて

4

表示される応答は基本的なAPI.AI応答形式です。ただし、Googleでアクションこれを拡張し、以下に提示するよう主に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" 
      } 
     ] 
     } 
    } 
    } 
} 

これが唯一のアクションオンGoogleのアプリケーションのための提案が表示されること、注意することが重要であり、それは勝ちましたFacebookなどのようなものには何もしないでください

関連する問題