diff --git a/tools/vision_tools.py b/tools/vision_tools.py index 6ad885cbd9..233b737272 100644 --- a/tools/vision_tools.py +++ b/tools/vision_tools.py @@ -38,6 +38,7 @@ from typing import Any, Awaitable, Dict, Optional from urllib.parse import urlparse import httpx from agent.auxiliary_client import async_call_llm, extract_content_or_reasoning +from hermes_constants import get_hermes_dir from tools.debug_helpers import DebugSession from tools.website_policy import check_website_access @@ -435,7 +436,7 @@ async def vision_analyze_tool( Exception: If download fails, analysis fails, or API key is not set Note: - - For URLs, temporary images are stored in ./temp_vision_images/ and cleaned up + - For URLs, temporary images are stored under $HERMES_HOME/cache/vision/ and cleaned up - For local file paths, the file is used directly and NOT deleted - Supports common image formats (JPEG, PNG, GIF, WebP, etc.) """ @@ -483,7 +484,7 @@ async def vision_analyze_tool( if blocked: raise PermissionError(blocked["message"]) logger.info("Downloading image from URL...") - temp_dir = Path("./temp_vision_images") + temp_dir = get_hermes_dir("cache/vision", "temp_vision_images") temp_image_path = temp_dir / f"temp_image_{uuid.uuid4()}.jpg" await _download_image(image_url, temp_image_path) should_cleanup = True