fix: upgrade google-genai sdk version and fix gemini 3 streaming (#6437)

* base

* base

---------

Co-authored-by: Letta Bot <noreply@letta.com>
This commit is contained in:
jnjpng
2025-11-28 18:31:49 -08:00
committed by Caren Thomas
parent c4d5c380d6
commit c6df306ccf
4 changed files with 18 additions and 10 deletions

View File

@@ -112,7 +112,12 @@ class SimpleLLMStreamAdapter(LettaLLMStreamAdapter):
# Start the streaming request (map provider errors to common LLMError types)
try:
stream = await self.llm_client.stream_async(request_data, self.llm_config)
# Gemini uses async generator pattern (no await) to maintain connection lifecycle
# Other providers return awaitables that resolve to iterators
if self.llm_config.model_endpoint_type in [ProviderType.google_ai, ProviderType.google_vertex]:
stream = self.llm_client.stream_async(request_data, self.llm_config)
else:
stream = await self.llm_client.stream_async(request_data, self.llm_config)
except Exception as e:
raise self.llm_client.handle_llm_error(e)