mirror of
https://github.com/BerriAI/litellm.git
synced 2026-12-02 01:28:38 +00:00
* fix(bedrock): send Converse extra_body fields instead of a literal extra_body object Bedrock Converse got the whole extra_body object as one additionalModelRequestFields entry and answered 400 "Unknown parameter: 'extra_body'", with or without drop_params. The fields inside extra_body are now merged into the request params the same way top-level fields are, with extra_body winning a name clash. A non-object extra_body is dropped under drop_params and answers 400 without it. * fix(bedrock): merge Converse extra_body before the tool and guardrail checks Tools or guardrailConfig sent only inside extra_body are now seen by the orphaned tool block and guarded text checks, and an extra_body output_config gets the same effort cap as a top-level one. The merge builds a new dict, so the caller's params keep neither the fields nor the internal marker * fix(bedrock): keep LiteLLM's own Converse keys out of extra_body and drop routing keys The extra_body merge stays in the Converse transform, after the handler has read stream, the AWS keys, endpoint and region from the top level, so extra_body can no longer change how LiteLLM sends the call. The Converse branch in completion() removes the deployment's additional_drop_params keys from extra_body before every attempt, the native output retry included, and the transform also removes model. Strict tools inside extra_body get the retry without strict, and tool calls written as text are parsed against the extra_body tools. Adds regression tests for each. * fix(bedrock): key extra_body in the response cache, bill its service tier, and reject malformed tools and config blocks * fix(bedrock): keep cost on the served-tier path instead of reading extra_body * fix(bedrock): bill a streamed Converse call at the tier its metadata event reports Bedrock ConverseStream sends no service tier header. It reports the served tier only in the final metadata event, which arrives after the finish chunk, so the stream wrapper dropped it and a streamed priority call billed at the standard rate. The Converse stream parser now reads serviceTier from the metadata event, and the usage chunk the stream wrapper builds after the finish chunk keeps the upstream chunk's service_tier, which is the chunk cost tracking reads. Every other chunk is built as before. * fix(streaming): drop a usage-stripped chunk that carries only service_tier * fix(bedrock): pass a pre-formatted Bedrock tool block through as the caller sent it Validating a systemTool block against the typed ToolBlock dropped any key the type does not list, so the block now goes to Bedrock unchanged, as it did before this branch * fix(bedrock): keep the response_format tool when extra_body tools is null * fix(bedrock): keep top-level tools when extra_body has no tools key A missing extra_body.tools no longer replaces the caller's top-level tools with only the response_format tool. Only an explicit tools key in extra_body, null included, takes over the tools list * fix(bedrock): treat a null extra_body tools as no tools and honor a string drop_params |
||
|---|---|---|
| .. | ||
| batches | ||
| chat | ||
| count_tokens | ||
| embed | ||
| files | ||
| image | ||
| image_edit | ||
| image_generation | ||
| invoke_agent | ||
| messages | ||
| passthrough | ||
| realtime | ||
| rerank | ||
| responses | ||
| search | ||
| vector_stores | ||
| __init__.py | ||
| event_loop_probe.py | ||
| slow_upstream.py | ||
| test_anthropic_beta_support.py | ||
| test_base_aws_llm.py | ||
| test_bedrock_common_utils.py | ||
| test_bedrock_model_listing.py | ||
| test_bedrock_ssl_verify.py | ||
| test_claude_platform_provider.py | ||
| test_converse_context_management.py | ||
| test_cost_calculation.py | ||
| test_cross_region_inference_profile_mapping.py | ||
| test_guardrail_attachments.py | ||
| test_mantle.py | ||
| test_nova_imported_models.py | ||
| test_request_metadata.py | ||
| test_session_identity.py | ||
| test_web_identity_session_policy.py | ||