mirror of
https://github.com/home-assistant/core.git
synced 2026-12-02 19:57:03 -04:00
Rename the Assist LLM API to Device control (#185999)
Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude
parent
280532026f
commit
e7deb7ba8d
@@ -144,7 +144,7 @@ class AssistAPI(API):
|
||||
super().__init__(
|
||||
hass=hass,
|
||||
id=LLM_API_ASSIST,
|
||||
name="Assist",
|
||||
name="Device control",
|
||||
)
|
||||
|
||||
@override
|
||||
|
||||
@@ -35,7 +35,7 @@ async def setup_llm(hass: HomeAssistant) -> None:
|
||||
pytest.param(
|
||||
[],
|
||||
[
|
||||
{"id": "assist", "name": "Assist", "requires_admin": False},
|
||||
{"id": "assist", "name": "Device control", "requires_admin": False},
|
||||
{
|
||||
"id": "homeassistant",
|
||||
"name": "Home Assistant",
|
||||
@@ -47,7 +47,7 @@ async def setup_llm(hass: HomeAssistant) -> None:
|
||||
pytest.param(
|
||||
[("test-api", "Test API")],
|
||||
[
|
||||
{"id": "assist", "name": "Assist", "requires_admin": False},
|
||||
{"id": "assist", "name": "Device control", "requires_admin": False},
|
||||
{
|
||||
"id": "homeassistant",
|
||||
"name": "Home Assistant",
|
||||
|
||||
@@ -47,7 +47,7 @@ async def test_options_flow(hass: HomeAssistant, config_entry: MockConfigEntry)
|
||||
"""Test changing the LLM APIs in the options flow."""
|
||||
llm.async_register_api(hass, MockLLMAPI(hass=hass, id=TEST_LLM_API_ID, name="Test"))
|
||||
# The title generated for the APIs the entry was created with
|
||||
hass.config_entries.async_update_entry(config_entry, title="Assist")
|
||||
hass.config_entries.async_update_entry(config_entry, title="Device control")
|
||||
assert await hass.config_entries.async_setup(config_entry.entry_id)
|
||||
|
||||
result = await hass.config_entries.options.async_init(config_entry.entry_id)
|
||||
@@ -76,7 +76,7 @@ async def test_options_flow(hass: HomeAssistant, config_entry: MockConfigEntry)
|
||||
CONF_LLM_HASS_API: [llm.LLM_API_ASSIST, TEST_LLM_API_ID],
|
||||
CONF_REQUIRE_ADMIN: True,
|
||||
}
|
||||
assert config_entry.title == "Assist, Test"
|
||||
assert config_entry.title == "Device control, Test"
|
||||
|
||||
|
||||
@pytest.mark.parametrize("llm_hass_api", [llm.LLM_API_ASSIST])
|
||||
@@ -207,7 +207,7 @@ async def test_options_flow_unmigrated_entry(hass: HomeAssistant) -> None:
|
||||
pytest.param(
|
||||
False,
|
||||
[llm.LLM_API_ASSIST],
|
||||
"Assist",
|
||||
"Device control",
|
||||
{
|
||||
CONF_ALL_LLM_APIS: False,
|
||||
CONF_LLM_HASS_API: [llm.LLM_API_ASSIST],
|
||||
|
||||
@@ -458,7 +458,7 @@ def mcp_client_fixture(mcp_protocol: str) -> Any:
|
||||
pytest.param(
|
||||
mcp.types.ClientRequest(
|
||||
mcp.types.GetPromptRequest(
|
||||
params=mcp.types.GetPromptRequestParams(name="Assist")
|
||||
params=mcp.types.GetPromptRequestParams(name="Device control")
|
||||
)
|
||||
),
|
||||
mcp.types.GetPromptResult,
|
||||
@@ -722,7 +722,7 @@ async def test_mcp_tools_list_all_llm_apis(
|
||||
result = await session.list_tools()
|
||||
|
||||
tool_names = {tool.name for tool in result.tools}
|
||||
assert "assist__homeassistant__GetLiveContext" in tool_names
|
||||
assert "device-control__homeassistant__GetLiveContext" in tool_names
|
||||
assert "test-api__test_tool" in tool_names
|
||||
|
||||
|
||||
@@ -882,8 +882,8 @@ async def test_prompt_list(
|
||||
|
||||
assert len(result.prompts) == 1
|
||||
prompt = result.prompts[0]
|
||||
assert prompt.name == "Assist"
|
||||
assert prompt.description == "Default prompt for Home Assistant Assist API"
|
||||
assert prompt.name == "Device control"
|
||||
assert prompt.description == "Default prompt for Home Assistant Device control API"
|
||||
|
||||
|
||||
@pytest.mark.parametrize("llm_hass_api", [llm.LLM_API_ASSIST, STATELESS_LLM_API])
|
||||
@@ -897,9 +897,9 @@ async def test_prompt_get(
|
||||
"""Test the get prompt endpoint."""
|
||||
|
||||
async with mcp_client(hass, mcp_url, hass_supervisor_access_token) as session:
|
||||
result = await session.get_prompt(name="Assist")
|
||||
result = await session.get_prompt(name="Device control")
|
||||
|
||||
assert result.description == "Default prompt for Home Assistant Assist API"
|
||||
assert result.description == "Default prompt for Home Assistant Device control API"
|
||||
assert len(result.messages) == 1
|
||||
assert result.messages[0].role == "assistant"
|
||||
assert result.messages[0].content.type == "text"
|
||||
|
||||
Reference in New Issue
Block a user