mirror of
https://github.com/BerriAI/litellm.git
synced 2026-11-30 01:08:33 +00:00
* test(anthropic): stream /v1/messages tool arguments sent only in done events * fix(anthropic): stream /v1/messages tool arguments that only arrive in done events OpenAI can send a function call's arguments only in response.function_call_arguments.done and response.output_item.done, with no delta events. The /v1/messages Responses adapter only forwarded deltas, so Anthropic clients got tool_use blocks with empty input. Emit the complete arguments once when no delta carried them. * fix(anthropic): track streamed tool input per content block A delta with a missing or unknown item id lands on the current block, so tracking by item id could send the arguments again at output_item.done. Track the block instead, and settle it when the block closes. * test(anthropic): require tool input before its block closes * fix(anthropic): read stream event fields through the typed field helper Reading the event type with isinstance(event, dict) left event as an untyped dict for the rest of the handler, so new calls added unknown argument types. Use the existing _field helper for the event type and the done item's id instead. * fix(anthropic): bill /v1/messages done-only tool arguments on disconnect The disconnect bill counts relayed text and argument deltas. Tool arguments that only arrived in done events are now relayed on /v1/messages too, so record them with the upstream Responses stream when they are sent. /v1/responses is unchanged since nothing else records them. |
||
|---|---|---|
| .. | ||
| batches | ||
| chat | ||
| files | ||
| messages | ||
| pass_through | ||
| __init__.py | ||
| anthropic_docs_refusal.py | ||
| test_anthropic_common_utils.py | ||
| test_anthropic_count_tokens_transformation.py | ||
| test_anthropic_files_and_batches.py | ||
| test_anthropic_output_format_filter.py | ||
| test_anthropic_prompt_cache_prediction.py | ||
| test_anthropic_prompt_cache_pricing.py | ||
| test_anthropic_reasoning_effort.py | ||
| test_anthropic_schema_filter.py | ||
| test_anthropic_structured_output.py | ||
| test_anthropic_wif.py | ||
| test_azure_ai_cache_pricing.py | ||
| test_cost_calculation_dict_safety.py | ||
| test_count_tokens_oauth.py | ||
| test_message_sanitization.py | ||
| test_messages_http_error_retry_cases.py | ||