fix(adapter): preserve empty thinking field shape

This commit is contained in:
adhavan18 2026-09-24 14:14:38 +05:30
parent 29126ea4de
commit 6132d8d369

View file

@ -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