From a4da3c51926c2191e44f9d4cd4481d2998a91d45 Mon Sep 17 00:00:00 2001 From: Sarah Wooders Date: Mon, 5 May 2025 13:47:28 -0700 Subject: [PATCH] chore: enable flash and fix vertex integration (#2003) --- letta/llm_api/google_constants.py | 1 + letta/llm_api/google_vertex_client.py | 12 ++++++------ 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/letta/llm_api/google_constants.py b/letta/llm_api/google_constants.py index 5215f69c..c720a33a 100644 --- a/letta/llm_api/google_constants.py +++ b/letta/llm_api/google_constants.py @@ -1,5 +1,6 @@ GOOGLE_MODEL_TO_CONTEXT_LENGTH = { "gemini-2.5-pro-exp-03-25": 1048576, + "gemini-2.5-flash-preview-04-17": 1048576, "gemini-2.0-flash-001": 1048576, "gemini-2.0-pro-exp-02-05": 2097152, "gemini-2.0-flash-lite-preview-02-05": 1048576, diff --git a/letta/llm_api/google_vertex_client.py b/letta/llm_api/google_vertex_client.py index 15e610d4..4edd03b2 100644 --- a/letta/llm_api/google_vertex_client.py +++ b/letta/llm_api/google_vertex_client.py @@ -110,12 +110,12 @@ class GoogleVertexClient(GoogleAIClient): for candidate in response.candidates: content = candidate.content - if "role" not in content or not content["role"]: - # This means the response is malformed like MALFORMED_FUNCTION_CALL - # NOTE: must be a ValueError to trigger a retry - raise ValueError(f"Error in response data from LLM: {response_data}") - role = content["role"] - assert role == "model", f"Unknown role in response: {role}" + # if "role" not in content or not content["role"]: + # # This means the response is malformed like MALFORMED_FUNCTION_CALL + # # NOTE: must be a ValueError to trigger a retry + # raise ValueError(f"Error in response data from LLM: {response_data}") + # role = content["role"] + # assert role == "model", f"Unknown role in response: {role}" parts = content.parts