mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-03 02:22:24 +00:00
fix(bedrock): pop None context_management before sending to Bedrock Converse
If context_management is forwarded as None (e.g. when mapping returns None for an invalid format), _filter_context_management_for_bedrock_converse previously returned early without removing the key, leaving "context_management": null in the request and causing a validation error. Pop the key when the value is not a dict. Co-authored-by: Yassin Kortam <yassin@berri.ai>
This commit is contained in:
parent
76ca5ca424
commit
88639d221f
1 changed files with 1 additions and 0 deletions
|
|
@ -1460,6 +1460,7 @@ class AmazonConverseConfig(BaseConfig):
|
|||
"""Keep only compact_20260112 edits for Bedrock; add beta header or drop field."""
|
||||
cm = additional_request_params.get("context_management")
|
||||
if not isinstance(cm, dict):
|
||||
additional_request_params.pop("context_management", None)
|
||||
return
|
||||
edits = cm.get("edits")
|
||||
if not isinstance(edits, list):
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue