e2b-code-interpreter 1.3.4rc2__tar.gz → 1.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.
@@ -1,7 +1,8 @@
1
- Metadata-Version: 2.3
1
+ Metadata-Version: 2.1
2
2
  Name: e2b-code-interpreter
3
- Version: 1.3.4rc2
3
+ Version: 1.5.0
4
4
  Summary: E2B Code Interpreter - Stateful code execution
5
+ Home-page: https://e2b.dev/
5
6
  License: Apache-2.0
6
7
  Author: e2b
7
8
  Author-email: hello@e2b.dev
@@ -12,12 +13,10 @@ Classifier: Programming Language :: Python :: 3.9
12
13
  Classifier: Programming Language :: Python :: 3.10
13
14
  Classifier: Programming Language :: Python :: 3.11
14
15
  Classifier: Programming Language :: Python :: 3.12
15
- Classifier: Programming Language :: Python :: 3.13
16
16
  Requires-Dist: attrs (>=21.3.0)
17
- Requires-Dist: e2b (==1.3.4rc2)
17
+ Requires-Dist: e2b (>=1.4.0,<2.0.0)
18
18
  Requires-Dist: httpx (>=0.20.0,<1.0.0)
19
19
  Project-URL: Bug Tracker, https://github.com/e2b-dev/code-interpreter/issues
20
- Project-URL: Homepage, https://e2b.dev/
21
20
  Project-URL: Repository, https://github.com/e2b-dev/code-interpreter/tree/main/python
22
21
  Description-Content-Type: text/markdown
23
22
 
@@ -1,29 +1,34 @@
1
1
  import logging
2
- from typing import Dict, Literal, Optional, Union, overload
3
-
4
2
  import httpx
5
- from e2b import AsyncSandbox as BaseAsyncSandbox
6
- from e2b import ConnectionConfig, InvalidArgumentException
3
+
4
+ from typing import Optional, Dict, overload, Union, Literal
5
+ from httpx import AsyncClient
6
+
7
+ from e2b import (
8
+ AsyncSandbox as BaseAsyncSandbox,
9
+ ConnectionConfig,
10
+ InvalidArgumentException,
11
+ )
12
+
7
13
  from e2b_code_interpreter.constants import (
8
14
  DEFAULT_TEMPLATE,
9
- DEFAULT_TIMEOUT,
10
15
  JUPYTER_PORT,
11
- )
12
- from e2b_code_interpreter.exceptions import (
13
- format_execution_timeout_error,
14
- format_request_timeout_error,
16
+ DEFAULT_TIMEOUT,
15
17
  )
16
18
  from e2b_code_interpreter.models import (
17
- Context,
18
19
  Execution,
19
20
  ExecutionError,
20
- OutputHandler,
21
- OutputMessage,
21
+ Context,
22
22
  Result,
23
23
  aextract_exception,
24
24
  parse_output,
25
+ OutputHandler,
26
+ OutputMessage,
27
+ )
28
+ from e2b_code_interpreter.exceptions import (
29
+ format_execution_timeout_error,
30
+ format_request_timeout_error,
25
31
  )
26
- from httpx import AsyncClient
27
32
 
28
33
  logger = logging.getLogger(__name__)
29
34
 
@@ -317,9 +317,16 @@ def serialize_results(results: List[Result]) -> List[Dict[str, str]]:
317
317
  """
318
318
  serialized = []
319
319
  for result in results:
320
- serialized_dict = {key: result[key] for key in result.formats()}
320
+ serialized_dict = {}
321
+ for key in result.formats():
322
+ if key == "chart":
323
+ serialized_dict[key] = result.chart.to_dict()
324
+ else:
325
+ serialized_dict[key] = result[key]
326
+
321
327
  serialized_dict["text"] = result.text
322
328
  serialized.append(serialized_dict)
329
+
323
330
  return serialized
324
331
 
325
332
 
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "e2b-code-interpreter"
3
- version = "1.3.4rc2"
3
+ version = "1.5.0"
4
4
  description = "E2B Code Interpreter - Stateful code execution"
5
5
  authors = ["e2b <hello@e2b.dev>"]
6
6
  license = "Apache-2.0"
@@ -14,7 +14,7 @@ python = "^3.9"
14
14
 
15
15
  httpx = ">=0.20.0, <1.0.0"
16
16
  attrs = ">=21.3.0"
17
- e2b = "1.3.4rc2"
17
+ e2b = "^1.4.0"
18
18
 
19
19
  [tool.poetry.group.dev.dependencies]
20
20
  pytest = "^7.4.0"