Fix output config error

This commit is contained in:
Sameer Kankute 2026-03-07 00:36:22 +05:30
parent 273932c923
commit 814e36353b
2 changed files with 17 additions and 2 deletions

View file

@ -163,7 +163,10 @@ class LiteLLMMessagesToCompletionTransformationHandler:
"include_usage": True,
}
excluded_keys = {"anthropic_messages"}
excluded_keys = {
"anthropic_messages",
"output_config", # Anthropic-only; OpenAI does not support it
}
extra_kwargs = extra_kwargs or {}
for key, value in extra_kwargs.items():
if (

View file

@ -296,8 +296,20 @@ class LiteLLMAnthropicMessagesAdapter:
def translatable_anthropic_params(self) -> List:
"""
Which anthropic params, we need to translate to the openai format.
Params in this list are either translated or dropped when targeting OpenAI.
Anthropic-only params like output_config are included here to be dropped
(OpenAI does not support them).
"""
return ["messages", "metadata", "system", "tool_choice", "tools", "thinking", "output_format"]
return [
"messages",
"metadata",
"system",
"tool_choice",
"tools",
"thinking",
"output_format",
"output_config", # Anthropic-only; drop when targeting OpenAI
]
def _is_web_search_tool(self, tool: Dict[str, Any]) -> bool:
"""