Review genai updates (#19448)

* Include extra level for normal activity

* Add dynamic toggling

* Update docs

* Add different threshold for genai

* Adjust webUI for object and review description feature

* Adjust config

* Send on startup

* Cleanup config setting

* Set config

* Fix config name
This commit is contained in:
Nicolas Mowen
2025-08-10 07:38:04 -06:00
committed by Blake Blackshear
parent 2cf8dd693c
commit 92417a1b9c
18 changed files with 193 additions and 45 deletions

View File

@@ -46,6 +46,11 @@ class ReviewDescriptionProcessor(PostProcessorApi):
if data_type != PostProcessDataEnum.review:
return
camera = data["after"]["camera"]
if not self.config.cameras[camera].review.genai.enabled:
return
id = data["after"]["id"]
if data["type"] == "new" or data["type"] == "update":
@@ -91,7 +96,6 @@ class ReviewDescriptionProcessor(PostProcessorApi):
return
final_data = data["after"]
camera = final_data["camera"]
if (
final_data["severity"] == "alert"

View File

@@ -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.",
)