mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-03-21 23:58:22 +03:00
Compare commits
3 Commits
9007e71a7c
...
cadd5da071
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cadd5da071 | ||
|
|
45ae75a343 | ||
|
|
761a11f41c |
@ -38,7 +38,6 @@ from frigate.config.camera.updater import (
|
||||
CameraConfigUpdateTopic,
|
||||
)
|
||||
from frigate.ffmpeg_presets import FFMPEG_HWACCEL_VAAPI, _gpu_selector
|
||||
from frigate.genai import GenAIClientManager
|
||||
from frigate.jobs.media_sync import (
|
||||
get_current_media_sync_job,
|
||||
get_media_sync_job_by_id,
|
||||
@ -433,7 +432,7 @@ def config_set(request: Request, body: AppConfigSetBody):
|
||||
if body.requires_restart == 0 or body.update_topic:
|
||||
old_config: FrigateConfig = request.app.frigate_config
|
||||
request.app.frigate_config = config
|
||||
request.app.genai_manager = GenAIClientManager(config)
|
||||
request.app.genai_manager.update_config(config)
|
||||
|
||||
if body.update_topic:
|
||||
if body.update_topic.startswith("config/cameras/"):
|
||||
|
||||
@ -26,20 +26,46 @@ class GenAIRoleEnum(str, Enum):
|
||||
class GenAIConfig(FrigateBaseModel):
|
||||
"""Primary GenAI Config to define GenAI Provider."""
|
||||
|
||||
api_key: Optional[EnvString] = Field(default=None, title="Provider API key.")
|
||||
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.")
|
||||
api_key: Optional[EnvString] = Field(
|
||||
default=None,
|
||||
title="API key",
|
||||
description="API key required by some providers (can also be set via environment variables).",
|
||||
)
|
||||
base_url: Optional[str] = Field(
|
||||
default=None,
|
||||
title="Base URL",
|
||||
description="Base URL for self-hosted or compatible providers (for example an Ollama instance).",
|
||||
)
|
||||
model: str = Field(
|
||||
default="gpt-4o",
|
||||
title="Model",
|
||||
description="The model to use from the provider for generating descriptions or summaries.",
|
||||
)
|
||||
provider: GenAIProviderEnum | None = Field(
|
||||
default=None,
|
||||
title="Provider",
|
||||
description="The GenAI provider to use (for example: ollama, gemini, openai).",
|
||||
)
|
||||
roles: list[GenAIRoleEnum] = Field(
|
||||
default_factory=lambda: [
|
||||
GenAIRoleEnum.embeddings,
|
||||
GenAIRoleEnum.vision,
|
||||
GenAIRoleEnum.tools,
|
||||
],
|
||||
title="GenAI roles (tools, vision, embeddings); one provider per role.",
|
||||
title="Roles",
|
||||
description="GenAI roles (tools, vision, embeddings); one provider per role.",
|
||||
)
|
||||
provider_options: dict[str, Any] = Field(
|
||||
default={}, title="GenAI Provider extra options."
|
||||
default={},
|
||||
title="Provider options",
|
||||
description="Additional provider-specific options to pass to the GenAI client.",
|
||||
json_schema_extra={"additionalProperties": {"type": "string"}},
|
||||
)
|
||||
runtime_options: dict[str, Any] = Field(
|
||||
default={},
|
||||
title="Runtime options",
|
||||
description="Runtime options passed to the provider for each inference call.",
|
||||
json_schema_extra={"additionalProperties": {"type": "string"}},
|
||||
)
|
||||
runtime_options: dict[str, Any] = Field(
|
||||
default={}, title="Options to pass during inference calls."
|
||||
|
||||
Loading…
Reference in New Issue
Block a user