Type
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
声明自定义类型,而不是内置类型。类型可以分配给场景中的槽或意图训练短语的参数。实际上,类型可以视为枚举。请注意,类型名称在文件的名称中指定。
YAML 表示法 |
exclusions:
- string
# Union field sub_type can be only one of the following:
synonym:
object (SynonymType )
regularExpression:
object (RegularExpressionType )
freeText:
object (FreeTextType )
# End of list of possible types for union field sub_type . |
字段 |
exclusions[] |
string
一组不应按类型匹配的异常字词/短语。注意:如果字词/短语与类型匹配,但被列为排除项,则不会在参数提取结果中返回。此字段可本地化。
|
联合字段 sub_type 。根据要完成的匹配的类型选择子类型。sub_type 只能是下列其中一项: |
synonym |
object (SynonymType )
同义词类型,本质上是一个枚举。
|
regularExpression |
object (RegularExpressionType )
正则表达式类型,允许正则表达式匹配。
|
freeText |
object (FreeTextType )
FreeText 类型。
|
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-26。
[null,null,["最后更新时间 (UTC):2025-07-26。"],[[["\u003cp\u003eCustom types, similar to enums, are declared in YAML and used for slots and intent parameters.\u003c/p\u003e\n"],["\u003cp\u003eTypes can utilize synonyms, regular expressions, or free text for matching, with exclusions for specific words or phrases.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eexclusions\u003c/code\u003e field is localizable, allowing for language-specific variations in excluded terms.\u003c/p\u003e\n"],["\u003cp\u003eEach custom type definition is stored in a separate file where the file name defines the type name.\u003c/p\u003e\n"]]],[],null,["# Type\n\n- [YAML representation](#SCHEMA_REPRESENTATION)\n\nDeclaration of a custom type, as opposed to built-in types. Types can be assigned to slots in a scene or parameters of an intent's training phrases. Practically, Types can be thought of as enums. Note, type name is specified in the name of the file.\n\n| YAML representation ||\n|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|\n| ``` exclusions: - string # Union field `sub_type` can be only one of the following: synonym: object (/assistant/actionssdk/reference/rest/Shared.Types/SynonymType) regularExpression: object (/assistant/actionssdk/reference/rest/Shared.Types/RegularExpressionType) freeText: object (/assistant/actionssdk/reference/rest/Shared.Types/FreeTextType) # End of list of possible types for union field `sub_type`. ``` |\n\n| Fields ||\n|---------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|\n| `exclusions[]` | `string` Set of exceptional words/phrases that shouldn't be matched by type. Note: If word/phrase is matched by the type but listed as an exclusion it won't be returned in parameter extraction result. **This field is localizable.** |\n| Union field `sub_type`. Selection of sub type based on the type of matching to be done. `sub_type` can be only one of the following: |||\n| `synonym` | `object (`[SynonymType](/assistant/actionssdk/reference/rest/Shared.Types/SynonymType)`)` Synonyms type, which is essentially an enum. |\n| `regularExpression` | `object (`[RegularExpressionType](/assistant/actionssdk/reference/rest/Shared.Types/RegularExpressionType)`)` Regex type, allows regular expression matching. |\n| `freeText` | `object (`[FreeTextType](/assistant/actionssdk/reference/rest/Shared.Types/FreeTextType)`)` FreeText type. |"]]