mirror of
https://github.com/blakeblackshear/frigate.git
synced 2025-07-16 13:47:07 +02:00
Fix genai labels (#14330)
* Publish model state and embeddings reindex in dispatcher onConnect * remove unneeded from explore * add embeddings reindex progress to statusbar * don't allow right click or show similar button if semantic search is disabled * fix status bar * Convert peewee model to dict before formatting for genai description * add embeddings reindex progress to statusbar * fix status bar * Convert peewee model to dict before formatting for genai description
This commit is contained in:
parent
9adffa1ef5
commit
72aa68cedc
@ -4,6 +4,8 @@ import importlib
|
|||||||
import os
|
import os
|
||||||
from typing import Optional
|
from typing import Optional
|
||||||
|
|
||||||
|
from playhouse.shortcuts import model_to_dict
|
||||||
|
|
||||||
from frigate.config import CameraConfig, GenAIConfig, GenAIProviderEnum
|
from frigate.config import CameraConfig, GenAIConfig, GenAIProviderEnum
|
||||||
from frigate.models import Event
|
from frigate.models import Event
|
||||||
|
|
||||||
@ -36,8 +38,9 @@ class GenAIClient:
|
|||||||
) -> Optional[str]:
|
) -> Optional[str]:
|
||||||
"""Generate a description for the frame."""
|
"""Generate a description for the frame."""
|
||||||
prompt = camera_config.genai.object_prompts.get(
|
prompt = camera_config.genai.object_prompts.get(
|
||||||
event.label, camera_config.genai.prompt
|
event.label,
|
||||||
).format(**event)
|
camera_config.genai.prompt,
|
||||||
|
).format(**model_to_dict(event))
|
||||||
return self._send(prompt, thumbnails)
|
return self._send(prompt, thumbnails)
|
||||||
|
|
||||||
def _init_provider(self):
|
def _init_provider(self):
|
||||||
|
Loading…
Reference in New Issue
Block a user