You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Interpolating the special Out[] array into a text prompt causes an object to be inserted into the prompt:
Out[9] should contain only the text A new moon has no illuminated portion visible, while a full moon has its entire disk fully illuminated by the sun. Instead, it is a TextWithMetadata object, not serialized as text when I interpolate it in In[10], so what gets translated into Spanish is a Python descriptor of an object.
One can work around this by calling .text on the Out[n] object:
%%ai chatgpt
Translate this sentence into Spanish: {Out[12].text}
Reproduce
Run an %%ai command with -f text specified as an option. The output appears as Out[9] in the above example.
Run another %%ai command with {Out[9]} as part of the prompt.
The prompt is interpreted to have jupyter_ai_magics.magics.TextWithMetadata, not str, as the type of Out[9].
Expected behavior
When interpolating a TextWithMetadata object, like Out[n], into a text prompt, the text portion should be used.
Context
JupyterLab version: 3.5.3, with Jupyter AI 0.8.0
The text was updated successfully, but these errors were encountered:
Description
Interpolating the special
Out[]
array into a text prompt causes an object to be inserted into the prompt:Out[9]
should contain only the textA new moon has no illuminated portion visible, while a full moon has its entire disk fully illuminated by the sun.
Instead, it is aTextWithMetadata
object, not serialized as text when I interpolate it inIn[10]
, so what gets translated into Spanish is a Python descriptor of an object.One can work around this by calling
.text
on theOut[n]
object:Reproduce
%%ai
command with-f text
specified as an option. The output appears asOut[9]
in the above example.%%ai
command with{Out[9]}
as part of the prompt.jupyter_ai_magics.magics.TextWithMetadata
, notstr
, as the type ofOut[9]
.Expected behavior
When interpolating a
TextWithMetadata
object, likeOut[n]
, into a text prompt, the text portion should be used.Context
The text was updated successfully, but these errors were encountered: