From 6d35fc408c31f9e1dce02759284a6a53a015955b Mon Sep 17 00:00:00 2001 From: Dong_master <2213070223@qq.com> Date: Tue, 12 Aug 2025 11:15:17 +0800 Subject: [PATCH] fix: some time in the anthropicmsgs.py mesg_dcit["content"] is str can not append --- pkg/provider/modelmgr/requesters/anthropicmsgs.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/provider/modelmgr/requesters/anthropicmsgs.py b/pkg/provider/modelmgr/requesters/anthropicmsgs.py index 6651f186..e9adf390 100644 --- a/pkg/provider/modelmgr/requesters/anthropicmsgs.py +++ b/pkg/provider/modelmgr/requesters/anthropicmsgs.py @@ -259,7 +259,8 @@ class AnthropicMessages(requester.ProviderAPIRequester): }, } msg_dict['content'][i] = alter_image_ele - + if isinstance(msg_dict['content'], str) and msg_dict['content'] == '': + msg_dict['content'] = [] # 这里不知道为什么会莫名有个空导致content为字符 if m.tool_calls: for tool_call in m.tool_calls: msg_dict['content'].append(