Michael Hansen fa5380a68e
Add conversation API to intents section (#1583)
* Add conversation API to intents section

* Add multiple targets

* Separate conversation id from intent response

* Add description of target combinations

* Update docs/intent_conversation_api.md

Co-authored-by: Paulus Schoutsen <balloob@gmail.com>

* Update docs/intent_conversation_api.md

Co-authored-by: Paulus Schoutsen <balloob@gmail.com>

* Language is required in intent response

* Add partial_action_done

* Remove partial_action_done

* Update docs/intent_conversation_api.md

* Fix examples

Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2022-12-13 23:02:59 -05:00

35 lines
1.8 KiB
Markdown

---
title: "Intents"
sidebar_label: "Introduction"
---
An intent is a description of a user's intention. Intents are generated by user actions, like asking Amazon Echo to turn on a light.
<a href='https://docs.google.com/drawings/d/1i9AsOQNCBCaeM14QwEglZizV0lZiWKHZgroZc9izB0E/edit'>
<img class='invertDark'
src='/img/en/intents/overview.png'
alt='Architectural overview of intents in Home Assistant'
/>
</a>
Intents are fired by components that receive them from external sources/services. Conversation, Alexa, API.ai and Snips are currently sourcing intents.
Any component can handle intents. This makes it very easy for developers to integrate with all voice assistants at once.
Intents are implemented using the `homeassistant.helpers.intent.Intent` class. It contains the following properties:
| Name | Type | Description |
|---------------|----------------|-----------------------------------------------------------------------------|
| `hass` | Home Assistant | The Home Assistant instance that fired the intent. |
| `platform` | string | The platform that fired the intent |
| `intent_type` | string | The type (name) of the intent |
| `slots` | dictionary | Contains the slot values keyed by slot name. |
| `text_input` | string | Optional. The raw text input that initiated the intent. |
| `language` | string | Optional. The language of the text input (defaults to configured language). |
Description of the slots dictionary values.
| Name | Type | Description |
|-------|----------|--------------------|
| Value | anything | Value of the slot. |