Do not double expose scripts in LLM tools (#131726)

This commit is contained in:
Paulus Schoutsen 2024-11-27 12:04:08 -05:00 committed by GitHub
parent 1f1fdf80db
commit ae34a6b375
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 12 deletions

View File

@ -445,17 +445,13 @@ def _get_exposed_entities(
entities = {}
for state in hass.states.async_all():
if not async_should_expose(hass, assistant, state.entity_id):
if (
not async_should_expose(hass, assistant, state.entity_id)
or state.domain == SCRIPT_DOMAIN
):
continue
description: str | None = None
if state.domain == SCRIPT_DOMAIN:
description, parameters = _get_cached_script_parameters(
hass, state.entity_id
)
if parameters.schema: # Only list scripts without input fields here
continue
entity_entry = entity_registry.async_get(state.entity_id)
names = [state.name]
area_names = []

View File

@ -517,10 +517,6 @@ async def test_assist_api_prompt(
)
)
exposed_entities_prompt = """An overview of the areas and the devices in this smart home:
- names: script_with_no_fields
domain: script
state: 'off'
description: This is another test script
- names: Kitchen
domain: light
state: 'on'