Skip to content

Commit 4fd60d5

Browse files
authored
Document provide LLM data (#2696)
1 parent 2c2ebba commit 4fd60d5

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

docs/core/llm/index.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,11 @@ def async_get_options_schema(
6464
When interacting with the LLM, the provided `ChatLog` will make any selected tools available from the selected API and the conversation entity should pass them to the LLM together with the extra prompt provided by the API.
6565

6666
```python
67-
from homeassistant.const import CONF_LLM_HASS_API
67+
from homeassistant.const import CONF_LLM_HASS_API, CONF_PROMPT
6868
from homeassistant.core import HomeAssistant, callback
6969
from homeassistant.components import conversation
7070
from homeassistant.helpers import intent, llm
71+
from .const import DOMAIN
7172

7273

7374
class MyConversationEntity(conversation.ConversationEntity):
@@ -86,11 +87,11 @@ class MyConversationEntity(conversation.ConversationEntity):
8687
"""Call the API."""
8788

8889
try:
89-
await chat_log.async_update_llm_data(
90-
DOMAIN,
91-
user_input,
90+
await chat_log.async_provide_llm_data(
91+
user_input.as_llm_context(DOMAIN),
9292
self.entry.options.get(CONF_LLM_HASS_API),
9393
self.entry.options.get(CONF_PROMPT),
94+
user_input.extra_system_prompt,
9495
)
9596
except conversation.ConverseError as err:
9697
return err.as_conversation_result()

0 commit comments

Comments
 (0)