litellm/tests/pass_through_unit_tests
Sameer Kankute 1d9095f914
fix(bedrock): support tool search results + chat annotations (#29120)
* Fix overiding of fastapi_response headers

* fix(bedrock): support tool search results and surface citations as annotations

Add an optional tool-message search_results path that maps directly to Bedrock toolResult.searchResult blocks, and convert Converse citationsContent into chat completion annotations for user-facing citation metadata.

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix(format): align bedrock prompt factory with black

Reformat the updated bedrock prompt template conversion file so CI black --check passes.

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix(bedrock): harden citations, search_results mapping, and token counting

Resolve mypy issues in citation parsing, only attach url_citation annotations when citation text is stitched into content, fall back to tool content when search_results is empty, and count search_results text in token/TPM preflight paths.

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix(bedrock): extract tool result helpers to satisfy PLR0915

Refactor _convert_to_bedrock_tool_call_result into smaller helpers so lint passes without changing Bedrock tool result behavior.

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix(bedrock): count all forwarded search_results fields in token estimates

Include source, title, content text, and citations when estimating tokens so large metadata cannot bypass TPM preflight checks. Reformat factory.py with black.

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix(managed-files): skip content blocks without a type key in get_file_ids_from_messages

* fix(bedrock): stitch citations for any punctuation-only text block

* fix(bedrock): map null citation source/title to empty annotation strings

* fix(bedrock): advance citation offset for text-only citationsContent blocks

* fix(bedrock): complete citation TypedDicts for grounding annotations

---------

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: mateo-berri <277851410+mateo-berri@users.noreply.github.com>
2026-05-29 20:48:36 -07:00
..
messages_api_structured_output style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
base_anthropic_messages_prompt_caching_test.py fix(tests): use Sonnet 4.5 for Bedrock invoke prompt-caching tests 2026-04-28 14:51:47 -07:00
base_anthropic_messages_tool_search_test.py chore(ci): modernize model references in tests and configs (#27856) 2026-05-15 15:44:28 -07:00
base_anthropic_unified_messages_test.py style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
conftest.py fix(tests): stabilize image-edit VCR cassettes to stop live gpt-image-1 spend (#28110) 2026-05-18 09:15:39 -07:00
test_anthropic_messages_passthrough.py chore(ci): modernize model references in tests and configs (#27856) 2026-05-15 15:44:28 -07:00
test_anthropic_messages_prompt_caching.py fix(tests): use Sonnet 4.5 for Bedrock invoke prompt-caching tests 2026-04-28 14:51:47 -07:00
test_anthropic_messages_tool_search.py chore(ci): modernize model references in tests and configs (#27856) 2026-05-15 15:44:28 -07:00
test_assemblyai_unit_tests_passthrough.py fix: block path traversal SSRF in BitBucket, Arize Phoenix, and AssemblyAI clients (#26943) 2026-05-01 11:45:12 -07:00
test_bedrock_anthropic_messages_test.py chore(ci): modernize model references in tests and configs (#27856) 2026-05-15 15:44:28 -07:00
test_bedrock_tool_use_beta_header.py style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
test_claude_code_marketplace.py style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
test_custom_logger_passthrough.py chore(ci): modernize model references in tests and configs (#27856) 2026-05-15 15:44:28 -07:00
test_pass_through_unit_tests.py fix(bedrock): support tool search results + chat annotations (#29120) 2026-05-29 20:48:36 -07:00
test_passthrough_registry_updates.py Fix passthrough tests 2026-02-20 17:28:06 -08:00
test_unit_test_anthropic_pass_through.py chore(ci): modernize model references in tests and configs (#27856) 2026-05-15 15:44:28 -07:00
test_unit_test_passthrough_router.py test_get_credentials_from_env 2026-03-30 16:02:14 -07:00
test_unit_test_streaming.py style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
test_vertex_ai_anthropic_streaming_cost_injection.py style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
test_vertex_ai_live_passthrough.py style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
test_websearch_interception_e2e.py style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00