From 7c066f661a23eeded9b697f9fff47f9815084368 Mon Sep 17 00:00:00 2001 From: Nicolas Mowen Date: Sat, 14 Feb 2026 15:49:04 -0700 Subject: [PATCH] Convert to roles list --- frigate/config/camera/genai.py | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/frigate/config/camera/genai.py b/frigate/config/camera/genai.py index 3dd596c3b..790b66f25 100644 --- a/frigate/config/camera/genai.py +++ b/frigate/config/camera/genai.py @@ -6,7 +6,7 @@ from pydantic import Field from ..base import FrigateBaseModel from ..env import EnvString -__all__ = ["GenAIConfig", "GenAIProviderEnum"] +__all__ = ["GenAIConfig", "GenAIProviderEnum", "GenAIRoleEnum"] class GenAIProviderEnum(str, Enum): @@ -17,6 +17,12 @@ class GenAIProviderEnum(str, Enum): llamacpp = "llamacpp" +class GenAIRoleEnum(str, Enum): + tools = "tools" + vision = "vision" + embeddings = "embeddings" + + class GenAIConfig(FrigateBaseModel): """Primary GenAI Config to define GenAI Provider.""" @@ -24,6 +30,14 @@ class GenAIConfig(FrigateBaseModel): base_url: Optional[str] = Field(default=None, title="Provider base url.") model: str = Field(default="gpt-4o", title="GenAI model.") provider: GenAIProviderEnum | None = Field(default=None, title="GenAI provider.") + roles: list[GenAIRoleEnum] = Field( + default_factory=lambda: [ + GenAIRoleEnum.embeddings, + GenAIRoleEnum.vision, + GenAIRoleEnum.tools, + ], + title="GenAI roles (tools, vision, embeddings); one provider per role.", + ) provider_options: dict[str, Any] = Field( default={}, title="GenAI Provider extra options." )