Home Assistant Unofficial Reference 2024.12.1
homeassistant.helpers.llm.AssistAPI Class Reference
Inheritance diagram for homeassistant.helpers.llm.AssistAPI:
[legend]
Collaboration diagram for homeassistant.helpers.llm.AssistAPI:
[legend]

Public Member Functions

None __init__ (self, HomeAssistant hass)
 
APIInstance async_get_api_instance (self, LLMContext llm_context)
 

Public Attributes

 cached_slugify
 

Static Public Attributes

dictionary IGNORE_INTENTS
 

Private Member Functions

str _async_get_api_prompt (self, LLMContext llm_context, dict|None exposed_entities)
 
list[Tool_async_get_tools (self, LLMContext llm_context, dict|None exposed_entities)
 

Detailed Description

API exposing Assist API to LLMs.

Definition at line 267 of file llm.py.

Constructor & Destructor Documentation

◆ __init__()

None homeassistant.helpers.llm.AssistAPI.__init__ (   self,
HomeAssistant  hass 
)
Init the class.

Definition at line 283 of file llm.py.

Member Function Documentation

◆ _async_get_api_prompt()

str homeassistant.helpers.llm.AssistAPI._async_get_api_prompt (   self,
LLMContext  llm_context,
dict | None   exposed_entities 
)
private
Return the prompt for the API.

Definition at line 312 of file llm.py.

◆ _async_get_tools()

list[Tool] homeassistant.helpers.llm.AssistAPI._async_get_tools (   self,
LLMContext  llm_context,
dict | None   exposed_entities 
)
private
Return a list of LLM tools.

Definition at line 369 of file llm.py.

◆ async_get_api_instance()

APIInstance homeassistant.helpers.llm.AssistAPI.async_get_api_instance (   self,
LLMContext  llm_context 
)
Return the instance of the API.

Reimplemented from homeassistant.helpers.llm.API.

Definition at line 294 of file llm.py.

Member Data Documentation

◆ cached_slugify

homeassistant.helpers.llm.AssistAPI.cached_slugify

Definition at line 290 of file llm.py.

◆ IGNORE_INTENTS

dictionary homeassistant.helpers.llm.AssistAPI.IGNORE_INTENTS
static
Initial value:
= {
INTENT_GET_TEMPERATURE,
INTENT_GET_WEATHER,
INTENT_OPEN_COVER, # deprecated
INTENT_CLOSE_COVER, # deprecated
intent.INTENT_GET_STATE,
intent.INTENT_NEVERMIND,
intent.INTENT_TOGGLE,
intent.INTENT_GET_CURRENT_DATE,
intent.INTENT_GET_CURRENT_TIME,
intent.INTENT_RESPOND,
}

Definition at line 270 of file llm.py.


The documentation for this class was generated from the following file: