mirror of
https://github.com/BerriAI/litellm.git
synced 2026-11-28 00:00:38 +00:00
* fix(bedrock_mantle): drop the JSON Schema keywords gemma-4 rejects from tool and response schemas * fix(bedrock_mantle): read gemma-4 schema keyword support from the cost map and clean extra_body schemas Mantle models whose cost-map entry sets supports_all_json_schema_keywords to false get the refused keywords dropped, a deployment's model_info flag wins, and schemas sent through extra_body on chat and Responses get the same drop * fix(bedrock_mantle): keep not subschemas and fall back to the gemma-4 name check when the cost map lacks the flag Dropping a keyword under not forbids values the caller allowed, and Mantle accepts these keywords there. A cost map without supports_all_json_schema_keywords, such as the remote map before this change ships, now still drops the keywords for gemma-4. The flag is also set on the regional gemma-4 rows, and the drop path logs one debug line * fix(bedrock_mantle): keep min/maxProperties for gemma-4, walk components schemas and read the request region's cost-map row gemma-4 accepts minProperties and maxProperties, so only the other 17 keywords are dropped. Root components.schemas entries are walked too, since a #/components/schemas ref reaches them. The supports_all_json_schema_keywords lookup reads the row for the region the request goes to first, then the row without a region, then the gemma-4 name fallback. * fix(bedrock_mantle): drop min/maxProperties again and read the cost-map row for the region each route sends to * fix(bedrock_mantle): stop the gemma-4 keyword drop from tightening a ref inside not Once a gemma-4 schema loses a refused keyword, a not with a $ref, $dynamicRef or $recursiveRef key anywhere under it is dropped whole, since its target may have lost a keyword and the not would then forbid values the caller allowed. The rebuild no longer walks into not subtrees, which it kept as sent anyway, so the cost stays linear. A warning names the model when a keyword was dropped --------- Co-authored-by: mateo-berri <277851410+mateo-berri@users.noreply.github.com> |
||
|---|---|---|
| .. | ||
| chat | ||
| passthrough | ||
| __init__.py | ||
| test_bedrock_mantle_messages_transformation.py | ||
| test_bedrock_mantle_responses_transformation.py | ||
| test_bedrock_mantle_transformation.py | ||