For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /developers/intent_index.md.

意图

一个 intent 是对用户意图的描述。Intents 由用户的操作生成,例如让 Amazon Echo 打开一盏灯。

Architectural overview of intents in Home Assistant

Intents 由接收来自外部源/服务的 intents 的 components fire。Conversation、Alexa、API.ai 和 Snips 目前都在提供 intents。

任何 component 都可以处理 intents。这使得开发者可以轻松地一次性与所有 voice assistants 集成。

Intents 使用 homeassistant.helpers.intent.Intent 类实现。它包含以下属性:

NameTypeDescription
hassHome Assistantfire 该 intent 的 Home Assistant 实例。
platformstringfire 该 intent 的 platform
intent_typestring该 intent 的类型(名称)
slotsdictionary包含以 slot name 为 key 的 slot 值。
text_inputstring可选。发起该 intent 的原始文本输入。
languagestring可选。文本输入的语言(默认为配置的语言)。

Slots dictionary 值的说明。

NameTypeDescription
Valueanything该 slot 的值。