e2b-code-interpreter 2.8.1__tar.gz → 2.9.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.8.1 → e2b_code_interpreter-2.9.0}/PKG-INFO +1 -1
- {e2b_code_interpreter-2.8.1 → e2b_code_interpreter-2.9.0}/e2b_code_interpreter/code_interpreter_async.py +15 -0
- {e2b_code_interpreter-2.8.1 → e2b_code_interpreter-2.9.0}/e2b_code_interpreter/code_interpreter_sync.py +30 -13
- {e2b_code_interpreter-2.8.1 → e2b_code_interpreter-2.9.0}/pyproject.toml +1 -1
- {e2b_code_interpreter-2.8.1 → e2b_code_interpreter-2.9.0}/LICENSE +0 -0
- {e2b_code_interpreter-2.8.1 → e2b_code_interpreter-2.9.0}/README.md +0 -0
- {e2b_code_interpreter-2.8.1 → e2b_code_interpreter-2.9.0}/e2b_code_interpreter/__init__.py +0 -0
- {e2b_code_interpreter-2.8.1 → e2b_code_interpreter-2.9.0}/e2b_code_interpreter/charts.py +0 -0
- {e2b_code_interpreter-2.8.1 → e2b_code_interpreter-2.9.0}/e2b_code_interpreter/constants.py +0 -0
- {e2b_code_interpreter-2.8.1 → e2b_code_interpreter-2.9.0}/e2b_code_interpreter/exceptions.py +0 -0
- {e2b_code_interpreter-2.8.1 → e2b_code_interpreter-2.9.0}/e2b_code_interpreter/models.py +0 -0
|
@@ -61,6 +61,11 @@ class AsyncSandbox(BaseAsyncSandbox):
|
|
|
61
61
|
|
|
62
62
|
@property
|
|
63
63
|
def _jupyter_url(self) -> str:
|
|
64
|
+
# Honors the `sandbox_url` option and the `E2B_SANDBOX_URL` environment
|
|
65
|
+
# variable, same as the base SDK does for envd requests.
|
|
66
|
+
sandbox_url = self.connection_config._sandbox_url
|
|
67
|
+
if sandbox_url:
|
|
68
|
+
return sandbox_url
|
|
64
69
|
return f"{'http' if self.connection_config.debug else 'https'}://{self.get_host(JUPYTER_PORT)}"
|
|
65
70
|
|
|
66
71
|
@property
|
|
@@ -196,6 +201,8 @@ class AsyncSandbox(BaseAsyncSandbox):
|
|
|
196
201
|
try:
|
|
197
202
|
headers = {
|
|
198
203
|
"Content-Type": "application/json",
|
|
204
|
+
"E2b-Sandbox-Id": self.sandbox_id,
|
|
205
|
+
"E2b-Sandbox-Port": str(JUPYTER_PORT),
|
|
199
206
|
}
|
|
200
207
|
if self._envd_access_token:
|
|
201
208
|
headers["X-Access-Token"] = self._envd_access_token
|
|
@@ -265,6 +272,8 @@ class AsyncSandbox(BaseAsyncSandbox):
|
|
|
265
272
|
try:
|
|
266
273
|
headers = {
|
|
267
274
|
"Content-Type": "application/json",
|
|
275
|
+
"E2b-Sandbox-Id": self.sandbox_id,
|
|
276
|
+
"E2b-Sandbox-Port": str(JUPYTER_PORT),
|
|
268
277
|
}
|
|
269
278
|
if self.traffic_access_token:
|
|
270
279
|
headers["E2B-Traffic-Access-Token"] = self.traffic_access_token
|
|
@@ -304,6 +313,8 @@ class AsyncSandbox(BaseAsyncSandbox):
|
|
|
304
313
|
try:
|
|
305
314
|
headers = {
|
|
306
315
|
"Content-Type": "application/json",
|
|
316
|
+
"E2b-Sandbox-Id": self.sandbox_id,
|
|
317
|
+
"E2b-Sandbox-Port": str(JUPYTER_PORT),
|
|
307
318
|
}
|
|
308
319
|
if self.traffic_access_token:
|
|
309
320
|
headers["E2B-Traffic-Access-Token"] = self.traffic_access_token
|
|
@@ -332,6 +343,8 @@ class AsyncSandbox(BaseAsyncSandbox):
|
|
|
332
343
|
try:
|
|
333
344
|
headers = {
|
|
334
345
|
"Content-Type": "application/json",
|
|
346
|
+
"E2b-Sandbox-Id": self.sandbox_id,
|
|
347
|
+
"E2b-Sandbox-Port": str(JUPYTER_PORT),
|
|
335
348
|
}
|
|
336
349
|
if self.traffic_access_token:
|
|
337
350
|
headers["E2B-Traffic-Access-Token"] = self.traffic_access_token
|
|
@@ -369,6 +382,8 @@ class AsyncSandbox(BaseAsyncSandbox):
|
|
|
369
382
|
try:
|
|
370
383
|
headers = {
|
|
371
384
|
"Content-Type": "application/json",
|
|
385
|
+
"E2b-Sandbox-Id": self.sandbox_id,
|
|
386
|
+
"E2b-Sandbox-Port": str(JUPYTER_PORT),
|
|
372
387
|
}
|
|
373
388
|
if self.traffic_access_token:
|
|
374
389
|
headers["E2B-Traffic-Access-Token"] = self.traffic_access_token
|
|
@@ -58,6 +58,11 @@ class Sandbox(BaseSandbox):
|
|
|
58
58
|
|
|
59
59
|
@property
|
|
60
60
|
def _jupyter_url(self) -> str:
|
|
61
|
+
# Honors the `sandbox_url` option and the `E2B_SANDBOX_URL` environment
|
|
62
|
+
# variable, same as the base SDK does for envd requests.
|
|
63
|
+
sandbox_url = self.connection_config._sandbox_url
|
|
64
|
+
if sandbox_url:
|
|
65
|
+
return sandbox_url
|
|
61
66
|
return f"{'http' if self.connection_config.debug else 'https'}://{self.get_host(JUPYTER_PORT)}"
|
|
62
67
|
|
|
63
68
|
@property
|
|
@@ -189,7 +194,11 @@ class Sandbox(BaseSandbox):
|
|
|
189
194
|
context_id = context.id if context else None
|
|
190
195
|
|
|
191
196
|
try:
|
|
192
|
-
headers: Dict[str, str] = {
|
|
197
|
+
headers: Dict[str, str] = {
|
|
198
|
+
"Content-Type": "application/json",
|
|
199
|
+
"E2b-Sandbox-Id": self.sandbox_id,
|
|
200
|
+
"E2b-Sandbox-Port": str(JUPYTER_PORT),
|
|
201
|
+
}
|
|
193
202
|
if self._envd_access_token:
|
|
194
203
|
headers["X-Access-Token"] = self._envd_access_token
|
|
195
204
|
if self.traffic_access_token:
|
|
@@ -256,9 +265,11 @@ class Sandbox(BaseSandbox):
|
|
|
256
265
|
data["cwd"] = cwd
|
|
257
266
|
|
|
258
267
|
try:
|
|
259
|
-
headers: Dict[str, str] = {
|
|
260
|
-
|
|
261
|
-
|
|
268
|
+
headers: Dict[str, str] = {
|
|
269
|
+
"Content-Type": "application/json",
|
|
270
|
+
"E2b-Sandbox-Id": self.sandbox_id,
|
|
271
|
+
"E2b-Sandbox-Port": str(JUPYTER_PORT),
|
|
272
|
+
}
|
|
262
273
|
if self.traffic_access_token:
|
|
263
274
|
headers["E2B-Traffic-Access-Token"] = self.traffic_access_token
|
|
264
275
|
|
|
@@ -295,9 +306,11 @@ class Sandbox(BaseSandbox):
|
|
|
295
306
|
context_id = context.id if isinstance(context, Context) else context
|
|
296
307
|
|
|
297
308
|
try:
|
|
298
|
-
headers: Dict[str, str] = {
|
|
299
|
-
|
|
300
|
-
|
|
309
|
+
headers: Dict[str, str] = {
|
|
310
|
+
"Content-Type": "application/json",
|
|
311
|
+
"E2b-Sandbox-Id": self.sandbox_id,
|
|
312
|
+
"E2b-Sandbox-Port": str(JUPYTER_PORT),
|
|
313
|
+
}
|
|
301
314
|
if self.traffic_access_token:
|
|
302
315
|
headers["E2B-Traffic-Access-Token"] = self.traffic_access_token
|
|
303
316
|
|
|
@@ -323,9 +336,11 @@ class Sandbox(BaseSandbox):
|
|
|
323
336
|
:return: List of contexts.
|
|
324
337
|
"""
|
|
325
338
|
try:
|
|
326
|
-
headers: Dict[str, str] = {
|
|
327
|
-
|
|
328
|
-
|
|
339
|
+
headers: Dict[str, str] = {
|
|
340
|
+
"Content-Type": "application/json",
|
|
341
|
+
"E2b-Sandbox-Id": self.sandbox_id,
|
|
342
|
+
"E2b-Sandbox-Port": str(JUPYTER_PORT),
|
|
343
|
+
}
|
|
329
344
|
if self.traffic_access_token:
|
|
330
345
|
headers["E2B-Traffic-Access-Token"] = self.traffic_access_token
|
|
331
346
|
|
|
@@ -361,9 +376,11 @@ class Sandbox(BaseSandbox):
|
|
|
361
376
|
context_id = context.id if isinstance(context, Context) else context
|
|
362
377
|
|
|
363
378
|
try:
|
|
364
|
-
headers: Dict[str, str] = {
|
|
365
|
-
|
|
366
|
-
|
|
379
|
+
headers: Dict[str, str] = {
|
|
380
|
+
"Content-Type": "application/json",
|
|
381
|
+
"E2b-Sandbox-Id": self.sandbox_id,
|
|
382
|
+
"E2b-Sandbox-Port": str(JUPYTER_PORT),
|
|
383
|
+
}
|
|
367
384
|
if self.traffic_access_token:
|
|
368
385
|
headers["E2B-Traffic-Access-Token"] = self.traffic_access_token
|
|
369
386
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{e2b_code_interpreter-2.8.1 → e2b_code_interpreter-2.9.0}/e2b_code_interpreter/exceptions.py
RENAMED
|
File without changes
|
|
File without changes
|