mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-01-28 06:58:30 +03:00
Some checks are pending
CI / ARM Extra Build (push) Blocked by required conditions
CI / Synaptics Build (push) Blocked by required conditions
CI / Assemble and push default build (push) Blocked by required conditions
CI / AMD64 Build (push) Waiting to run
CI / ARM Build (push) Waiting to run
CI / Jetson Jetpack 6 (push) Waiting to run
CI / AMD64 Extra Build (push) Blocked by required conditions
* Strip model name before training * Handle options file for go2rtc option * Make reviewed optional and add null to API call * Send reviewed for dashboard * Allow setting context size for openai compatible endpoints * push empty go2rtc config to avoid homekit error in log * Add option to set runtime options for LLM providers * Docs --------- Co-authored-by: Josh Hawkins <32435876+hawkeye217@users.noreply.github.com>
32 lines
969 B
Python
32 lines
969 B
Python
from enum import Enum
|
|
from typing import Any, Optional
|
|
|
|
from pydantic import Field
|
|
|
|
from ..base import FrigateBaseModel
|
|
from ..env import EnvString
|
|
|
|
__all__ = ["GenAIConfig", "GenAIProviderEnum"]
|
|
|
|
|
|
class GenAIProviderEnum(str, Enum):
|
|
openai = "openai"
|
|
azure_openai = "azure_openai"
|
|
gemini = "gemini"
|
|
ollama = "ollama"
|
|
|
|
|
|
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.")
|
|
provider_options: dict[str, Any] = Field(
|
|
default={}, title="GenAI Provider extra options."
|
|
)
|
|
runtime_options: dict[str, Any] = Field(
|
|
default={}, title="Options to pass during inference calls."
|
|
)
|