diff --git a/homeassistant/helpers/llm.py b/homeassistant/helpers/llm.py index 1ffc2880547..08125acc0da 100644 --- a/homeassistant/helpers/llm.py +++ b/homeassistant/helpers/llm.py @@ -199,7 +199,10 @@ class AssistAPI(API): async def async_get_api_prompt(self, tool_input: ToolInput) -> str: """Return the prompt for the API.""" - prompt = "Call the intent tools to control Home Assistant. Just pass the name to the intent." + prompt = ( + "Call the intent tools to control Home Assistant. " + "Just pass the name to the intent." + ) if tool_input.device_id: device_reg = device_registry.async_get(self.hass) device = device_reg.async_get(tool_input.device_id) diff --git a/tests/helpers/test_llm.py b/tests/helpers/test_llm.py index 70c28545483..e3308b89061 100644 --- a/tests/helpers/test_llm.py +++ b/tests/helpers/test_llm.py @@ -174,9 +174,9 @@ async def test_assist_api_prompt( ) api = llm.async_get_api(hass, "assist") prompt = await api.async_get_api_prompt(tool_input) - assert ( - prompt - == "Call the intent tools to control Home Assistant. Just pass the name to the intent." + assert prompt == ( + "Call the intent tools to control Home Assistant." + " Just pass the name to the intent." ) entry = MockConfigEntry(title=None) @@ -190,18 +190,18 @@ async def test_assist_api_prompt( suggested_area="Test Area", ).id prompt = await api.async_get_api_prompt(tool_input) - assert ( - prompt - == "Call the intent tools to control Home Assistant. Just pass the name to the intent. You are in Test Area." + assert prompt == ( + "Call the intent tools to control Home Assistant." + " Just pass the name to the intent. You are in Test Area." ) floor = floor_registry.async_create("second floor") area = area_registry.async_get_area_by_name("Test Area") area_registry.async_update(area.id, floor_id=floor.floor_id) prompt = await api.async_get_api_prompt(tool_input) - assert ( - prompt - == "Call the intent tools to control Home Assistant. Just pass the name to the intent. You are in Test Area (second floor)." + assert prompt == ( + "Call the intent tools to control Home Assistant." + " Just pass the name to the intent. You are in Test Area (second floor)." ) context.user_id = "12345" @@ -210,7 +210,8 @@ async def test_assist_api_prompt( mock_user.name = "Test User" with patch("homeassistant.auth.AuthManager.async_get_user", return_value=mock_user): prompt = await api.async_get_api_prompt(tool_input) - assert ( - prompt - == "Call the intent tools to control Home Assistant. Just pass the name to the intent. You are in Test Area (second floor). The user name is Test User." + assert prompt == ( + "Call the intent tools to control Home Assistant." + " Just pass the name to the intent. You are in Test Area (second floor)." + " The user name is Test User." )