Skip to content

armgit / dify

Public Imported from GitHub
0

Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.

Fix/assistant none type (#2145)

Yeuoly27828f44b9e5
diff --git a/api/core/file/message_file_parser.py b/api/core/file/message_file_parser.py
index e70a68e70b5..1f35bb245d0 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: