mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-15 07:35:27 +03:00
Fix substitution on genai prompts
This commit is contained in:
parent
6e332bbdf8
commit
da312afcfc
@ -259,7 +259,7 @@ class EmbeddingMaintainer(threading.Thread):
|
||||
camera_config = self.config.cameras[event.camera]
|
||||
|
||||
description = self.genai_client.generate_description(
|
||||
camera_config, thumbnails, event.label
|
||||
camera_config, thumbnails, event
|
||||
)
|
||||
|
||||
if not description:
|
||||
|
||||
@ -5,6 +5,7 @@ import os
|
||||
from typing import Optional
|
||||
|
||||
from frigate.config import CameraConfig, GenAIConfig, GenAIProviderEnum
|
||||
from frigate.models import Event
|
||||
|
||||
PROVIDERS = {}
|
||||
|
||||
@ -31,12 +32,12 @@ class GenAIClient:
|
||||
self,
|
||||
camera_config: CameraConfig,
|
||||
thumbnails: list[bytes],
|
||||
label: str,
|
||||
event: Event,
|
||||
) -> Optional[str]:
|
||||
"""Generate a description for the frame."""
|
||||
prompt = camera_config.genai.object_prompts.get(
|
||||
label, camera_config.genai.prompt
|
||||
).format(label=label)
|
||||
event.label, camera_config.genai.prompt
|
||||
).format(**event)
|
||||
return self._send(prompt, thumbnails)
|
||||
|
||||
def _init_provider(self):
|
||||
|
||||
Loading…
Reference in New Issue
Block a user