mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-04-05 22:57:40 +03:00
Fix Gemini Chat
This commit is contained in:
parent
2f05ff2a96
commit
996d2b15b1
@ -397,13 +397,13 @@ class GeminiClient(GenAIClient):
|
|||||||
tool_calls_by_index: dict[int, dict[str, Any]] = {}
|
tool_calls_by_index: dict[int, dict[str, Any]] = {}
|
||||||
finish_reason = "stop"
|
finish_reason = "stop"
|
||||||
|
|
||||||
response = self.provider.models.generate_content_stream(
|
stream = await self.provider.aio.models.generate_content_stream(
|
||||||
model=self.genai_config.model,
|
model=self.genai_config.model,
|
||||||
contents=gemini_messages,
|
contents=gemini_messages,
|
||||||
config=types.GenerateContentConfig(**config_params),
|
config=types.GenerateContentConfig(**config_params),
|
||||||
)
|
)
|
||||||
|
|
||||||
async for chunk in response:
|
async for chunk in stream:
|
||||||
if not chunk or not chunk.candidates:
|
if not chunk or not chunk.candidates:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user