mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-04-27 09:07:41 +03:00
Use for other providers
This commit is contained in:
parent
49dcc95d26
commit
7c6ba35a92
@ -21,7 +21,9 @@ class GeminiClient(GenAIClient):
|
||||
def _init_provider(self):
|
||||
"""Initialize the client."""
|
||||
genai.configure(api_key=self.genai_config.api_key)
|
||||
return genai.GenerativeModel(self.genai_config.model)
|
||||
return genai.GenerativeModel(
|
||||
self.genai_config.model, **self.genai_config.provider_options
|
||||
)
|
||||
|
||||
def _send(self, prompt: str, images: list[bytes]) -> Optional[str]:
|
||||
"""Submit a request to Gemini."""
|
||||
|
||||
@ -21,7 +21,9 @@ class OpenAIClient(GenAIClient):
|
||||
|
||||
def _init_provider(self):
|
||||
"""Initialize the client."""
|
||||
return OpenAI(api_key=self.genai_config.api_key)
|
||||
return OpenAI(
|
||||
api_key=self.genai_config.api_key, **self.genai_config.provider_options
|
||||
)
|
||||
|
||||
def _send(self, prompt: str, images: list[bytes]) -> Optional[str]:
|
||||
"""Submit a request to OpenAI."""
|
||||
|
||||
Loading…
Reference in New Issue
Block a user