From c8dacd74a9292e1493a6c0ffed254abc5d49dbde Mon Sep 17 00:00:00 2001 From: rahul dhanawade Date: Wed, 18 Feb 2026 03:13:26 +0530 Subject: [PATCH] fix(vertex_ai/anthropic): map output_config to response_schema for structured outputs --- .../anthropic/transformation.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/litellm/llms/vertex_ai/vertex_ai_partner_models/anthropic/transformation.py b/litellm/llms/vertex_ai/vertex_ai_partner_models/anthropic/transformation.py index 6a5b934661a..d9605385293 100644 --- a/litellm/llms/vertex_ai/vertex_ai_partner_models/anthropic/transformation.py +++ b/litellm/llms/vertex_ai/vertex_ai_partner_models/anthropic/transformation.py @@ -108,6 +108,19 @@ class VertexAIAnthropicConfig(AnthropicConfig): # VertexAI doesn't support output_format parameter, remove it if present data.pop("output_format", None) + # VertexAI doesn't support output_config parameter, remove it if present + if "output_config" in data: + output_config = data.pop("output_config") + if isinstance(output_config, dict): + # Extract the schema from Anthropic format: + # {"format": {"type": "json_schema", "schema": {...}}} + format_obj = output_config.get("format", {}) + if format_obj.get("type") == "json_schema": + schema = format_obj.get("schema") + if schema: + # Map to Vertex AI's GA parameter: response_schema + data["response_schema"] = schema + tools = optional_params.get("tools") tool_search_used = self.is_tool_search_used(tools) auto_betas = self.get_anthropic_beta_list(