diff --git a/frigate/data_processing/post/types.py b/frigate/data_processing/post/types.py index 10390112d..02d27ccce 100644 --- a/frigate/data_processing/post/types.py +++ b/frigate/data_processing/post/types.py @@ -8,8 +8,6 @@ class ReviewMetadata(BaseModel): description="A short title characterizing what took place and where, under 10 words." ) scene: str = Field( - min_length=120, - max_length=600, description="A chronological narrative of what happens from start to finish.", ) shortSummary: str = Field( diff --git a/frigate/genai/__init__.py b/frigate/genai/__init__.py index d95dd2cae..a38f10de5 100644 --- a/frigate/genai/__init__.py +++ b/frigate/genai/__init__.py @@ -151,6 +151,18 @@ Each line represents a detection state, not necessarily unique individuals. The if "other_concerns" in schema.get("required", []): schema["required"].remove("other_concerns") + # Length hints injected into the schema as suggestions to the model + # (enforced by grammar-based providers like llama.cpp) but kept off the + # Pydantic model so a non-compliant response does not fail validation. + length_hints = { + "scene": {"minLength": 120, "maxLength": 600}, + "shortSummary": {"minLength": 70, "maxLength": 100}, + } + for field, hints in length_hints.items(): + prop = schema.get("properties", {}).get(field) + if prop is not None: + prop.update(hints) + # OpenAI strict mode requires additionalProperties: false on all objects schema["additionalProperties"] = False diff --git a/web/public/locales/en/common.json b/web/public/locales/en/common.json index de17f444b..8b86b69d4 100644 --- a/web/public/locales/en/common.json +++ b/web/public/locales/en/common.json @@ -257,6 +257,7 @@ "export": "Export", "actions": "Actions", "uiPlayground": "UI Playground", + "features": "Features", "faceLibrary": "Face Library", "classification": "Classification", "chat": "Chat", diff --git a/web/src/components/card/AnimatedEventCard.tsx b/web/src/components/card/AnimatedEventCard.tsx index 53a548103..1b7b11f3d 100644 --- a/web/src/components/card/AnimatedEventCard.tsx +++ b/web/src/components/card/AnimatedEventCard.tsx @@ -161,13 +161,13 @@ export function AnimatedEventCard({