mirror of https://github.com/langgenius/dify.git
fix: update file reading method to handle bytes format in E2BEnvironment
This commit is contained in:
parent
eb87512122
commit
6b0e6b2785
|
|
@ -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]:
|
||||
"""
|
||||
|
|
|
|||
Loading…
Reference in New Issue