mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-04-27 09:07:41 +03:00
Make keep_alive and options configurable
This commit is contained in:
parent
834cd10f99
commit
69c7d5047e
@ -1,5 +1,5 @@
|
||||
from enum import Enum
|
||||
from typing import Optional
|
||||
from typing import Any, Optional
|
||||
|
||||
from pydantic import Field
|
||||
|
||||
@ -23,3 +23,5 @@ 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.")
|
||||
|
||||
@ -48,7 +48,8 @@ class OllamaClient(GenAIClient):
|
||||
self.genai_config.model,
|
||||
prompt,
|
||||
images=images if images else None,
|
||||
keep_alive="1h",
|
||||
keep_alive=self.genai_config.keep_alive,
|
||||
options=self.genai_config.extra_options,
|
||||
)
|
||||
return result["response"].strip()
|
||||
except (TimeoutException, ResponseError) as e:
|
||||
|
||||
Loading…
Reference in New Issue
Block a user