From b27e3c25e0ade513df3385621bc79653f9e49c5f Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Thu, 19 Jan 2023 10:53:17 -0500 Subject: [PATCH] Documenet conversation WS API (#1636) --- docs/intent_conversation_api.md | 15 ++++++++++++--- sidebars.js | 7 +++++-- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/docs/intent_conversation_api.md b/docs/intent_conversation_api.md index 1dbd2bd4..ec25e9ea 100644 --- a/docs/intent_conversation_api.md +++ b/docs/intent_conversation_api.md @@ -5,10 +5,9 @@ sidebar_label: "Conversation API" Intents can be recognized from text and fired using the [conversation integration](https://www.home-assistant.io/integrations/conversation/). -An HTTP API endpoint is available at `/api/conversation/process`, which receives an [input sentence](#input-sentence) and produces an [intent response](#intent-response). -A "conversation" is tracked across multiple inputs and responses using a [conversation id](#conversation-id) generated by Home Assistant. +An API endpoint is available which receives an input sentence and produces an [intent response](#intent-response). A "conversation" is tracked across multiple inputs and responses by passing a [conversation id](#conversation-id) generated by Home Assistant. -## Input Sentence +The API is available via the Rest API and Websocket API. A sentence may be POST-ed to `/api/conversation/process` like: @@ -19,6 +18,16 @@ A sentence may be POST-ed to `/api/conversation/process` like: } ``` +Or sent via the WebSocket API like: + +```json +{ + "type": "conversation/process", + "text": "turn on the lights in the living room", + "language": "en" +} +``` + The following input fields are available: | Name | Type | Description | diff --git a/sidebars.js b/sidebars.js index 932b8703..875c07ca 100644 --- a/sidebars.js +++ b/sidebars.js @@ -187,9 +187,13 @@ module.exports = { "intent_firing", "intent_handling", "intent_builtin", - "intent_conversation_api", ], }, + { + type: "category", + label: "Conversation", + items: ["intent_conversation_api", "core/conversation/custom_agent"], + }, { type: "category", label: "Native App Integration", @@ -205,7 +209,6 @@ module.exports = { "creating_integration_brand", "core/platform/application_credentials", "core/platform/backup", - "core/conversation/custom_agent", "core/platform/repairs", "core/platform/reproduce_state", "core/platform/significant_change",