mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-19 04:54:37 +00:00
fix(logging): clarify ValueError message in google_genai generate_content else branch
The else branch triggers when both httpx_response is invalid (None or wrong type) and result is not a dict. Previous message implied httpx_response was always None; new message explicitly names both failed conditions, making it easier to diagnose unexpected result types.
This commit is contained in:
parent
311039d2cb
commit
556592573d
1 changed files with 5 additions and 1 deletions
|
|
@ -3305,7 +3305,11 @@ class Logging(LiteLLMLoggingBaseClass):
|
|||
elif isinstance(result, dict):
|
||||
dict_result = result
|
||||
else:
|
||||
raise ValueError("Google GenAI Generate Content: httpx_response is None")
|
||||
raise ValueError(
|
||||
f"Google GenAI Generate Content: no valid httpx_response "
|
||||
f"(got {type(httpx_response).__name__!r}) and result is not a dict "
|
||||
f"(got {type(result).__name__!r}); cannot log response"
|
||||
)
|
||||
result = litellm.VertexGeminiConfig()._transform_google_generate_content_to_openai_model_response(
|
||||
completion_response=dict_result,
|
||||
model_response=litellm.ModelResponse(),
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue