Michael Hansen 93139737ff
Add documentation for pipeline WebSocket API (#1722)
* Add docs for pipelines

* Minor changes

* Fix parameter

* Fix other parameter
2023-03-20 23:59:32 -04:00

2.6 KiB

title
title
Pipelines

A pipeline runs the common steps of a voice assistant:

  1. Speech to text
  2. Intent recognition
  3. Text to speech

Pipelines are run via a WebSocket API:

{
  "type": "voice_assistant/run",
  "language": "en-US"
}

The following input fields are available:

Name Type Description
intent_input string Required. Input text to process.
language string Optional. Language of pipeline to run (default: configured language in HA).
pipeline string Optional. Id of a pipeline to run (default: use first one that matches specified language).
conversation_id string Optional. Unique id for conversation.
timeout number Optional. Number of seconds before pipeline times out (default: 30).

Events

As the pipeline runs, it emits events back over the WebSocket connection. The following events can be emitted:

Name Description Emitted Attributes
run-start Start of pipeline run always pipeline - Id of pipeline
language - Language used for pipeline
run-finish End of pipeline run always
intent-start Start of intent recognition always engine - Agent engine used
intent_input - Input text to agent
intent-finish End of intent recognition always intent_output - conversation response
tts-start Start of text to speech audio only tts_input - text to speak
tts-finish End of text to speech audio only tts_otuput - URL of spoken audio