mirror of
https://github.com/langgenius/dify.git
synced 2024-11-16 11:42:29 +08:00
fix(api): handle missing upload_file_id for tool_file messages (#9756)
This commit is contained in:
parent
95dc90e6b2
commit
2c26f77a25
|
@ -977,6 +977,9 @@ class Message(db.Model):
|
|||
config=FileExtraConfig(),
|
||||
)
|
||||
elif message_file.transfer_method == "tool_file":
|
||||
if message_file.upload_file_id is None:
|
||||
assert message_file.url is not None
|
||||
message_file.upload_file_id = message_file.url.split("/")[-1].split(".")[0]
|
||||
mapping = {
|
||||
"id": message_file.id,
|
||||
"type": message_file.type,
|
||||
|
@ -1001,6 +1004,7 @@ class Message(db.Model):
|
|||
for (file, message_file) in zip(files, message_files)
|
||||
]
|
||||
|
||||
db.session.commit()
|
||||
return result
|
||||
|
||||
@property
|
||||
|
|
Loading…
Reference in New Issue
Block a user