e2b-code-interpreter 2.4.0__tar.gz → 2.5.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {e2b_code_interpreter-2.4.0 → e2b_code_interpreter-2.5.0}/PKG-INFO +3 -3
- {e2b_code_interpreter-2.4.0 → e2b_code_interpreter-2.5.0}/e2b_code_interpreter/code_interpreter_async.py +32 -22
- {e2b_code_interpreter-2.4.0 → e2b_code_interpreter-2.5.0}/e2b_code_interpreter/code_interpreter_sync.py +30 -20
- {e2b_code_interpreter-2.4.0 → e2b_code_interpreter-2.5.0}/pyproject.toml +3 -4
- {e2b_code_interpreter-2.4.0 → e2b_code_interpreter-2.5.0}/LICENSE +0 -0
- {e2b_code_interpreter-2.4.0 → e2b_code_interpreter-2.5.0}/README.md +0 -0
- {e2b_code_interpreter-2.4.0 → e2b_code_interpreter-2.5.0}/e2b_code_interpreter/__init__.py +0 -0
- {e2b_code_interpreter-2.4.0 → e2b_code_interpreter-2.5.0}/e2b_code_interpreter/charts.py +0 -0
- {e2b_code_interpreter-2.4.0 → e2b_code_interpreter-2.5.0}/e2b_code_interpreter/constants.py +0 -0
- {e2b_code_interpreter-2.4.0 → e2b_code_interpreter-2.5.0}/e2b_code_interpreter/exceptions.py +0 -0
- {e2b_code_interpreter-2.4.0 → e2b_code_interpreter-2.5.0}/e2b_code_interpreter/models.py +0 -0
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: e2b-code-interpreter
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.5.0
|
|
4
4
|
Summary: E2B Code Interpreter - Stateful code execution
|
|
5
5
|
Home-page: https://e2b.dev/
|
|
6
6
|
License: MIT
|
|
7
7
|
Author: e2b
|
|
8
8
|
Author-email: hello@e2b.dev
|
|
9
|
-
Requires-Python: >=3.
|
|
9
|
+
Requires-Python: >=3.10,<4.0
|
|
10
10
|
Classifier: License :: OSI Approved :: MIT License
|
|
11
11
|
Classifier: Programming Language :: Python :: 3
|
|
12
|
-
Classifier: Programming Language :: Python :: 3.9
|
|
13
12
|
Classifier: Programming Language :: Python :: 3.10
|
|
14
13
|
Classifier: Programming Language :: Python :: 3.11
|
|
15
14
|
Classifier: Programming Language :: Python :: 3.12
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
16
16
|
Requires-Dist: attrs (>=21.3.0)
|
|
17
17
|
Requires-Dist: e2b (>=2.7.0,<3.0.0)
|
|
18
18
|
Requires-Dist: httpx (>=0.20.0,<1.0.0)
|
|
@@ -190,12 +190,15 @@ class AsyncSandbox(BaseAsyncSandbox):
|
|
|
190
190
|
timeout = None if timeout == 0 else (timeout or DEFAULT_TIMEOUT)
|
|
191
191
|
request_timeout = request_timeout or self.connection_config.request_timeout
|
|
192
192
|
context_id = context.id if context else None
|
|
193
|
-
|
|
194
|
-
headers: Dict[str, str] = {}
|
|
195
|
-
if self._envd_access_token:
|
|
196
|
-
headers = {"X-Access-Token": self._envd_access_token}
|
|
197
|
-
|
|
198
193
|
try:
|
|
194
|
+
headers = {
|
|
195
|
+
"Content-Type": "application/json",
|
|
196
|
+
}
|
|
197
|
+
if self._envd_access_token:
|
|
198
|
+
headers["X-Access-Token"] = self._envd_access_token
|
|
199
|
+
if self.traffic_access_token:
|
|
200
|
+
headers["E2B-Traffic-Access-Token"] = self.traffic_access_token
|
|
201
|
+
|
|
199
202
|
async with self._client.stream(
|
|
200
203
|
"POST",
|
|
201
204
|
f"{self._jupyter_url}/execute",
|
|
@@ -253,11 +256,13 @@ class AsyncSandbox(BaseAsyncSandbox):
|
|
|
253
256
|
if cwd:
|
|
254
257
|
data["cwd"] = cwd
|
|
255
258
|
|
|
256
|
-
headers: Dict[str, str] = {}
|
|
257
|
-
if self._envd_access_token:
|
|
258
|
-
headers = {"X-Access-Token": self._envd_access_token}
|
|
259
|
-
|
|
260
259
|
try:
|
|
260
|
+
headers = {
|
|
261
|
+
"Content-Type": "application/json",
|
|
262
|
+
}
|
|
263
|
+
if self.traffic_access_token:
|
|
264
|
+
headers["E2B-Traffic-Access-Token"] = self.traffic_access_token
|
|
265
|
+
|
|
261
266
|
response = await self._client.post(
|
|
262
267
|
f"{self._jupyter_url}/contexts",
|
|
263
268
|
headers=headers,
|
|
@@ -287,11 +292,13 @@ class AsyncSandbox(BaseAsyncSandbox):
|
|
|
287
292
|
"""
|
|
288
293
|
context_id = context.id if isinstance(context, Context) else context
|
|
289
294
|
|
|
290
|
-
headers: Dict[str, str] = {}
|
|
291
|
-
if self._envd_access_token:
|
|
292
|
-
headers = {"X-Access-Token": self._envd_access_token}
|
|
293
|
-
|
|
294
295
|
try:
|
|
296
|
+
headers = {
|
|
297
|
+
"Content-Type": "application/json",
|
|
298
|
+
}
|
|
299
|
+
if self.traffic_access_token:
|
|
300
|
+
headers["E2B-Traffic-Access-Token"] = self.traffic_access_token
|
|
301
|
+
|
|
295
302
|
response = await self._client.delete(
|
|
296
303
|
f"{self._jupyter_url}/contexts/{context_id}",
|
|
297
304
|
headers=headers,
|
|
@@ -310,11 +317,13 @@ class AsyncSandbox(BaseAsyncSandbox):
|
|
|
310
317
|
|
|
311
318
|
:return: List of contexts.
|
|
312
319
|
"""
|
|
313
|
-
headers: Dict[str, str] = {}
|
|
314
|
-
if self._envd_access_token:
|
|
315
|
-
headers = {"X-Access-Token": self._envd_access_token}
|
|
316
|
-
|
|
317
320
|
try:
|
|
321
|
+
headers = {
|
|
322
|
+
"Content-Type": "application/json",
|
|
323
|
+
}
|
|
324
|
+
if self.traffic_access_token:
|
|
325
|
+
headers["E2B-Traffic-Access-Token"] = self.traffic_access_token
|
|
326
|
+
|
|
318
327
|
response = await self._client.get(
|
|
319
328
|
f"{self._jupyter_url}/contexts",
|
|
320
329
|
headers=headers,
|
|
@@ -342,12 +351,13 @@ class AsyncSandbox(BaseAsyncSandbox):
|
|
|
342
351
|
:return: None
|
|
343
352
|
"""
|
|
344
353
|
context_id = context.id if isinstance(context, Context) else context
|
|
345
|
-
|
|
346
|
-
headers: Dict[str, str] = {}
|
|
347
|
-
if self._envd_access_token:
|
|
348
|
-
headers = {"X-Access-Token": self._envd_access_token}
|
|
349
|
-
|
|
350
354
|
try:
|
|
355
|
+
headers = {
|
|
356
|
+
"Content-Type": "application/json",
|
|
357
|
+
}
|
|
358
|
+
if self.traffic_access_token:
|
|
359
|
+
headers["E2B-Traffic-Access-Token"] = self.traffic_access_token
|
|
360
|
+
|
|
351
361
|
response = await self._client.post(
|
|
352
362
|
f"{self._jupyter_url}/contexts/{context_id}/restart",
|
|
353
363
|
headers=headers,
|
|
@@ -188,11 +188,13 @@ class Sandbox(BaseSandbox):
|
|
|
188
188
|
request_timeout = request_timeout or self.connection_config.request_timeout
|
|
189
189
|
context_id = context.id if context else None
|
|
190
190
|
|
|
191
|
-
headers: Dict[str, str] = {}
|
|
192
|
-
if self._envd_access_token:
|
|
193
|
-
headers = {"X-Access-Token": self._envd_access_token}
|
|
194
|
-
|
|
195
191
|
try:
|
|
192
|
+
headers: Dict[str, str] = {"Content-Type": "application/json"}
|
|
193
|
+
if self._envd_access_token:
|
|
194
|
+
headers["X-Access-Token"] = self._envd_access_token
|
|
195
|
+
if self.traffic_access_token:
|
|
196
|
+
headers["E2B-Traffic-Access-Token"] = self.traffic_access_token
|
|
197
|
+
|
|
196
198
|
with self._client.stream(
|
|
197
199
|
"POST",
|
|
198
200
|
f"{self._jupyter_url}/execute",
|
|
@@ -250,11 +252,13 @@ class Sandbox(BaseSandbox):
|
|
|
250
252
|
if cwd:
|
|
251
253
|
data["cwd"] = cwd
|
|
252
254
|
|
|
253
|
-
headers: Dict[str, str] = {}
|
|
254
|
-
if self._envd_access_token:
|
|
255
|
-
headers = {"X-Access-Token": self._envd_access_token}
|
|
256
|
-
|
|
257
255
|
try:
|
|
256
|
+
headers: Dict[str, str] = {"Content-Type": "application/json"}
|
|
257
|
+
if self._envd_access_token:
|
|
258
|
+
headers["X-Access-Token"] = self._envd_access_token
|
|
259
|
+
if self.traffic_access_token:
|
|
260
|
+
headers["E2B-Traffic-Access-Token"] = self.traffic_access_token
|
|
261
|
+
|
|
258
262
|
response = self._client.post(
|
|
259
263
|
f"{self._jupyter_url}/contexts",
|
|
260
264
|
json=data,
|
|
@@ -284,11 +288,13 @@ class Sandbox(BaseSandbox):
|
|
|
284
288
|
"""
|
|
285
289
|
context_id = context.id if isinstance(context, Context) else context
|
|
286
290
|
|
|
287
|
-
headers: Dict[str, str] = {}
|
|
288
|
-
if self._envd_access_token:
|
|
289
|
-
headers = {"X-Access-Token": self._envd_access_token}
|
|
290
|
-
|
|
291
291
|
try:
|
|
292
|
+
headers: Dict[str, str] = {"Content-Type": "application/json"}
|
|
293
|
+
if self._envd_access_token:
|
|
294
|
+
headers["X-Access-Token"] = self._envd_access_token
|
|
295
|
+
if self.traffic_access_token:
|
|
296
|
+
headers["E2B-Traffic-Access-Token"] = self.traffic_access_token
|
|
297
|
+
|
|
292
298
|
response = self._client.delete(
|
|
293
299
|
f"{self._jupyter_url}/contexts/{context_id}",
|
|
294
300
|
headers=headers,
|
|
@@ -307,11 +313,13 @@ class Sandbox(BaseSandbox):
|
|
|
307
313
|
|
|
308
314
|
:return: List of contexts.
|
|
309
315
|
"""
|
|
310
|
-
headers: Dict[str, str] = {}
|
|
311
|
-
if self._envd_access_token:
|
|
312
|
-
headers = {"X-Access-Token": self._envd_access_token}
|
|
313
|
-
|
|
314
316
|
try:
|
|
317
|
+
headers: Dict[str, str] = {"Content-Type": "application/json"}
|
|
318
|
+
if self._envd_access_token:
|
|
319
|
+
headers["X-Access-Token"] = self._envd_access_token
|
|
320
|
+
if self.traffic_access_token:
|
|
321
|
+
headers["E2B-Traffic-Access-Token"] = self.traffic_access_token
|
|
322
|
+
|
|
315
323
|
response = self._client.get(
|
|
316
324
|
f"{self._jupyter_url}/contexts",
|
|
317
325
|
headers=headers,
|
|
@@ -340,11 +348,13 @@ class Sandbox(BaseSandbox):
|
|
|
340
348
|
"""
|
|
341
349
|
context_id = context.id if isinstance(context, Context) else context
|
|
342
350
|
|
|
343
|
-
headers: Dict[str, str] = {}
|
|
344
|
-
if self._envd_access_token:
|
|
345
|
-
headers = {"X-Access-Token": self._envd_access_token}
|
|
346
|
-
|
|
347
351
|
try:
|
|
352
|
+
headers: Dict[str, str] = {"Content-Type": "application/json"}
|
|
353
|
+
if self._envd_access_token:
|
|
354
|
+
headers["X-Access-Token"] = self._envd_access_token
|
|
355
|
+
if self.traffic_access_token:
|
|
356
|
+
headers["E2B-Traffic-Access-Token"] = self.traffic_access_token
|
|
357
|
+
|
|
348
358
|
response = self._client.post(
|
|
349
359
|
f"{self._jupyter_url}/contexts/{context_id}/restart",
|
|
350
360
|
headers=headers,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[tool.poetry]
|
|
2
2
|
name = "e2b-code-interpreter"
|
|
3
|
-
version = "2.
|
|
3
|
+
version = "2.5.0"
|
|
4
4
|
description = "E2B Code Interpreter - Stateful code execution"
|
|
5
5
|
authors = ["e2b <hello@e2b.dev>"]
|
|
6
6
|
license = "MIT"
|
|
@@ -10,7 +10,7 @@ repository = "https://github.com/e2b-dev/code-interpreter/tree/main/python"
|
|
|
10
10
|
packages = [{ include = "e2b_code_interpreter" }]
|
|
11
11
|
|
|
12
12
|
[tool.poetry.dependencies]
|
|
13
|
-
python = "^3.
|
|
13
|
+
python = "^3.10"
|
|
14
14
|
|
|
15
15
|
httpx = ">=0.20.0, <1.0.0"
|
|
16
16
|
attrs = ">=21.3.0"
|
|
@@ -22,7 +22,6 @@ python-dotenv = "^1.0.0"
|
|
|
22
22
|
pytest-dotenv = "^0.5.2"
|
|
23
23
|
pytest-asyncio = "^0.24.0"
|
|
24
24
|
pytest-xdist = "^3.6.1"
|
|
25
|
-
pydoc-markdown = "^4.8.2"
|
|
26
25
|
matplotlib = "^3.8.0"
|
|
27
26
|
ruff = "^0.11.12"
|
|
28
27
|
|
|
@@ -35,4 +34,4 @@ build-backend = "poetry.core.masonry.api"
|
|
|
35
34
|
"Bug Tracker" = "https://github.com/e2b-dev/code-interpreter/issues"
|
|
36
35
|
|
|
37
36
|
[tool.ruff.lint]
|
|
38
|
-
ignore = ["F401", "F403"]
|
|
37
|
+
ignore = ["F401", "F403"]
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{e2b_code_interpreter-2.4.0 → e2b_code_interpreter-2.5.0}/e2b_code_interpreter/exceptions.py
RENAMED
|
File without changes
|
|
File without changes
|