mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-29 01:42:19 +00:00
fix(adapter): preserve empty thinking field shape
This commit is contained in:
parent
29126ea4de
commit
6132d8d369
1 changed files with 3 additions and 0 deletions
|
|
@ -635,6 +635,9 @@ class LiteLLMAnthropicMessagesAdapter:
|
|||
)
|
||||
):
|
||||
assistant_message["thinking_blocks"] = thinking_blocks
|
||||
elif len(thinking_blocks) == 0:
|
||||
# Preserve the existing response shape for ordinary assistant turns.
|
||||
assistant_message["thinking_blocks"] = None
|
||||
reasoning_content = reasoning_content_from_thinking_blocks(thinking_blocks)
|
||||
if reasoning_content:
|
||||
assistant_message["reasoning_content"] = reasoning_content
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue