litellm/tests/test_litellm/llms/bedrock/chat
Julio Quinteros Pro fcabf9b602 fix(bedrock): filter internal json_tool_call when mixed with real tools
Fixes #18381: When using both tools and response_format with Bedrock
Converse API, LiteLLM internally adds json_tool_call to handle structured
output. Bedrock may return both this internal tool AND real user-defined
tools, breaking consumers like OpenAI Agents SDK.

Changes:
- Non-streaming: Added _filter_json_mode_tools() to handle 3 scenarios:
  only json_tool_call (convert to content), mixed (filter it out), or
  no json_tool_call (pass through)
- Streaming: Added json_mode tracking to AWSEventStreamDecoder to suppress
  json_tool_call chunks and convert to text content
- Fixed optional_params.pop() mutation issue

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-28 00:18:56 -03:00
..
agentcore fix(bedrock): add Accept header for AgentCore MCP server requests (#21551) 2026-02-19 11:35:14 -08:00
invoke_transformations Update code to handle anthropic beta headers mapping 2026-02-11 12:35:22 +05:30
test_converse_transformation.py fix(bedrock): filter internal json_tool_call when mixed with real tools 2026-02-28 00:18:56 -03:00
test_converse_transformation_nova_2.py feat(bedrock): broaden Nova 2 model detection to support nova-2-pro reasoning 2026-02-16 20:35:00 -08:00
test_invoke_handler.py fix(bedrock): Ensure consistent chunk IDs in Bedrock streaming responses (#16596) 2025-11-18 20:37:21 -08:00
test_mistral_config.py Litellm fix GitHub action testing (#11163) 2025-05-26 14:41:42 -07:00
test_service_tier.py feat(bedrock): add OpenAI-compatible service_tier parameter translation (#18091) 2026-01-12 17:28:49 +05:30
test_streaming_choice_index.py fix(bedrock): correct streaming choice index for tool calls (#19506) 2026-01-21 20:57:14 -08:00
test_writer_palmyra.py [Feat] New model - add bedrock writer models (#17685) 2025-12-08 17:49:06 -08:00