Skip to content

armgit / E2B

Public Imported from GitHub
0

Open-source, secure environment with real-world tools for enterprise-grade agents.

remove artifact.read() and leave only download() (#196)

Vasek Mlejnsky119be368c593
diff --git a/.changeset/blue-shirts-sneeze.md b/.changeset/blue-shirts-sneeze.md
new file mode 100644
index 000000000..01d29c59c
--- /dev/null
+++ b/.changeset/blue-shirts-sneeze.md
@@ -0,0 +1,5 @@
+---
+'@e2b/python-sdk': minor
+---
+
+Make artifact.download() return bytes and remove the artifact.read() method
diff --git a/packages/python-sdk/e2b/templates/data_analysis.py b/packages/python-sdk/e2b/templates/data_analysis.py
index 3bb686a70..a8e0caa9e 100644
--- a/packages/python-sdk/e2b/templates/data_analysis.py
+++ b/packages/python-sdk/e2b/templates/data_analysis.py
@@ -21,15 +21,9 @@ class Artifact(BaseModel):
def __hash__(self):
return hash(self.name)
- def read(self) -> bytes:
+ def download(self) -> bytes:
return self._session.download_file(self.name)
- def download(self, path: Optional[str] = None) -> None:
- data = self.read()
- with open(path or self.name, "wb") as f:
- f.write(data)
-
-
class DataAnalysis(SyncSession):
env_id = "Python3-DataAnalysis"