fix: tool file id

This commit is contained in:
Yeuoly 2024-11-29 14:09:34 +08:00
parent 8c5928da2f
commit 687455ca31
No known key found for this signature in database
GPG Key ID: A66E7E320FB19F61

View File

@ -196,6 +196,8 @@ class ToolNode(BaseNode[ToolNodeData]):
else: else:
transfer_method = FileTransferMethod.TOOL_FILE transfer_method = FileTransferMethod.TOOL_FILE
tool_file_id = str(url).split("/")[-1].split(".")[0]
with Session(db.engine) as session: with Session(db.engine) as session:
stmt = select(ToolFile).where(ToolFile.id == tool_file_id) stmt = select(ToolFile).where(ToolFile.id == tool_file_id)
tool_file = session.scalar(stmt) tool_file = session.scalar(stmt)