fix: omit empty content in assistant messages
This commit is contained in:
parent
80d1ff69ad
commit
1db05c881d
@ -227,10 +227,8 @@ To recall past events, grep {workspace_path}/memory/HISTORY.md"""
|
|||||||
"""
|
"""
|
||||||
msg: dict[str, Any] = {"role": "assistant"}
|
msg: dict[str, Any] = {"role": "assistant"}
|
||||||
|
|
||||||
# Only include the content key when there is non-empty text.
|
# Omit empty content — some backends reject empty text blocks
|
||||||
# Some LLM backends reject empty text blocks, so omit the key
|
if content:
|
||||||
# to avoid sending empty content entries.
|
|
||||||
if content is not None and content != "":
|
|
||||||
msg["content"] = content
|
msg["content"] = content
|
||||||
|
|
||||||
if tool_calls:
|
if tool_calls:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user