mirror of
https://github.com/home-assistant/core.git
synced 2026-12-06 05:38:06 -04:00
Show the AI tools field as a checkbox list (#189320)
This commit is contained in:
@@ -286,7 +286,13 @@ class ConversationSubentryFlowHandler(ConfigSubentryFlow):
|
||||
probatio.Optional(CONF_PROMPT): TemplateSelector(),
|
||||
probatio.Optional(
|
||||
CONF_LLM_HASS_API,
|
||||
): SelectSelector({"options": hass_apis, "multiple": True}),
|
||||
): SelectSelector(
|
||||
{
|
||||
"options": hass_apis,
|
||||
"multiple": True,
|
||||
"mode": SelectSelectorMode.LIST,
|
||||
}
|
||||
),
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
@@ -341,7 +341,9 @@ async def google_generative_ai_config_option_schema(
|
||||
CONF_LLM_HASS_API,
|
||||
description={"suggested_value": suggested_llm_apis},
|
||||
): SelectSelector(
|
||||
SelectSelectorConfig(options=hass_apis, multiple=True)
|
||||
SelectSelectorConfig(
|
||||
options=hass_apis, multiple=True, mode=SelectSelectorMode.LIST
|
||||
)
|
||||
),
|
||||
}
|
||||
)
|
||||
|
||||
@@ -305,7 +305,11 @@ class ConversationFlowHandler(LiteLLMSubentryFlowHandler):
|
||||
RECOMMENDED_CONVERSATION_OPTIONS[CONF_LLM_HASS_API],
|
||||
),
|
||||
): SelectSelector(
|
||||
SelectSelectorConfig(options=hass_apis, multiple=True)
|
||||
SelectSelectorConfig(
|
||||
options=hass_apis,
|
||||
multiple=True,
|
||||
mode=SelectSelectorMode.LIST,
|
||||
)
|
||||
),
|
||||
}
|
||||
),
|
||||
|
||||
@@ -369,7 +369,11 @@ def llama_cpp_config_option_schema(
|
||||
): TemplateSelector(),
|
||||
probatio.Optional(
|
||||
CONF_LLM_HASS_API,
|
||||
): SelectSelector(SelectSelectorConfig(options=hass_apis, multiple=True)),
|
||||
): SelectSelector(
|
||||
SelectSelectorConfig(
|
||||
options=hass_apis, multiple=True, mode=SelectSelectorMode.LIST
|
||||
)
|
||||
),
|
||||
}
|
||||
)
|
||||
schema.update(
|
||||
|
||||
@@ -20,6 +20,7 @@ from homeassistant.helpers.selector import (
|
||||
SelectOptionDict,
|
||||
SelectSelector,
|
||||
SelectSelectorConfig,
|
||||
SelectSelectorMode,
|
||||
)
|
||||
|
||||
from .const import CONF_ALL_LLM_APIS, CONF_READ_ONLY, CONF_REQUIRE_ADMIN, DOMAIN
|
||||
@@ -76,6 +77,7 @@ def _options_schema(
|
||||
for llm_api_id, name in llm_apis.items()
|
||||
],
|
||||
multiple=True,
|
||||
mode=SelectSelectorMode.LIST,
|
||||
)
|
||||
),
|
||||
}
|
||||
|
||||
@@ -36,6 +36,7 @@ from homeassistant.helpers.selector import (
|
||||
SelectOptionDict,
|
||||
SelectSelector,
|
||||
SelectSelectorConfig,
|
||||
SelectSelectorMode,
|
||||
TemplateSelector,
|
||||
TextSelector,
|
||||
TextSelectorConfig,
|
||||
@@ -470,6 +471,7 @@ def ollama_config_option_schema(
|
||||
for api in llm.async_get_apis(hass)
|
||||
],
|
||||
multiple=True,
|
||||
mode=SelectSelectorMode.LIST,
|
||||
)
|
||||
),
|
||||
}
|
||||
|
||||
@@ -212,7 +212,11 @@ class ConversationFlowHandler(OpenRouterSubentryFlowHandler):
|
||||
RECOMMENDED_CONVERSATION_OPTIONS[CONF_LLM_HASS_API],
|
||||
),
|
||||
): SelectSelector(
|
||||
SelectSelectorConfig(options=hass_apis, multiple=True)
|
||||
SelectSelectorConfig(
|
||||
options=hass_apis,
|
||||
multiple=True,
|
||||
mode=SelectSelectorMode.LIST,
|
||||
)
|
||||
),
|
||||
probatio.Optional(
|
||||
CONF_WEB_SEARCH,
|
||||
|
||||
@@ -328,7 +328,11 @@ class OpenAISubentryFlowHandler(ConfigSubentryFlow):
|
||||
},
|
||||
): TemplateSelector(),
|
||||
probatio.Optional(CONF_LLM_HASS_API): SelectSelector(
|
||||
SelectSelectorConfig(options=hass_apis, multiple=True)
|
||||
SelectSelectorConfig(
|
||||
options=hass_apis,
|
||||
multiple=True,
|
||||
mode=SelectSelectorMode.LIST,
|
||||
)
|
||||
),
|
||||
}
|
||||
)
|
||||
|
||||
@@ -214,7 +214,11 @@ class ConversationFlowHandler(ConfigSubentryFlow):
|
||||
CONF_LLM_HASS_API,
|
||||
default=selected_apis,
|
||||
): SelectSelector(
|
||||
SelectSelectorConfig(options=hass_apis, multiple=True)
|
||||
SelectSelectorConfig(
|
||||
options=hass_apis,
|
||||
multiple=True,
|
||||
mode=SelectSelectorMode.LIST,
|
||||
)
|
||||
),
|
||||
}
|
||||
),
|
||||
@@ -281,7 +285,11 @@ class ConversationFlowHandler(ConfigSubentryFlow):
|
||||
RECOMMENDED_CONVERSATION_OPTIONS[CONF_LLM_HASS_API],
|
||||
),
|
||||
): SelectSelector(
|
||||
SelectSelectorConfig(options=hass_apis, multiple=True)
|
||||
SelectSelectorConfig(
|
||||
options=hass_apis,
|
||||
multiple=True,
|
||||
mode=SelectSelectorMode.LIST,
|
||||
)
|
||||
),
|
||||
}
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user