mirror of
https://github.com/BerriAI/litellm.git
synced 2026-11-17 09:34:48 +00:00
* fix(anthropic): close /v1/messages thinking blocks with a signature and keep bridged output * fix(anthropic): close rebuilt-stream thinking blocks with a signature_delta * fix(anthropic): drop unsigned thinking before Claude, stream raw reasoning_text, close rebuilt thinking blocks with signature_delta A Claude target on /v1/messages now gets unsigned thinking blocks left out of the request, so a switch from a reasoning_content model makes one call and keeps thinking, except when that would leave the final tool turn without its opening thinking block Raw response.reasoning_text deltas from the Responses bridge stream as thinking, and a stream rebuilt from a full answer or rewritten by a guardrail closes each thinking block with a signature_delta, the real signature or an empty string * fix(anthropic): stream a whole reasoning item as a closed thinking block A Responses stream can send a reasoning item whole in output_item.added and output_item.done with no text deltas, as litellm's own stream does for gpt-oss on OpenRouter. The /v1/messages stream now builds that item's thinking block with the same helper the non-streamed response uses, so streamed and non-streamed answers carry the same reasoning * test(anthropic): mark the new streaming test locals Final * fix(anthropic): drop unsigned thinking before every Claude call, a pending tool turn included Anthropic answers 400 to a thinking block with an empty signature but accepts a tool turn with no thinking, so the strip no longer keeps the block that opens the pending tool turn. The check now looks for "claude" in the model name, which covers Claude behind every messages route and the chat adapter, not only four providers * fix(anthropic): strip unsigned thinking when a deployment's base_model names Claude * fix(anthropic): drop unsigned thinking for an alias whose base_model names Claude on the native messages path The chat adapter already read base_model before leaving unsigned thinking out of a Claude request. The native messages transform and the Rust request transform now read it too, so an aliased Claude deployment gets one call instead of a 400 and a retry * test(anthropic): build the pending tool turn without mutating it in the Rust strip test The Rust test now builds its expected messages from the same helper instead of editing them afterward, and a doc comment that only restated a helper's name is gone --------- Co-authored-by: mateo-berri <277851410+mateo-berri@users.noreply.github.com> |
||
|---|---|---|
| .. | ||
| agent | ||
| chat | ||
| decisions | ||
| messages | ||
| responses | ||
| __init__.py | ||
| test_databricks_common_utils.py | ||
| test_databricks_cost_calculator.py | ||
| test_databricks_partner_integration.py | ||
| test_databricks_streaming_utils.py | ||