GenAI client manager

This commit is contained in:
Nicolas Mowen 2026-02-14 15:37:53 -07:00
parent 9c3a74b4f5
commit c058b2d999
2 changed files with 41 additions and 0 deletions

View File

@ -12,10 +12,22 @@ from playhouse.shortcuts import model_to_dict
from frigate.config import CameraConfig, FrigateConfig, GenAIConfig, GenAIProviderEnum
from frigate.const import CLIPS_DIR
from frigate.data_processing.post.types import ReviewMetadata
from frigate.genai.manager import GenAIClientManager
from frigate.models import Event
logger = logging.getLogger(__name__)
__all__ = [
"GenAIClient",
"GenAIClientManager",
"GenAIConfig",
"GenAIProviderEnum",
"PROVIDERS",
"get_genai_client",
"load_providers",
"register_genai_provider",
]
PROVIDERS = {}

29
frigate/genai/manager.py Normal file
View 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