mirror of
https://github.com/BerriAI/litellm.git
synced 2026-12-03 01:38:46 +00:00
* fix(responses): keep tool_reference blocks in function call outputs The Responses to Chat bridge turned reference-only tool outputs into a JSON string and dropped references that sat next to text, so Claude never saw tools loaded through defer_loading. The bridge now keeps each valid reference in order. Guardrail text extraction keeps its existing JSON fallback, and malformed or unknown parts fall back as before. Fixes #46681 * fix(responses): keep tool references only on Anthropic routes Keeping tool_reference blocks for every bridge route turned the JSON text that OpenAI and Vertex Gemini received into empty content. The flag now defaults to off and is set from provider_builds_anthropic_request at the request send site and in previous_response_id history replay, so inspection callers and non-Anthropic routes keep their existing serialization. The reference check moves into a small part decoder so the normalizer's complexity is unchanged. * fix(responses): skip tool references when the route does not resolve Checking the route with provider_builds_anthropic_request raised BadRequestError for model aliases with no resolvable provider, such as batch aliases. Both send sites now use the bridge's existing non-raising _resolved_chat_config, so an unresolved alias keeps its existing tool output serialization on the first turn and on previous_response_id replay. --------- Co-authored-by: Joshua Valluru <326636767+joshua-berri@users.noreply.github.com> |
||
|---|---|---|
| .. | ||
| __init__.py | ||
| test_anthropic_responses_bridge.py | ||
| test_client_tool_search.py | ||
| test_compaction_items.py | ||
| test_count_request.py | ||
| test_function_call_output_normalization.py | ||
| test_google_ai_studio_responses_bridge.py | ||
| test_google_ai_studio_responses_wire.py | ||
| test_handler.py | ||
| test_image_generation_output.py | ||
| test_litellm_completion_responses.py | ||
| test_reasoning_input_item_preservation.py | ||
| test_reasoning_items.py | ||
| test_session_handler.py | ||
| test_session_handler_with_cold_storage.py | ||
| test_streaming_iterator_transformation.py | ||
| test_tool_output_order_preserved_for_gemini.py | ||