mirror of
https://github.com/langgenius/dify.git
synced 2024-11-15 19:22:36 +08:00
feat(document_extractor): support tool file in document extractor (#10217)
This commit is contained in:
parent
9305ad2102
commit
2c4d8dbe9b
|
@ -198,10 +198,8 @@ def _download_file_content(file: File) -> bytes:
|
|||
response = ssrf_proxy.get(file.remote_url)
|
||||
response.raise_for_status()
|
||||
return response.content
|
||||
elif file.transfer_method == FileTransferMethod.LOCAL_FILE:
|
||||
return file_manager.download(file)
|
||||
else:
|
||||
raise ValueError(f"Unsupported transfer method: {file.transfer_method}")
|
||||
return file_manager.download(file)
|
||||
except Exception as e:
|
||||
raise FileDownloadError(f"Error downloading file: {str(e)}") from e
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user