mirror of
https://github.com/home-assistant/core.git
synced 2025-07-22 04:37:06 +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 = {}
|
||||
|
||||
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 = []
|
||||
|
@ -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'
|
||||
|
Loading…
x
Reference in New Issue
Block a user