1
1
import logging
2
2
from collections .abc import Mapping , Sequence
3
- from mimetypes import guess_extension
4
- from os import path
5
3
from typing import Any
6
4
7
5
from configs import dify_config
8
- from core .file import File , FileTransferMethod , FileType
6
+ from core .file import File , FileTransferMethod
9
7
from core .tools .tool_file_manager import ToolFileManager
10
8
from core .workflow .entities .node_entities import NodeRunResult
11
9
from core .workflow .entities .variable_entities import VariableSelector
@@ -150,11 +148,6 @@ def extract_files(self, url: str, response: Response) -> list[File]:
150
148
content = response .content
151
149
152
150
if is_file and content_type :
153
- # extract filename from url
154
- filename = path .basename (url )
155
- # extract extension if possible
156
- extension = guess_extension (content_type ) or ".bin"
157
-
158
151
tool_file = ToolFileManager .create_file_by_raw (
159
152
user_id = self .user_id ,
160
153
tenant_id = self .tenant_id ,
@@ -165,7 +158,6 @@ def extract_files(self, url: str, response: Response) -> list[File]:
165
158
166
159
mapping = {
167
160
"tool_file_id" : tool_file .id ,
168
- "type" : FileType .IMAGE .value ,
169
161
"transfer_method" : FileTransferMethod .TOOL_FILE .value ,
170
162
}
171
163
file = file_factory .build_from_mapping (
0 commit comments