mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-04-30 18:47:40 +03:00
Don't default to openai
This commit is contained in:
parent
6678d167f4
commit
cfb540e7e2
@ -22,6 +22,6 @@ class GenAIConfig(FrigateBaseModel):
|
|||||||
api_key: Optional[EnvString] = Field(default=None, title="Provider API key.")
|
api_key: Optional[EnvString] = Field(default=None, title="Provider API key.")
|
||||||
base_url: Optional[str] = Field(default=None, title="Provider base url.")
|
base_url: Optional[str] = Field(default=None, title="Provider base url.")
|
||||||
model: str = Field(default="gpt-4o", title="GenAI model.")
|
model: str = Field(default="gpt-4o", title="GenAI model.")
|
||||||
provider: GenAIProviderEnum = Field(
|
provider: GenAIProviderEnum | None = Field(
|
||||||
default=GenAIProviderEnum.openai, title="GenAI provider."
|
default=None, title="GenAI provider."
|
||||||
)
|
)
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
"""Generative AI module for Frigate."""
|
"""Generative AI module for Frigate."""
|
||||||
|
|
||||||
|
import datetime
|
||||||
import importlib
|
import importlib
|
||||||
import logging
|
import logging
|
||||||
import os
|
import os
|
||||||
@ -47,9 +48,9 @@ class GenAIClient:
|
|||||||
- Including **reasonable, evidence-based inferences** about the likely activity or context, but only if directly supported by visible details.
|
- Including **reasonable, evidence-based inferences** about the likely activity or context, but only if directly supported by visible details.
|
||||||
|
|
||||||
When forming your description:
|
When forming your description:
|
||||||
- **Facts first**: Describe the physical setting, people, and objects exactly as seen.
|
- **Facts first**: Describe the time, physical setting, people, and objects exactly as seen.
|
||||||
- **Then context**: Briefly note plausible purposes or activities (e.g., “appears to be delivering a package” if carrying a box to a door).
|
- **Then context**: Briefly note plausible purposes or activities (e.g., “appears to be delivering a package” if carrying a box to a door).
|
||||||
- Clearly separate certain facts (“A person is holding a ladder”) from reasonable inferences (“likely performing maintenance”).
|
- Clearly separate certain facts (“A person is holding an object with horizontal rungs”) from reasonable inferences (“likely a ladder”).
|
||||||
- Do not speculate beyond what is visible, and do not imply hostility, criminal intent, or other strong judgments unless there is unambiguous visual evidence.
|
- Do not speculate beyond what is visible, and do not imply hostility, criminal intent, or other strong judgments unless there is unambiguous visual evidence.
|
||||||
|
|
||||||
Here is information already known:
|
Here is information already known:
|
||||||
@ -116,6 +117,9 @@ class GenAIClient:
|
|||||||
|
|
||||||
def get_genai_client(config: FrigateConfig) -> Optional[GenAIClient]:
|
def get_genai_client(config: FrigateConfig) -> Optional[GenAIClient]:
|
||||||
"""Get the GenAI client."""
|
"""Get the GenAI client."""
|
||||||
|
if not config.genai.provider:
|
||||||
|
return None
|
||||||
|
|
||||||
load_providers()
|
load_providers()
|
||||||
provider = PROVIDERS.get(config.genai.provider)
|
provider = PROVIDERS.get(config.genai.provider)
|
||||||
if provider:
|
if provider:
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user