Commit 1408a84
authored
perf: Set content to None when the OpenAI message content list is empty (#6551)
_finally_convert_payload 提取 think 部分后,如果 assistant 消息的
所有 content 都是 think 类型,new_content 会变成空列表 []。
Grok 等 provider 不接受空 content list,直接报 400。
改为 new_content or None,空列表时回退到 None(OpenAI 兼容 API
普遍接受 null content 的 assistant 消息)。
Fixes #6447
Co-authored-by: Yufeng He <40085740+universeplayer@users.noreply.github.com>1 parent 8f95ca9 commit 1408a84
1 file changed
+3
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
877 | 877 | | |
878 | 878 | | |
879 | 879 | | |
880 | | - | |
881 | | - | |
| 880 | + | |
| 881 | + | |
| 882 | + | |
882 | 883 | | |
883 | 884 | | |
884 | 885 | | |
| |||
0 commit comments