e2b-code-interpreter 0.0.2__tar.gz → 0.0.3__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,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: e2b-code-interpreter
3
- Version: 0.0.2
3
+ Version: 0.0.3
4
4
  Summary: E2B Code Interpreter - Stateful code execution
5
5
  Home-page: https://e2b.dev/
6
6
  License: Apache-2.0
@@ -38,14 +38,13 @@ class Result:
38
38
  The result is similar to the structure returned by ipython kernel: https://ipython.readthedocs.io/en/stable/development/execution.html#execution-semantics
39
39
 
40
40
  The result can contain multiple types of data, such as text, images, plots, etc. Each type of data is represented
41
- as a string, and the result can contain multiple types of data. The text representation is always present, and
42
- the other representations are optional.
41
+ as a string, and the result can contain multiple types of data. The display calls don't have to have text representation,
42
+ for the actual result the representation is always present for the result, the other representations are always optional.
43
43
 
44
44
  The class also provides methods to display the data in a Jupyter notebook.
45
45
  """
46
46
 
47
- text: str
48
- "Text representation of the result. Always present."
47
+ text: Optional[str] = None
49
48
  html: Optional[str] = None
50
49
  markdown: Optional[str] = None
51
50
  svg: Optional[str] = None
@@ -68,7 +67,7 @@ class Result:
68
67
  self.is_main_result = is_main_result
69
68
  self.raw = copy.deepcopy(data)
70
69
 
71
- self.text = data.pop("text/plain")
70
+ self.text = data.pop("text/plain", None)
72
71
  self.html = data.pop("text/html", None)
73
72
  self.markdown = data.pop("text/markdown", None)
74
73
  self.svg = data.pop("image/svg+xml", None)
@@ -111,7 +110,7 @@ class Result:
111
110
 
112
111
  return formats
113
112
 
114
- def __str__(self) -> str:
113
+ def __str__(self) -> Optional[str]:
115
114
  """
116
115
  Returns the text representation of the data.
117
116
 
@@ -119,7 +118,7 @@ class Result:
119
118
  """
120
119
  return self.text
121
120
 
122
- def _repr_html_(self) -> str:
121
+ def _repr_html_(self) -> Optional[str]:
123
122
  """
124
123
  Returns the HTML representation of the data.
125
124
 
@@ -127,7 +126,7 @@ class Result:
127
126
  """
128
127
  return self.html
129
128
 
130
- def _repr_markdown_(self) -> str:
129
+ def _repr_markdown_(self) -> Optional[str]:
131
130
  """
132
131
  Returns the Markdown representation of the data.
133
132
 
@@ -135,7 +134,7 @@ class Result:
135
134
  """
136
135
  return self.markdown
137
136
 
138
- def _repr_svg_(self) -> str:
137
+ def _repr_svg_(self) -> Optional[str]:
139
138
  """
140
139
  Returns the SVG representation of the data.
141
140
 
@@ -143,7 +142,7 @@ class Result:
143
142
  """
144
143
  return self.svg
145
144
 
146
- def _repr_png_(self) -> str:
145
+ def _repr_png_(self) -> Optional[str]:
147
146
  """
148
147
  Returns the base64 representation of the PNG data.
149
148
 
@@ -151,7 +150,7 @@ class Result:
151
150
  """
152
151
  return self.png
153
152
 
154
- def _repr_jpeg_(self) -> str:
153
+ def _repr_jpeg_(self) -> Optional[str]:
155
154
  """
156
155
  Returns the base64 representation of the JPEG data.
157
156
 
@@ -159,7 +158,7 @@ class Result:
159
158
  """
160
159
  return self.jpeg
161
160
 
162
- def _repr_pdf_(self) -> str:
161
+ def _repr_pdf_(self) -> Optional[str]:
163
162
  """
164
163
  Returns the PDF representation of the data.
165
164
 
@@ -167,7 +166,7 @@ class Result:
167
166
  """
168
167
  return self.pdf
169
168
 
170
- def _repr_latex_(self) -> str:
169
+ def _repr_latex_(self) -> Optional[str]:
171
170
  """
172
171
  Returns the LaTeX representation of the data.
173
172
 
@@ -175,7 +174,7 @@ class Result:
175
174
  """
176
175
  return self.latex
177
176
 
178
- def _repr_json_(self) -> dict:
177
+ def _repr_json_(self) -> Optional[dict]:
179
178
  """
180
179
  Returns the JSON representation of the data.
181
180
 
@@ -183,7 +182,7 @@ class Result:
183
182
  """
184
183
  return self.json
185
184
 
186
- def _repr_javascript_(self) -> str:
185
+ def _repr_javascript_(self) -> Optional[str]:
187
186
  """
188
187
  Returns the JavaScript representation of the data.
189
188
 
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "e2b-code-interpreter"
3
- version = "0.0.2"
3
+ version = "0.0.3"
4
4
  description = "E2B Code Interpreter - Stateful code execution"
5
5
  authors = ["e2b <hello@e2b.dev>"]
6
6
  license = "Apache-2.0"