mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-05-01 02:57:41 +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:
|
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:
|
def handle_update_model_state() -> None:
|
||||||
if payload:
|
if payload:
|
||||||
|
|||||||
@ -104,6 +104,7 @@ class ReviewDescriptionProcessor(PostProcessorApi):
|
|||||||
threading.Thread(
|
threading.Thread(
|
||||||
target=run_analysis,
|
target=run_analysis,
|
||||||
args=(
|
args=(
|
||||||
|
self.requestor,
|
||||||
self.genai_client,
|
self.genai_client,
|
||||||
camera,
|
camera,
|
||||||
final_data,
|
final_data,
|
||||||
|
|||||||
@ -65,9 +65,7 @@ class GenAIClient:
|
|||||||
Omit this field entirely if there is no observable security concern.
|
Omit this field entirely if there is no observable security concern.
|
||||||
|
|
||||||
**IMPORTANT:**
|
**IMPORTANT:**
|
||||||
- Values for each field must be plain strings or integers — no nested objects or explanatory text.
|
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"]}
|
|
||||||
"""
|
"""
|
||||||
response = self._send(context_prompt, thumbnails)
|
response = self._send(context_prompt, thumbnails)
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user