From 023281ae56f61961fe9ee25b02e3e4545a6bd435 Mon Sep 17 00:00:00 2001 From: Junyan Qin Date: Sat, 31 Jan 2026 13:51:17 +0800 Subject: [PATCH] fix: ensure content extraction from messages includes only valid text entries --- .../pkg/provider/modelmgr/requesters/deepseekchatcmpl.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/langbot/pkg/provider/modelmgr/requesters/deepseekchatcmpl.py b/src/langbot/pkg/provider/modelmgr/requesters/deepseekchatcmpl.py index 1b846161..5bcbd40c 100644 --- a/src/langbot/pkg/provider/modelmgr/requesters/deepseekchatcmpl.py +++ b/src/langbot/pkg/provider/modelmgr/requesters/deepseekchatcmpl.py @@ -43,7 +43,7 @@ class DeepseekChatCompletions(chatcmpl.OpenAIChatCompletions): # deepseek 不支持多模态,把content都转换成纯文字 for m in messages: if 'content' in m and isinstance(m['content'], list): - m['content'] = ' '.join([c['text'] for c in m['content']]) + m['content'] = ' '.join([c['text'] for c in m['content'] if 'text' in c]) args['messages'] = messages