From d47ac788c0570c370a2ff948e5f32aee598afe71 Mon Sep 17 00:00:00 2001 From: Nicolas Mowen Date: Fri, 22 May 2026 12:25:24 -0600 Subject: [PATCH] Improve prompt --- frigate/api/chat.py | 9 ++++++++- frigate/genai/prompts.py | 11 ++++++++--- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/frigate/api/chat.py b/frigate/api/chat.py index 465a016585..4e6bdbd3b4 100644 --- a/frigate/api/chat.py +++ b/frigate/api/chat.py @@ -733,7 +733,14 @@ async def _execute_tool_internal( "Arguments: %s", json.dumps(arguments), ) - return {"error": "Camera parameter is required"} + return { + "error": ( + "get_live_context requires a single camera name; " + "wildcards and empty values are not supported. " + "Call this tool once per camera." + ), + "available_cameras": allowed_cameras, + } return await _execute_get_live_context(request, camera, allowed_cameras) elif tool_name == "start_camera_watch": return await _execute_start_camera_watch(request, arguments) diff --git a/frigate/genai/prompts.py b/frigate/genai/prompts.py index 93e19209bf..af6ddab889 100644 --- a/frigate/genai/prompts.py +++ b/frigate/genai/prompts.py @@ -518,16 +518,21 @@ def get_tool_definitions( "function": { "name": "get_live_context", "description": ( - "Get the current live image and detection information for a camera: objects being tracked, " + "Get the current live image and detection information for a single camera: objects being tracked, " "zones, timestamps. Use this to understand what is visible in the live view. " - "Call this when answering questions about what is happening right now on a specific camera." + "Call this when answering questions about what is happening right now on a specific camera. " + "Operates on one camera at a time; call the tool again for each additional camera. " + "Wildcards and empty values are not accepted." ), "parameters": { "type": "object", "properties": { "camera": { "type": "string", - "description": "Camera name to get live context for.", + "description": ( + "Exact name of a single camera to get live context for. " + "Wildcards (e.g. '*', 'all') and empty strings are not accepted." + ), }, }, "required": ["camera"],