会話型アクションのサポートは 2023 年 6 月 13 日に終了しました。詳細については、
会話型アクションの廃止をご覧ください。
Types
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
型を使用すると、アシスタントの NLU(自然言語理解)を構成できます。
を使用して、ユーザー入力から構造化データを抽出します。マイページ
は、次のような状況で型を使用できます。
インテントでは、トレーニング フレーズに次の型のアノテーションを付けることができます。
スロットを作成できますユーザーがスロットに一致する発言をすると、NLU エンジンが
型指定パラメータとして抽出するので、シーンで処理できます。
シーンのスロット充填ステージでは、
ユーザーに提示する複数のスロットを
画面から移動します
シーンの条件ステージでは、
型で定義された特定の値がパラメータにあるかどうかを示すロジック。
カスタム型
カスタムタイプを使用すると、独自のタイプ仕様を作成して NLU に通知できます。
一連の値を 1 つのキーに割り当てますさまざまな形式で型を指定できます。
方法:
- 単語と類義語では、複数の値を 1 つのキーにマッピングできます。
これをエントリと呼びますタイプには、1 つまたは複数のエントリを含めることができます。もし
次の NLU 設定を有効にすることもできます。
<ph type="x-smartling-placeholder">
</ph>
- ファジー一致を有効にする - この機能では、複数の
単語の語順が異なる場合でも、一致する単語を検索します。
- 不明な値を受け入れる - 指定可能な値をすべて指定できない場合は、
言語プロセッサは、周囲の環境に基づいて、未知の単語やフレーズを
食料品店に追加される可能性のあるアイテムなど、入力およびインテント トレーニング データ
選択します。
- 正規表現では、正規表現を使用して値を照合できます。
基づいて表現パターンを
Google の RE2 規格。
- 自由形式のテキスト: 一致するタイプ
アラートが生成されます。アノテーション付け中
このタイプのインテントでは、すべての入力をパラメータとして使用して、
独自の NLU に連結できます
システムの種類
システムタイプを使用すると、ユーザー入力からよく知られたデータにアノテーションを付けて抽出できます。
システムが提供するトレーニング データと値を使用します。次のシステムタイプは、
supported:
タイプ |
説明 |
actions.type.DateTime |
ユーザーのデバイスの設定に基づく日付、時刻、タイムゾーンが含まれます。
スロット充填とトレーニング フレーズのアノテーションで使用できます。
|
actions.type.Date |
日付のみが含まれます。スロット充填でのみ使用できます。 |
actions.type.Time |
時間のみが含まれます。スロット充填でのみ使用できます。 |
actions.type.Number |
Number 型は序数と基数と一致します。
あります。 |
DateTime
、Date
、Time
の使用状況
これらの型の動作は、型と
ユーザー入力を返します。
インテントで使用する
インテントでトレーニング フレーズにアノテーションを付けることができるのは、DateTime
タイプのみです。ユーザー
入力は DateTime
値全体と一致する必要はありません。たとえば、ユーザーが
年のみを指定している場合、session パラメータは次のようになります。
"date_time": {
"year": 2019
}
スロット充填で使用する
スロット充填は、DateTime
、Date
、Time
をサポートします。
- スロットタイプが
DateTime
の場合、アシスタントはフル充電されるまでユーザーにメッセージを表示します。
値が提供されます。
- スロットタイプが
Date
の場合、アシスタントはその日付までユーザーにメッセージを表示します。
値が提供されます。収集されると、受信するパラメータは完全な
時刻を 00:00 に設定した DateTime
。
- スロットタイプが
Time
の場合、アシスタントはその時間になるまでユーザーにメッセージを表示します。
値が提供されます。収集されると、受信するパラメータは完全な
日付が現在の日付に設定された DateTime
オブジェクト。
たとえば、ロサンゼルスのユーザーが「OK Google, リマインダーを作成して」と言ったとします。
にアクセスしていただけますでしょうか。」DateTime
がスロットの一部として抽出される場合
完全なパラメータは次のようになります。
"date_time": {
"day": 15,
"hours": 20,
"minutes": 0,
"month": 1,
"nanos": 0,
"seconds": 0,
"time_zone": {
"id": "America/Los_Angeles"
},
"year": 2024
}
条件での使用
条件では数値と文字列しか使用できないため、トップレベル
DateTime
パラメータを使用すると、条件に対して False 結果が得られます。次に例を示します。
$session.params.my_dateTime.day > 5
は有効な条件です。これは、
day
の値は数値で、サポートされています。
- 次の理由により、
$session.params.my_dateTime > "01-01-2010"
は無効な条件です。
最上位レベルの 'DateTime'オブジェクトは数値または文字列ではありません。
ランタイム タイプのオーバーライド
ランタイム タイプのオーバーライドを使用すると、ランタイム タイプの動的な作成や変更が
受け取りますこの機能を使用すると、
ランタイム。たとえば、バックエンド データソースを確認して、日替わりメニューを読み込むことができます
フルフィルメントのタイプに
変換します
詳しくは、Webhook ガイドをご覧ください。
ビルドタイプのオーバーライドの方法について見てみましょう。
特に記載のない限り、このページのコンテンツはクリエイティブ・コモンズの表示 4.0 ライセンスにより使用許諾されます。コードサンプルは Apache 2.0 ライセンスにより使用許諾されます。詳しくは、Google Developers サイトのポリシーをご覧ください。Java は Oracle および関連会社の登録商標です。
最終更新日 2025-07-26 UTC。
[[["わかりやすい","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"]],["最終更新日 2025-07-26 UTC。"],[[["\u003cp\u003eTypes are used to extract structured data from user input, allowing you to create slots in intents, manage slot filling within scenes, and define conditions based on parameter values.\u003c/p\u003e\n"],["\u003cp\u003eYou can create custom types using words and synonyms, regular expressions, or free-form text to define how the NLU interprets user input.\u003c/p\u003e\n"],["\u003cp\u003eSystem types such as \u003ccode\u003eDateTime\u003c/code\u003e, \u003ccode\u003eDate\u003c/code\u003e, \u003ccode\u003eTime\u003c/code\u003e, and \u003ccode\u003eNumber\u003c/code\u003e provide built-in data extraction for common data formats.\u003c/p\u003e\n"],["\u003cp\u003eRuntime type overrides enable dynamic modification of types during fulfillment, allowing you to adjust types based on real-time data.\u003c/p\u003e\n"]]],[],null,["Types let you configure the Assistant NLU (natural language understanding)\nengine to extract structured data from user input. You\ncan use types in the following situations:\n\n- In [intents](/assistant/conversational/intents), you can annotate training phrases with types to\n create slots. When users say something that matches a slot, the NLU engine\n extracts it as a typed parameter, so you can process it in a [scene](/assistant/conversational/scenes).\n\n- Within a scene's [slot filling](/assistant/conversational/scenes#slot_filling) stage, you can specify\n multiple slots that you want the user to provide before they can\n transition or exit out of the scene.\n\n- Within a scene's [conditions](/assistant/conversational/scenes#conditions) stage, you can base\n logic on whether a parameter has a specific value that's defined in a type.\n\nCustom types\n\nCustom types let you create your own type specification to notify the NLU to\nassign a set of values to a single key. You can specify types in a variety of\nways:\n\n- **Words and synonyms** allow you to map multiple values to a single key, which are called an entry. Your type can contain one or many entries. If you choose this option, you can also enable the following NLU settings:\n - **Enable fuzzy matching** - This feature allows entries with more than one word to be matched, even when the words are spoken in a different order.\n - **Accept unknown values** - When you can't specify all possible values, the language processor can accept unknown words or phrases based on surrounding input and intent training data, such as items that might be added to a grocery list.\n- **Regular expressions** allows the type to match values using regular expression patterns based on [Google's RE2 standard](https://github.com/google/re2/wiki/Syntax).\n- **Free form text** allows the type to match anything a user says. Annotating an intent with this type lets you consume all input as a parameter that you can pipe to your own NLU.\n\nSystem types\n\nSystem types let you annotate and extract well-known data from user input\nusing system-provided training data and values. The following system types are\nsupported:\n\n| Type | Description |\n|-----------------------------|-----------------------------------------------------------------------------------------------------------------------------------|\n| **`actions.type.DateTime`** | Contains date, time, and timezone based on the user's device settings. Available for slot filling and training phrase annotation. |\n| **`actions.type.Date`** | Contains date only. Available for slot filling only. |\n| **`actions.type.Time`** | Contains time only. Available for slot filling only. |\n| **`actions.type.Number`** | The `Number` type matches ordinal and cardinal numbers. |\n\n`DateTime`, `Date`, and `Time` usage\n\nThese types behave differently depending on where you use the type and the\nuser input that matches the type.\n\nUsing with intents\n\nAnnotating training phrases in intents supports only the `DateTime` type. User\ninput doesn't need to match an entire `DateTime` value. For example, if a user\nprovides only the year, the session parameter might look like this: \n\n \"date_time\": {\n \"year\": 2019\n }\n\nUsing with slot filling\n\nSlot filling supports `DateTime`, `Date`, and `Time`.\n\n- If the slot type is `DateTime`, the Assistant prompts the user until a full value is provided.\n- If the slot type is `Date`, the Assistant prompts the user until a date value is provided. When collected, the parameter you receive is a full `DateTime` with the time set to 00:00.\n- If the slot type is `Time`, the Assistant prompts the user until a time value is provided. When collected, the parameter your receive is a full `DateTime` object with the date set to the current date.\n\nFor example, suppose a user in Los Angeles said, \"Hey Google, create a reminder\nfor January 15, 2024 at 8 pm.\" When `DateTime` is extracted as part of a slot\nfilling process, the full parameter might look like this: \n\n \"date_time\": {\n \"day\": 15,\n \"hours\": 20,\n \"minutes\": 0,\n \"month\": 1,\n \"nanos\": 0,\n \"seconds\": 0,\n \"time_zone\": {\n \"id\": \"America/Los_Angeles\"\n },\n \"year\": 2024\n }\n\nUsing with conditions\n\nConditions only allow the use of numbers and strings, so using the top level\n`DateTime` parameter results in a **False** result for the condition. For\nexample:\n\n- `$session.params.my_dateTime.day \u003e 5` is a valid condition, because the `day` value is a number and is supported.\n- `$session.params.my_dateTime \u003e \"01-01-2010\"` is an invalid condition, because the top level 'DateTime' object is not a number or string.\n\nRuntime type overrides\n\nRuntime type overrides let you dynamically create or modify types in\nfulfillment. This feature lets you add to or replace a type's specification at\nruntime. For example, you can check a backend data source to load daily menu\nitems into a type in your fulfillment.\n\nSee the [webhooks](/assistant/conversational/webhooks#runtime_type_overrides) guide for more information\non how to build type overrides."]]