mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-03-18 06:08:22 +03:00
GenAI client manager
This commit is contained in:
parent
9c3a74b4f5
commit
c058b2d999
@ -12,10 +12,22 @@ from playhouse.shortcuts import model_to_dict
|
|||||||
from frigate.config import CameraConfig, FrigateConfig, GenAIConfig, GenAIProviderEnum
|
from frigate.config import CameraConfig, FrigateConfig, GenAIConfig, GenAIProviderEnum
|
||||||
from frigate.const import CLIPS_DIR
|
from frigate.const import CLIPS_DIR
|
||||||
from frigate.data_processing.post.types import ReviewMetadata
|
from frigate.data_processing.post.types import ReviewMetadata
|
||||||
|
from frigate.genai.manager import GenAIClientManager
|
||||||
from frigate.models import Event
|
from frigate.models import Event
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
__all__ = [
|
||||||
|
"GenAIClient",
|
||||||
|
"GenAIClientManager",
|
||||||
|
"GenAIConfig",
|
||||||
|
"GenAIProviderEnum",
|
||||||
|
"PROVIDERS",
|
||||||
|
"get_genai_client",
|
||||||
|
"load_providers",
|
||||||
|
"register_genai_provider",
|
||||||
|
]
|
||||||
|
|
||||||
PROVIDERS = {}
|
PROVIDERS = {}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
29
frigate/genai/manager.py
Normal file
29
frigate/genai/manager.py
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
"""GenAI client manager for Frigate.
|
||||||
|
|
||||||
|
Manages GenAI provider clients and supports multiple providers. Configuration
|
||||||
|
is driven by FrigateConfig; _update_config is called on init and can be
|
||||||
|
called again when config is reloaded.
|
||||||
|
"""
|
||||||
|
|
||||||
|
import logging
|
||||||
|
|
||||||
|
from frigate.config import FrigateConfig
|
||||||
|
|
||||||
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
|
class GenAIClientManager:
|
||||||
|
"""Manages GenAI provider clients from Frigate config."""
|
||||||
|
|
||||||
|
def __init__(self, config: FrigateConfig) -> None:
|
||||||
|
self._config = config
|
||||||
|
self._update_config()
|
||||||
|
|
||||||
|
def _update_config(self) -> None:
|
||||||
|
"""Update internal state from the current Frigate config.
|
||||||
|
|
||||||
|
Called from __init__ and can be called again when config is reloaded
|
||||||
|
to support multiple providers or config changes.
|
||||||
|
"""
|
||||||
|
# Placeholder for multi-provider setup; will be extended in later refactor steps.
|
||||||
|
pass
|
||||||
Loading…
Reference in New Issue
Block a user