mirror of
https://github.com/BerriAI/litellm.git
synced 2026-11-30 01:08:33 +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> |
||
|---|---|---|
| .. | ||
| count_tokens | ||
| __init__.py | ||
| test_openai_count_tokens_transformation.py | ||
| test_openai_responses_data_residency.py | ||
| test_openai_responses_guardrail_handler.py | ||
| test_openai_responses_guardrail_tool_merge.py | ||
| test_openai_responses_http.py | ||
| test_openai_responses_transformation.py | ||