actionssdk中的自定义实体
Custom entities in actionssdk
使用 google actionsSDK 并尝试找出如何在操作包中包含自定义实体。我在这里找到了手册:https://developers.google.com/assistant/conversational/action-package/reference/QueryPatterns 但是这本手册很短,他们没有提供应该包含自定义类型的方式。
大家有这方面的经验吗?
嗯,是的,google 操作 SDK 的文档,无可奉告。
根据您提供的示例,这些自定义类型属于 actions.json 中的主要结构,例如:
"actions":[..],
"locale": "de",
"customTypes": [
{
"name": "$MorningOptions",
"items": [
{
"key": "6am",
"synonyms": [
"6 am",
"6 o clock",
"oh six hundred",
"6 in the morning"
]
}
]
}
]
如果这不起作用,您可以尝试使用 types
:
"actions":[..],
"locale": "de",
"types":
[
{
"name": "$MorningOptions",
"entities":
[
{ "key": "6am", "synonyms": ["6 am","6 o clock","oh six hundred","6 in the morning"] }
]
}
]
那些也在主结构中。但官方已弃用:
https://developers.google.com/assistant/conversational/action-package/reference/rest/Shared.Types/ActionPackage#Type
使用 google actionsSDK 并尝试找出如何在操作包中包含自定义实体。我在这里找到了手册:https://developers.google.com/assistant/conversational/action-package/reference/QueryPatterns 但是这本手册很短,他们没有提供应该包含自定义类型的方式。
大家有这方面的经验吗?
嗯,是的,google 操作 SDK 的文档,无可奉告。 根据您提供的示例,这些自定义类型属于 actions.json 中的主要结构,例如:
"actions":[..],
"locale": "de",
"customTypes": [
{
"name": "$MorningOptions",
"items": [
{
"key": "6am",
"synonyms": [
"6 am",
"6 o clock",
"oh six hundred",
"6 in the morning"
]
}
]
}
]
如果这不起作用,您可以尝试使用 types
:
"actions":[..],
"locale": "de",
"types":
[
{
"name": "$MorningOptions",
"entities":
[
{ "key": "6am", "synonyms": ["6 am","6 o clock","oh six hundred","6 in the morning"] }
]
}
]
那些也在主结构中。但官方已弃用: https://developers.google.com/assistant/conversational/action-package/reference/rest/Shared.Types/ActionPackage#Type