mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-17 23:51:30 +00:00
fix(vertex_ai/anthropic): map output_config to response_schema for structured outputs
This commit is contained in:
parent
4930babace
commit
c8dacd74a9
1 changed files with 13 additions and 0 deletions
|
|
@ -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(
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue