From 27828f44b9e543aff92bceb3f4bc2ffea6d121f5 Mon Sep 17 00:00:00 2001 From: Yeuoly <45712896+Yeuoly@users.noreply.github.com> Date: Wed, 24 Jan 2024 00:13:04 +0800 Subject: [PATCH] Fix/assistant none type (#2145) --- api/core/file/message_file_parser.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/api/core/file/message_file_parser.py b/api/core/file/message_file_parser.py index e70a68e70b..1f35bb245d 100644 --- a/api/core/file/message_file_parser.py +++ b/api/core/file/message_file_parser.py @@ -128,8 +128,9 @@ class MessageFileParser: # group by file type and convert file args or message files to FileObj for file in files: - if file.belongs_to == FileBelongsTo.ASSISTANT.value: - continue + if isinstance(file, MessageFile): + if file.belongs_to == FileBelongsTo.ASSISTANT.value: + continue file_obj = self._to_file_obj(file, file_upload_config) if file_obj.type not in type_file_objs: