Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds __str__ method for TextWithMetadata #250

Merged
merged 2 commits into from
Jun 30, 2023

Conversation

JasonWeill
Copy link
Collaborator

Fixes #241. Adds __str__ method to the TextWithMetadata class so that text outputs in the Out special array can be used via interpolation in prompts.

Before:

Out objects are treated as objects when interpolated

After:

Out objects are treated as text when interpolated

@JasonWeill JasonWeill added bug Something isn't working @jupyter-ai/magics labels Jun 30, 2023
@JasonWeill JasonWeill merged commit 299d206 into jupyterlab:main Jun 30, 2023
3 checks passed
dbelgrod pushed a commit to dbelgrod/jupyter-ai that referenced this pull request Jun 10, 2024
* 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working @jupyter-ai/magics
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Interpolating Out[] puts an object, not text, into a text prompt
2 participants