From 199a48d5f6f36637a4cf6a633f2f9741c4353af1 Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Thu, 6 Jun 2024 14:10:49 -0400 Subject: [PATCH] Add example how to register API with HA (#2206) --- docs/core/llm/index.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docs/core/llm/index.md b/docs/core/llm/index.md index 0ed682fd..873f1388 100644 --- a/docs/core/llm/index.md +++ b/docs/core/llm/index.md @@ -267,6 +267,11 @@ class MyAPI(API): llm_context=llm_context, tools=[TimeTool()], ) + + +async def async_setup_api(hass: HomeAssistant) -> None: + """Register the API with Home Assistant.""" + llm.async_register_api(hass, MyAPI()) ``` The `llm.API` class has the following attributes: