chore: LOCAL_FILE also try to use remote_url as Prompt message (#11443)

This commit is contained in:
非法操作 2024-12-10 10:56:49 +08:00 committed by GitHub
parent bdd5869244
commit 9e23c3d625
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -141,7 +141,7 @@ def _to_url(f: File, /):
elif f.transfer_method == FileTransferMethod.LOCAL_FILE:
if f.related_id is None:
raise ValueError("Missing file related_id")
return helpers.get_signed_file_url(upload_file_id=f.related_id)
return f.remote_url or helpers.get_signed_file_url(upload_file_id=f.related_id)
elif f.transfer_method == FileTransferMethod.TOOL_FILE:
# add sign url
if f.related_id is None or f.extension is None: