mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-07-09 21:41:15 +03:00
Simplify JSON since not all providers see or use this the same
This commit is contained in:
parent
7f3118f1ef
commit
733c50c6e8
@ -2,7 +2,7 @@ from typing import Annotated
|
|||||||
|
|
||||||
from pydantic import BaseModel, ConfigDict, Field, StringConstraints
|
from pydantic import BaseModel, ConfigDict, Field, StringConstraints
|
||||||
|
|
||||||
ObservationItem = Annotated[str, StringConstraints(min_length=20, max_length=160)]
|
ObservationItem = Annotated[str, StringConstraints(min_length=20, max_length=200)]
|
||||||
|
|
||||||
|
|
||||||
class ReviewMetadata(BaseModel):
|
class ReviewMetadata(BaseModel):
|
||||||
@ -11,19 +11,8 @@ class ReviewMetadata(BaseModel):
|
|||||||
observations: list[ObservationItem] = Field(
|
observations: list[ObservationItem] = Field(
|
||||||
...,
|
...,
|
||||||
min_length=3,
|
min_length=3,
|
||||||
max_length=15,
|
max_length=8,
|
||||||
description=(
|
description="Enumerate the significant observations across all frames, in chronological order.",
|
||||||
"Enumerate the significant observations across all frames, in "
|
|
||||||
"chronological order, BEFORE composing the scene narrative. "
|
|
||||||
"Include the very start of the activity — for example, a vehicle "
|
|
||||||
"entering the frame or pulling into the driveway — even if it "
|
|
||||||
"lasts only a few frames and the rest of the clip is dominated "
|
|
||||||
"by a longer activity. Include each arrival, departure, motion "
|
|
||||||
"event, object handled, and notable change in position or state. "
|
|
||||||
"Each item is a single concrete fact written as a complete "
|
|
||||||
"sentence. Do not summarize, interpret, or assign meaning here — "
|
|
||||||
"that belongs in the scene field."
|
|
||||||
),
|
|
||||||
)
|
)
|
||||||
scene: str = Field(
|
scene: str = Field(
|
||||||
min_length=150,
|
min_length=150,
|
||||||
@ -32,12 +21,12 @@ class ReviewMetadata(BaseModel):
|
|||||||
)
|
)
|
||||||
title: str = Field(
|
title: str = Field(
|
||||||
max_length=80,
|
max_length=80,
|
||||||
description="Under 10 words. Name the apparent purpose or outcome of the activity together with the location involved. Do not narrate or list the sequence of actions step by step.",
|
description="Title for the activity.",
|
||||||
)
|
)
|
||||||
shortSummary: str = Field(
|
shortSummary: str = Field(
|
||||||
min_length=70,
|
min_length=70,
|
||||||
max_length=120,
|
max_length=140,
|
||||||
description="A brief 2-sentence summary of the scene, suitable for notifications.",
|
description="A brief summary for the activity.",
|
||||||
)
|
)
|
||||||
confidence: float = Field(
|
confidence: float = Field(
|
||||||
ge=0.0,
|
ge=0.0,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user