feat: improve error message for vertex response parsing (#4043)

This commit is contained in:
cthomas
2025-08-20 09:52:20 -07:00
committed by GitHub
parent 5ecebe694a
commit 02de0effa6

View File

@@ -312,7 +312,7 @@ class GoogleVertexClient(LLMClientBase):
if candidate.finish_reason == "MALFORMED_FUNCTION_CALL":
raise ValueError(f"Error in response data from LLM: {candidate.finish_reason}...")
else:
raise ValueError(f"Error in response data from LLM: {response_data}")
raise ValueError(f"Error in response data from LLM: {candidate.model_dump()}")
role = content.role
assert role == "model", f"Unknown role in response: {role}"