chore: enable flash and fix vertex integration (#2003)

This commit is contained in:
Sarah Wooders
2025-05-05 13:47:28 -07:00
committed by GitHub
parent 1986d82aff
commit 80db705db7
2 changed files with 7 additions and 6 deletions

View File

@@ -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,

View File

@@ -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