mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-04-27 09:07:41 +03:00
Generalize
This commit is contained in:
parent
69c7d5047e
commit
49dcc95d26
@ -23,5 +23,6 @@ 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.")
|
||||
keep_alive: int | str | None = Field(default="1h", title="Ollama keep_alive.")
|
||||
extra_options: dict[str, Any] = Field(default={}, title="Ollama extra options.")
|
||||
provider_options: dict[str, Any] = Field(
|
||||
default={}, title="GenAI Provider extra options."
|
||||
)
|
||||
|
||||
@ -48,8 +48,7 @@ class OllamaClient(GenAIClient):
|
||||
self.genai_config.model,
|
||||
prompt,
|
||||
images=images if images else None,
|
||||
keep_alive=self.genai_config.keep_alive,
|
||||
options=self.genai_config.extra_options,
|
||||
**self.genai_config.provider_options,
|
||||
)
|
||||
return result["response"].strip()
|
||||
except (TimeoutException, ResponseError) as e:
|
||||
|
||||
Loading…
Reference in New Issue
Block a user