Output Jupyter_ai magics %%ai cell output

Hello everyone,

I would like to retrieve the cell output after %%ai magic run to write it to a file, preferably into xlsx. Could someone help please.