Actions on Google の典型的なインタラクションのシナリオでは、ユーザーがフレーズを発話してアクションを呼び出します。Actions on Google は、レスポンスを提供するため、ユーザーが呼び出したアクションに一致するフルフィルメントを見つけてリクエストを送信します。
Actions on Google は、フルフィルメントがユーザーの呼び出しに適していることを確認すると、ユーザーのリクエスト情報を含む JSON ペイロードを含む HTTP リクエストをフルフィルメント エンドポイントに送信して会話セッションを開始します。フルフィルメントはリクエストを解析し、JSON ペイロードを含むレスポンスを返します。Actions on Google は、ペイロードをレンダリングされた音声とマルチメディア出力に変換します。
図 1. Actions SDK を介してフルフィルメントを呼び出す Actions on Google。
Actions on Google が Actions SDK を介してフルフィルメントを呼び出すときの JSON ペイロードの形式については、会話 Webhook の形式をご覧ください。
Dialogflow のリクエストとレスポンス
アクションを作成するときに、必要に応じて Dialogflow を使用して、会話インターフェースの構築タスクを簡素化できます。このシナリオでは、Dialogflow は Actions on Google とフルフィルメントの間のプロキシとして機能します。HTTP/JSON リクエストをフルフィルメント エンドポイントに直接送信するのではなく、Actions on Google が Dialogflow に送信します。
[[["わかりやすい","easyToUnderstand","thumb-up"],["問題の解決に役立った","solvedMyProblem","thumb-up"],["その他","otherUp","thumb-up"]],[["必要な情報がない","missingTheInformationINeed","thumb-down"],["複雑すぎる / 手順が多すぎる","tooComplicatedTooManySteps","thumb-down"],["最新ではない","outOfDate","thumb-down"],["翻訳に関する問題","translationIssue","thumb-down"],["サンプル / コードに問題がある","samplesCodeIssue","thumb-down"],["その他","otherDown","thumb-down"]],["最終更新日 2023-12-02 UTC。"],[[["Actions on Google communicates with your fulfillment service through webhooks, sending JSON payloads that describe user requests."],["Your fulfillment service needs to process these requests, generate appropriate JSON responses, and send them back to the Assistant."],["There are two main webhook formats: Dialogflow webhook format and Conversation webhook format, depending on whether you use Dialogflow or Actions SDK."],["Webhooks can handle different request types like invocation requests, conversation requests, and helper results, each with specific JSON structures."],["Dialogflow can act as a proxy between Actions on Google and your fulfillment, handling the communication and format conversions."]]],["Actions on Google uses webhooks to communicate with fulfillment services, sending HTTP POST requests with JSON payloads. Fulfillment services must parse these requests and respond with appropriately formatted JSON. There are two main webhook formats: Dialogflow and Conversation, corresponding to whether Dialogflow acts as a proxy. Webhook requests can be invocations, conversation turns, or helper results. The fulfillment reads parameters from the request payload and sends a reply back to the Assistant.\n"]]