diff --git a/litellm/llms/vertex_ai/gemini/transformation.py b/litellm/llms/vertex_ai/gemini/transformation.py index c0d024da59a..c32ac29e9cd 100644 --- a/litellm/llms/vertex_ai/gemini/transformation.py +++ b/litellm/llms/vertex_ai/gemini/transformation.py @@ -257,13 +257,11 @@ def _transform_part_to_httpx_format(part: dict, parent_key: Optional[str] = None # These are user-defined keys that should be preserved. should_preserve_keys = False if isinstance(v, dict): - if k == "args" and parent_key in ["functionCall", "function_call"]: + if k == "args" and parent_key == "functionCall": should_preserve_keys = True elif k == "response" and parent_key in [ "functionResponse", - "function_response", "toolResponse", - "tool_response", ]: should_preserve_keys = True elif k == "properties": diff --git a/tests/litellm/llms/vertex_ai/gemini/test_transformation.py b/tests/litellm/llms/vertex_ai/gemini/test_transformation.py index 818947325f1..c88e2bd3fbc 100644 --- a/tests/litellm/llms/vertex_ai/gemini/test_transformation.py +++ b/tests/litellm/llms/vertex_ai/gemini/test_transformation.py @@ -309,7 +309,7 @@ def test_vertex_transformation_field_casing(): "args": {"security_risk": "high", "other_param": 123}, } } - transformed = _transform_part_to_httpx_format(part, parent_key="functionCall") + transformed = _transform_part_to_httpx_format(part) assert "functionCall" in transformed assert "args" in transformed["functionCall"] # Keys in args should NOT be camelCased