File tree Expand file tree Collapse file tree 2 files changed +2
-3
lines changed
homeassistant/components/ai_task Expand file tree Collapse file tree 2 files changed +2
-3
lines changed Original file line number Diff line number Diff line change 1919from homeassistant .helpers import llm
2020from homeassistant .helpers .chat_session import ChatSession , async_get_chat_session
2121from homeassistant .helpers .event import async_call_later
22- from homeassistant .helpers .network import get_url
2322from homeassistant .util import RE_SANITIZE_FILENAME , slugify
2423
2524from .const import (
@@ -249,7 +248,7 @@ def _purge_image(filename: str, now: datetime) -> None:
249248 if IMAGE_EXPIRY_TIME > 0 :
250249 async_call_later (hass , IMAGE_EXPIRY_TIME , partial (_purge_image , filename ))
251250
252- service_result ["url" ] = get_url ( hass ) + async_sign_path (
251+ service_result ["url" ] = async_sign_path (
253252 hass ,
254253 f"/api/{ DOMAIN } /images/{ filename } " ,
255254 timedelta (seconds = IMAGE_EXPIRY_TIME or 1800 ),
Original file line number Diff line number Diff line change @@ -286,7 +286,7 @@ async def test_generate_image(
286286 assert "image_data" not in result
287287 assert result ["media_source_id" ].startswith ("media-source://ai_task/images/" )
288288 assert result ["media_source_id" ].endswith ("_test_task.png" )
289- assert result ["url" ].startswith ("http://10.10.10.10:8123 /api/ai_task/images/" )
289+ assert result ["url" ].startswith ("/api/ai_task/images/" )
290290 assert result ["url" ].count ("_test_task.png?authSig=" ) == 1
291291 assert result ["mime_type" ] == "image/png"
292292 assert result ["model" ] == "mock_model"
You can’t perform that action at this time.
0 commit comments