mirror of
https://github.com/langgenius/dify.git
synced 2026-05-03 00:48:04 +08:00
fix: update file reading method to handle bytes format in E2BEnvironment
This commit is contained in:
@ -216,8 +216,8 @@ class E2BEnvironment(VirtualEnvironment):
|
||||
"""
|
||||
remote_path = self._workspace_path(path)
|
||||
sandbox = self.metadata.store[self.StoreKey.SANDBOX]
|
||||
content = sandbox.files.read(remote_path)
|
||||
return BytesIO(content.encode())
|
||||
content = sandbox.files.read(remote_path, format="bytes")
|
||||
return BytesIO(bytes(content))
|
||||
|
||||
def list_files(self, directory_path: str, limit: int) -> Sequence[FileState]:
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user