From 9949f9c6e6e9a2912567cbde35cfb8dbe5130464 Mon Sep 17 00:00:00 2001 From: Nicolas Mowen Date: Tue, 12 Aug 2025 16:18:01 -0600 Subject: [PATCH] Remove environment from prompt --- frigate/config/camera/genai.py | 4 +--- frigate/data_processing/post/api.py | 4 +++- frigate/genai/__init__.py | 6 ++++-- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/frigate/config/camera/genai.py b/frigate/config/camera/genai.py index 059aeefdd..b47839dd5 100644 --- a/frigate/config/camera/genai.py +++ b/frigate/config/camera/genai.py @@ -22,6 +22,4 @@ class GenAIConfig(FrigateBaseModel): api_key: Optional[EnvString] = Field(default=None, title="Provider API key.") base_url: Optional[str] = Field(default=None, title="Provider base url.") model: str = Field(default="gpt-4o", title="GenAI model.") - provider: GenAIProviderEnum | None = Field( - default=None, title="GenAI provider." - ) + provider: GenAIProviderEnum | None = Field(default=None, title="GenAI provider.") diff --git a/frigate/data_processing/post/api.py b/frigate/data_processing/post/api.py index 425e61ebb..c341bd8ef 100644 --- a/frigate/data_processing/post/api.py +++ b/frigate/data_processing/post/api.py @@ -39,7 +39,9 @@ class PostProcessorApi(ABC): pass @abstractmethod - def handle_request(self, topic: str, request_data: dict[str, Any]) -> dict[str, Any] | None: + def handle_request( + self, topic: str, request_data: dict[str, Any] + ) -> dict[str, Any] | None: """Handle metadata requests. Args: request_data (dict): containing data about requested change to process. diff --git a/frigate/genai/__init__.py b/frigate/genai/__init__.py index 3ddbd4acc..da73d2ab8 100644 --- a/frigate/genai/__init__.py +++ b/frigate/genai/__init__.py @@ -72,7 +72,7 @@ Your task is to provide a clear, security-focused description of the scene that: Facts come first, but identifying security risks is the primary goal. When forming your description: -- Describe the time, physical setting, people, and objects exactly as seen. Include any observable environmental changes (e.g., lighting changes triggered by activity). +- Describe the time, people, and objects exactly as seen. Include any observable environmental changes (e.g., lighting changes triggered by activity). - Time of day should **increase suspicion only when paired with unusual or security-relevant behaviors**. Do not raise the threat level for common residential activities (e.g., residents walking pets, retrieving mail, gardening, playing with pets, supervising children) even at unusual hours, unless other suspicious indicators are present. - Focus on behaviors that are uncharacteristic of innocent activity: loitering without clear purpose, avoiding cameras, inspecting vehicles/doors, changing behavior when lights activate, scanning surroundings without an apparent benign reason. - **Benign context override**: If scanning or looking around is clearly part of an innocent activity (such as playing with a dog, gardening, supervising children, or watching for a pet), do not treat it as suspicious. @@ -105,7 +105,9 @@ Sequence details: if debug_save: with open( - os.path.join(CLIPS_DIR, "genai-requests", review_data["id"], "prompt.txt"), + os.path.join( + CLIPS_DIR, "genai-requests", review_data["id"], "prompt.txt" + ), "w", ) as f: f.write(context_prompt)