mirror of
https://github.com/HKUDS/nanobot.git
synced 2026-05-09 03:06:04 +00:00
fix(utils): ensure reasoning_content present with thinking_blocks (#2579)
This commit is contained in:
parent
3f21e83af8
commit
929ee09499
@ -124,8 +124,8 @@ def build_assistant_message(
|
|||||||
msg: dict[str, Any] = {"role": "assistant", "content": content}
|
msg: dict[str, Any] = {"role": "assistant", "content": content}
|
||||||
if tool_calls:
|
if tool_calls:
|
||||||
msg["tool_calls"] = tool_calls
|
msg["tool_calls"] = tool_calls
|
||||||
if reasoning_content is not None:
|
if reasoning_content is not None or thinking_blocks:
|
||||||
msg["reasoning_content"] = reasoning_content
|
msg["reasoning_content"] = reasoning_content if reasoning_content is not None else ""
|
||||||
if thinking_blocks:
|
if thinking_blocks:
|
||||||
msg["thinking_blocks"] = thinking_blocks
|
msg["thinking_blocks"] = thinking_blocks
|
||||||
return msg
|
return msg
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user