How to get an output in a File format in Content Generation Activity?

Hi All,

I understood the part of the new GenAI activity “Content Generation” where we prompt something to the model with some file for context grounding and we get a text output. However, I am now wondering, is it possible to get an excel/csv/text file as an output? I know gpt4o can do it.

Thank you.

Hi @harit.kulkarni,

Could you try using the Reformat activity from the Gen AI activities package?

You can feed the output from the content generation activity directly into the Reformat activity, which will help convert the data into the desired format.

For reference, you can find the supported input and output formats in the documentation here: Activities - Reformat

Input format: This field is optional, as the activity can automatically detect the format if not set. You can choose from formats like String, CSV, JSON, XML, YAML, HTML, Markdown, etc.

Output format: You can select the format you’d like from options like String, CSV, JSON, XML, YAML, HTML, Markdown, and the output will be provided as a String type, formatted as per your preference.

Once the data is converted into the desired format, you can use process automation activities like Write CSV or Convert JSON to DataTable, and then export it as a CSV to match the exact format you’re looking for.

Let me know if you need further help with this!

2 Likes

Hi @harit.kulkarni

You can use the Reformat Activity. But this will consume another additional AI unit.

I would recommend specifying the Output style in your Content Generation Activity’s System Prompt along with an example Input and Output.

It would still be of a String type, but the format will be maintained as per the one specified in the Prompt.

If your requirement is to have the Output as a file (output.csv, output.txt, …), i don’t think it’s possible, the output will always be a string.

I hope this answers your query

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.