From caf35ec3f4410abfce3de65a93bc98cdddf7632e Mon Sep 17 00:00:00 2001 From: Nicolas Mowen Date: Sun, 10 Aug 2025 06:01:46 -0600 Subject: [PATCH] Include extra level for normal activity --- frigate/data_processing/post/types.py | 5 ++--- frigate/genai/__init__.py | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/frigate/data_processing/post/types.py b/frigate/data_processing/post/types.py index cae50d80c..d79a063b5 100644 --- a/frigate/data_processing/post/types.py +++ b/frigate/data_processing/post/types.py @@ -8,9 +8,8 @@ class ReviewMetadata(BaseModel): confidence: float = Field( description="A float between 0 and 1 representing your overall confidence in this analysis." ) - potential_threat_level: int | None = Field( - default=None, - ge=1, + potential_threat_level: int = Field( + ge=0, le=3, description="An integer representing the potential threat level (1-3). 1: Minor anomaly. 2: Moderate concern. 3: High threat. Only include this field if a clear security concern is observable; otherwise, omit it.", ) diff --git a/frigate/genai/__init__.py b/frigate/genai/__init__.py index a79cf71ee..bcb95e756 100644 --- a/frigate/genai/__init__.py +++ b/frigate/genai/__init__.py @@ -62,10 +62,10 @@ class GenAIClient: - `scene` (string): A full description including setting, entities, actions, and any plausible supported inferences. - `confidence` (float): A number 0–1 for overall confidence in the analysis. - `potential_threat_level` (integer, optional): Include only if there is a clear, observable security concern: + - 0 = Normal activity is occurring - 1 = Unusual but not overtly threatening - 2 = Suspicious or potentially harmful - 3 = Clear and immediate threat - Omit this field if no concern is evident. **IMPORTANT:** - Values must be plain strings, floats, or integers — no nested objects, no extra commentary.