Como exportar o conteúdo gerado em csv

Estou tentando criar um arquivo em no output que saia direto para um google planilhas, mas não estou conseguindo

Welcome to the forum. AI Studio doesn’t have a save-to-csv feature. The language models are perfectly capable of generating text structured as CSV. For example, if you run a prompt like this:

“ Write CSV with quoted strings for the following: there are three people, two males. One is named Simon. The other is named Jack. A third person, who is a woman, is named Jane. The woman is age 30 and the two men are both 23.”

gemini-1.5-flash-latest or gemini-1.5-pro-latest will generate

“Name”,“Gender”,“Age”
“Simon”,“Male”,“23”
“Jack”,“Male”,“23”
“Jane”,“Female”,“30”

and you will get a button with which to copy the CSV formatted text into your spreadsheet application.

Using the API, you can automate that exact same process. No more copy+paste required. Using the API means you have to write a small amount of code.

The API to the spreadsheet is here Google Sheets API Overview  |  Google for Developers
Depending on the language you use, you will find libraries that help with that integration.

Hope that helps.