Skip to content

Commit

Permalink
Adds __str__ method for TextWithMetadata (jupyterlab#250)
Browse files Browse the repository at this point in the history
* Adds __str__ method for TextWithMetadata

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
JasonWeill and pre-commit-ci[bot] authored Jun 30, 2023
1 parent 82029e3 commit 35838b3
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/jupyter-ai-magics/jupyter_ai_magics/magics.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ def __init__(self, text, metadata):
self.text = text
self.metadata = metadata

def __str__(self):
return self.text

def _repr_mimebundle_(self, include=None, exclude=None):
return ({"text/plain": self.text}, self.metadata)

Expand Down

0 comments on commit 35838b3

Please sign in to comment.