Skip to content

armgit / letta

Public Imported from GitHub
0

Platform for stateful agents: AI with advanced memory that can learn and self-improve over time.

fix: retry on gemini 504 (#2861)

jnjpng2899171e2c3d
diff --git a/letta/llm_api/google_vertex_client.py b/letta/llm_api/google_vertex_client.py
index 551dfc55d..22ef86445 100644
--- a/letta/llm_api/google_vertex_client.py
+++ b/letta/llm_api/google_vertex_client.py
@@ -93,7 +93,7 @@ class GoogleVertexClient(LLMClientBase):
)
except errors.APIError as e:
# Retry on 503 and 500 errors as well, usually ephemeral from Gemini
- if e.code == 503 or e.code == 500:
+ if e.code == 503 or e.code == 500 or e.code == 504:
logger.warning(f"Received {e}, retrying {retry_count}/{self.MAX_RETRIES}")
retry_count += 1
if retry_count > self.MAX_RETRIES: