The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]
Python ai-gatewayanthropicazure-openaibedrockgatewaylangchainlitellmllmllm-gatewayllmopsmcp-gatewayopenaiopenai-proxyrustrust-aivertex-ai
Remove dead _transform_response_for_json_mode wrapper
Mateo Wang3bbb5c7fd74d
diff --git a/litellm/llms/anthropic/chat/transformation.py b/litellm/llms/anthropic/chat/transformation.pyindex 9aaaa39fd7a..2c5d7901ba2 100644--- a/litellm/llms/anthropic/chat/transformation.py+++ b/litellm/llms/anthropic/chat/transformation.py@@ -1587,17 +1587,6 @@ class AnthropicConfig(AnthropicModelInfo, BaseConfig):filtered_tools = [t for i, t in enumerate(tool_calls) if i not in json_indices]return None, filtered_tools, extra_content- def _transform_response_for_json_mode(- self,- json_mode: Optional[bool],- tool_calls: List[ChatCompletionToolCallChunk],- ) -> Optional[LitellmMessage]:- replacement, _, _ = self._resolve_json_mode_non_streaming(- json_mode=json_mode,- tool_calls=tool_calls,- )- return replacement-def extract_response_content(self, completion_response: dict) -> Tuple[str,Optional[List[Any]],diff --git a/tests/llm_translation/test_anthropic_completion.py b/tests/llm_translation/test_anthropic_completion.pyindex fdf8c24ac9e..7b2b6bed6a4 100644--- a/tests/llm_translation/test_anthropic_completion.py+++ b/tests/llm_translation/test_anthropic_completion.py@@ -870,7 +870,7 @@ from litellm.constants import RESPONSE_FORMAT_TOOL_NAMEdef test_anthropic_json_mode_and_tool_call_response(json_mode, tool_calls, expect_null_response):- result = litellm.AnthropicConfig()._transform_response_for_json_mode(+ result, _, _ = litellm.AnthropicConfig()._resolve_json_mode_non_streaming(json_mode=json_mode,tool_calls=tool_calls,)