mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-04-27 17:17:40 +03:00
Save review metadata to DB
This commit is contained in:
parent
8d719ec9cb
commit
48a69c2ffb
@ -151,7 +151,12 @@ class Dispatcher:
|
||||
)
|
||||
|
||||
def handle_update_review_description() -> None:
|
||||
logger.info(f"received review genai data {payload}")
|
||||
final_data = payload["after"]
|
||||
ReviewSegment.insert(final_data).on_conflict(
|
||||
conflict_target=[ReviewSegment.id],
|
||||
update=final_data,
|
||||
).execute()
|
||||
self.publish("reviews", payload)
|
||||
|
||||
def handle_update_model_state() -> None:
|
||||
if payload:
|
||||
|
||||
@ -104,6 +104,7 @@ class ReviewDescriptionProcessor(PostProcessorApi):
|
||||
threading.Thread(
|
||||
target=run_analysis,
|
||||
args=(
|
||||
self.requestor,
|
||||
self.genai_client,
|
||||
camera,
|
||||
final_data,
|
||||
|
||||
@ -65,9 +65,7 @@ class GenAIClient:
|
||||
Omit this field entirely if there is no observable security concern.
|
||||
|
||||
**IMPORTANT:**
|
||||
- Values for each field must be plain strings or integers — no nested objects or explanatory text.
|
||||
- The JSON must strictly match this structure:
|
||||
{ReviewMetadata.model_json_schema()["properties"]}
|
||||
Values for each field must be plain strings or integers — no nested objects or explanatory text.
|
||||
"""
|
||||
response = self._send(context_prompt, thumbnails)
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user