mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 05:07:41 +00:00
Do not double expose scripts in LLM tools (#131726)
This commit is contained in:
parent
1f1fdf80db
commit
ae34a6b375
@ -445,17 +445,13 @@ def _get_exposed_entities(
|
|||||||
entities = {}
|
entities = {}
|
||||||
|
|
||||||
for state in hass.states.async_all():
|
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
|
continue
|
||||||
|
|
||||||
description: str | None = None
|
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)
|
entity_entry = entity_registry.async_get(state.entity_id)
|
||||||
names = [state.name]
|
names = [state.name]
|
||||||
area_names = []
|
area_names = []
|
||||||
|
@ -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:
|
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
|
- names: Kitchen
|
||||||
domain: light
|
domain: light
|
||||||
state: 'on'
|
state: 'on'
|
||||||
|
Loading…
x
Reference in New Issue
Block a user