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
%%ai is such a cumfortable way to call many AI services that sometimes, I would like use it as a function instead of sending the output straight into the next cell.
π― Objectives
The main purpose of this issue is to:
If already possible : document how to send output into a variable
If not already possible : Make it possible to send output into a variable (then document it π )
The text was updated successfully, but these errors were encountered:
@adriens Thanks for opening this issue! You can use IPython's built-in %%capture magic command to capture the outputs of a cell, including a cell that contains a magic command.
In one cell, run:
%%capture earth
%%ai anthropic:claude-v1
Tell me interesting facts about the size of the Earth
Then, in the following cell, you can iterate over the outputs and display them:
for o in earth.outputs:
display(o)
Alternatively, you can use the special Out variable to refer to a cell's outputs. Each cell you run has a number, which corresponds to the index of Out that refers to the cell's outputs. If you run the following command in a cell, which gets assigned to number 14:
%%ai anthropic:claude-v1
Tell me interesting facts about the size of the Earth
Then, after this cell finishes running, you can refer to its outputs as Out[14].
β About
%%ai
is such a cumfortable way to call many AI services that sometimes, I would like use it as a function instead of sending the output straight into the next cell.π― Objectives
The main purpose of this issue is to:
The text was updated successfully, but these errors were encountered: