mirror of
https://github.com/tiennm99/litellm.git
synced 2026-07-07 21:14:01 +00:00
84934a7258
* fix(anthropic): filter unsupported JSON schema constraints for structured outputs Fixes 400 error when using Anthropic models with structured outputs that have min/max constraints. The Anthropic API doesn't support these JSON schema constraints: - minimum/maximum (numeric) - exclusiveMinimum/exclusiveMaximum (numeric) - minLength/maxLength (string) - minItems/maxItems (array) This mirrors the transformation done by the official Anthropic Python SDK. See: https://platform.claude.com/docs/en/build-with-claude/structured-outputs#how-sdk-transformation-works Adds tests for the schema filtering function. * fix: update descriptions with removed constraint info in filter_anthropic_output_schema Address review feedback: the function now appends removed constraint information to the description field (matching Anthropic SDK behavior), rather than silently dropping constraints. --------- Co-authored-by: OpenClaw <openclaw@users.noreply.github.com>