Skip to content

Commit

Permalink
Add to_dict() method in python SDK
Browse files Browse the repository at this point in the history
  • Loading branch information
jakubno committed Jan 21, 2025
1 parent daba22b commit f14a2a5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/hot-dots-help.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@e2b/code-interpreter-python': patch
---

Add to_dict() method
4 changes: 4 additions & 0 deletions python/e2b_code_interpreter/charts.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,14 @@ class Chart:
elements: List[Any]

def __init__(self, **kwargs):
self._raw_data = kwargs
self.type = ChartType(kwargs["type"] or ChartType.UNKNOWN)
self.title = kwargs["title"]
self.elements = kwargs["elements"]

def to_dict(self) -> dict:
return self._raw_data


class Chart2D(Chart):
x_label: Optional[str]
Expand Down

0 comments on commit f14a2a5

Please sign in to comment.