fix(bedrock): restore parallel_tool_calls mapping in map_openai_params#22333
Merged
fix(bedrock): restore parallel_tool_calls mapping in map_openai_params#22333
Conversation
…ion behavior Tests were asserting no response.create/conversation.item.create sent to backend when guardrail blocks, but the implementation intentionally sends these to have the LLM voice the guardrail violation message to the user. Updated assertions to verify the correct guardrail flow: - response.cancel is sent to stop any in-progress response - conversation.item.create with violation message is injected - response.create is sent to voice the violation - original blocked content is NOT forwarded Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The revert in 8565c70 removed the parallel_tool_calls handling from map_openai_params, and the subsequent fix d0445e1 only re-added the transform_request consumption but forgot to re-add the map_openai_params producer that sets _parallel_tool_use_config. This meant parallel_tool_calls was silently ignored for all Bedrock models. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
Greptile SummaryThis PR restores the
Confidence Score: 5/5
|
| Filename | Overview |
|---|---|
| litellm/llms/bedrock/chat/converse_transformation.py | Restores parallel_tool_calls to supported params list and adds the map_openai_params handler that converts it to _parallel_tool_use_config. Clean, correct fix that matches the existing pattern used by other param handlers in the same method. |
| tests/test_litellm/litellm_core_utils/test_realtime_streaming.py | Updates realtime guardrail test assertions to match new behavior where guardrails inject violation messages (response.cancel + conversation.item.create + response.create) instead of simply blocking. All tests use mocks, no network calls. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A["User passes parallel_tool_calls=False"] --> B["get_supported_openai_params"]
B -->|"'parallel_tool_calls' in list"| C["map_openai_params"]
C -->|"Sets _parallel_tool_use_config"| D["optional_params"]
D --> E["transform_request"]
E --> F{"is_claude_4_5_on_bedrock?"}
F -->|Yes| G["Merge into additionalModelRequestFields\n(disable_parallel_tool_use: true)"]
F -->|No| H["Drop _parallel_tool_use_config\n(older models don't support it)"]
G --> I["Send to Bedrock API"]
H --> I
Last reviewed commit: aa899b5
2 tasks
Contributor
Author
|
@shin-bot-litellm evaluate this PR |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
8565c70e53removedparallel_tool_callshandling frommap_openai_paramsd0445e1e33only re-added thetransform_requestconsumption (withis_claude_4_5_on_bedrockguard) but forgot to re-add themap_openai_paramsproducer that sets_parallel_tool_use_configparallel_tool_calls=Falsewas silently ignored for all Bedrock modelsmap_openai_paramshandlerTest plan
test_parallel_tool_calls_newer_model_adds_disable_flagpassestest_parallel_tool_calls_older_model_drops_disable_flagpasses🤖 Generated with Claude Code