mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-08-12 13:51:12 +03:00
Genai review summaries (#19473)
* Generate review item summaries with requests * Adjust logic to only send important items * Don't mention ladder * Adjust prompt to be more specific * Add more relaxed nature for normal activity * Cleanup summary * Update ollama client * Add more directions to analyze the frames in order * Remove environment from prompt
This commit is contained in:
committed by
Blake Blackshear
parent
8e663413bb
commit
dace88bfce
@@ -313,3 +313,9 @@ class EmbeddingsContext:
|
||||
EmbeddingsRequestEnum.embed_thumbnail.value,
|
||||
{"id": str(event_id), "thumbnail": str(thumbnail), "upsert": False},
|
||||
)
|
||||
|
||||
def generate_review_summary(self, start_ts: float, end_ts: float) -> str | None:
|
||||
return self.requestor.send_data(
|
||||
EmbeddingsRequestEnum.summarize_review.value,
|
||||
{"start_ts": start_ts, "end_ts": end_ts},
|
||||
)
|
||||
|
||||
@@ -66,7 +66,7 @@ from frigate.data_processing.types import DataProcessorMetrics, PostProcessDataE
|
||||
from frigate.db.sqlitevecq import SqliteVecQueueDatabase
|
||||
from frigate.events.types import EventTypeEnum, RegenerateDescriptionEnum
|
||||
from frigate.genai import get_genai_client
|
||||
from frigate.models import Event, Recordings, Trigger
|
||||
from frigate.models import Event, Recordings, ReviewSegment, Trigger
|
||||
from frigate.types import TrackedObjectUpdateTypesEnum
|
||||
from frigate.util.builtin import serialize
|
||||
from frigate.util.image import (
|
||||
@@ -121,7 +121,7 @@ class EmbeddingMaintainer(threading.Thread):
|
||||
),
|
||||
load_vec_extension=True,
|
||||
)
|
||||
models = [Event, Recordings, Trigger]
|
||||
models = [Event, Recordings, ReviewSegment, Trigger]
|
||||
db.bind(models)
|
||||
|
||||
if config.semantic_search.enabled:
|
||||
|
||||
Reference in New Issue
Block a user