シンプルな応答は、視覚的にチャットのふきだしの形をとり、音声にはテキスト読み上げ(TTS)または音声合成マークアップ言語(SSML)を使用します。会話で短くシンプルなレスポンスを使用することで、他の会話要素と組み合わせることができる明確なビジュアルとオーディオのインターフェースでユーザーのエンゲージメントを維持できます。
シンプルなレスポンスのチャットふきだしのコンテンツは、発音のサブセット、または TTS/SSML 出力の完全な音声文字変換である必要があります。これにより、ユーザーはアクションが何を言っているのかを明確化でき、さまざまな状況で理解を深めることができます。
プロンプトでは、first_simple
オブジェクトと last_simple
オブジェクトで指定したテキストに、単純なレスポンスのプロパティが使用されます。Google アシスタントは、プロンプトですべての単純なレスポンスを送信し、その後、最終的なリッチ レスポンスをプロンプト キューで送信します。
プロパティ
シンプル レスポンス タイプには次のプロパティがあります。
プロパティ | 種類 | 必須 / 任意 | 説明 |
---|---|---|---|
speech |
string | 任意 | SSML またはテキスト読み上げでユーザーに読み上げられる単語を表します。含まれるプロンプトの override フィールドが「true」の場合、このフィールドで定義された音声が、以前の単純なプロンプトの音声を置き換えます。 |
text |
string | 任意 |
チャットのふきだしに表示するテキスト。640 文字を超える文字列は、640 文字の前の最初の単語区切り(空白文字)で切り捨てられます。コンテンツが画面外に広がるのを防ぐために、特にカードなどの視覚要素と組み合わせる場合は、300 文字未満にすることをおすすめします。 指定しない場合、アシスタントは代わりに |
サンプルコード
YAML
candidates: - first_simple: variants: - speech: This is the first simple response. text: This is the 1st simple response. last_simple: variants: - speech: This is the last simple response. text: This is the last simple response.
JSON
{ "candidates": [ { "first_simple": { "variants": [ { "speech": "This is the first simple response.", "text": "This is the 1st simple response." } ] }, "last_simple": { "variants": [ { "speech": "This is the last simple response.", "text": "This is the last simple response." } ] } } ] }
Node.js
app.handle('Simple', conv => { conv.add(new Simple({ speech: 'This is the first simple response.', text: 'This is the 1st simple response.' })); conv.add(new Simple({ speech: 'This is the last simple response.', text: 'This is the last simple response.' })); });
JSON
{ "responseJson": { "session": { "id": "session_id", "params": {} }, "prompt": { "override": false, "firstSimple": { "speech": "This is the first simple response.", "text": "This is the 1st simple response." }, "lastSimple": { "speech": "This is the last simple response.", "text": "This is the last simple response." } } } }
SSML と音声
レスポンスで SSML と音声を使用して、より洗練され、ユーザー エクスペリエンスを向上させます。詳細については、SSML のドキュメントをご覧ください。
サウンド ライブラリ
YouTube のサウンド ライブラリには、さまざまな短いサウンドが無料で用意されています。これらのサウンドはお客様向けにホストされているため、必要な作業は SSML に含めることだけです。