Refactor: nearly done phase 5
This commit is contained in:
parent
227e696ed6
commit
7a9a149955
12 changed files with 2750 additions and 105 deletions
|
@ -35,10 +35,23 @@ class CameraConnection(BaseModel):
|
|||
|
||||
|
||||
class DetectionData(BaseModel):
|
||||
"""Detection result data structure."""
|
||||
model_config = {"json_encoders": {type(None): lambda v: None}}
|
||||
"""
|
||||
Detection result data structure.
|
||||
|
||||
detection: Optional[Dict[str, Any]] = Field(None, description="Flat key-value detection results, null for abandonment")
|
||||
Supports three cases:
|
||||
1. Empty detection: detection = {} (triggers session creation)
|
||||
2. Full detection: detection = {"carBrand": "Honda", ...} (updates session)
|
||||
3. Null detection: detection = None (car abandonment)
|
||||
"""
|
||||
model_config = {
|
||||
"json_encoders": {type(None): lambda v: None},
|
||||
"arbitrary_types_allowed": True
|
||||
}
|
||||
|
||||
detection: Union[Dict[str, Any], None] = Field(
|
||||
default_factory=dict,
|
||||
description="Detection results: {} for empty, {...} for data, None/null for abandonment"
|
||||
)
|
||||
modelId: int
|
||||
modelName: str
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue