From 5abef619d00e8ff644dc51d12324e30a277c9b73 Mon Sep 17 00:00:00 2001 From: Nicolas Mowen Date: Fri, 8 Aug 2025 18:00:23 -0600 Subject: [PATCH] Prompt adjustment --- frigate/data_processing/post/review_descriptions.py | 5 ++++- frigate/genai/__init__.py | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/frigate/data_processing/post/review_descriptions.py b/frigate/data_processing/post/review_descriptions.py index 0548876e9..601ea6532 100644 --- a/frigate/data_processing/post/review_descriptions.py +++ b/frigate/data_processing/post/review_descriptions.py @@ -1,5 +1,6 @@ """Post processor for review items to get descriptions.""" +import datetime import logging import os import shutil @@ -95,7 +96,9 @@ class ReviewDescriptionProcessor(PostProcessorApi): "objects": final_data["data"]["objects"], "recognized_objects": final_data["data"]["sub_labels"], "zones": final_data["data"]["zones"], - "timestamp": final_data["end_time"], + "timestamp": datetime.datetime.fromtimestamp( + final_data["end_time"] + ), }, [r[1] for r in self.tracked_review_items[id]], ) diff --git a/frigate/genai/__init__.py b/frigate/genai/__init__.py index d206a87a5..d5004a18d 100644 --- a/frigate/genai/__init__.py +++ b/frigate/genai/__init__.py @@ -39,7 +39,7 @@ class GenAIClient: ) -> None: """Generate a description for the review item activity.""" context_prompt = f""" - Please analyze the image(s), which are in chronological order, strictly from the perspective of the {review_data["camera"].replace("_", " ")} security camera. + Please analyze the image(s), which are in chronological order, strictly from the perspective of the {review_data['camera'].replace('_', ' ')} security camera. Your task is to provide a **neutral, factual, and objective description** of the scene and the objects interacting with it. Focus solely on observable actions, visible entities, and the environment. @@ -57,7 +57,7 @@ class GenAIClient: **IMPORTANT:** The value for each field (e.g., "scene", "action") must be a plain string or integer, NOT another JSON object or a description of the field itself. Provide the response in the exact JSON format specified by this schema: - {ReviewMetadata.model_json_schema()} + {ReviewMetadata.model_json_schema()['properties']} """ logger.info(f"processing {review_data}") logger.info(f"Got GenAI review: {self._send(context_prompt, thumbnails)}")