Using text parser outputs as input in subsequent steps using Array aggregator

I use the text parser to extract different bundles from an Open AI response. Open AI divides its answer into different sections. Each section is formatted with a {Start Tag} and {/End Tag}.

I managed to get the text parser to work, but I want to use each section’s responses as inputs in subsequent steps. I used the array aggregator to transform the various bundles returned by the text parser into an array, but I cannot get the array to be formatted correctly.

The array should have separate sections for each of the following & return the response returned by OpenAI for each:
{Tweet Pitch}
{Long Description}
{Global Problems}
{Tags}

Here is the configuration of the text parser:

Here is what the text parser returns:

Here is the configuration of the array aggregator:

Here is what the array aggregator returns:

Here are items available in the array in subsequent steps:
Screenshot 2024-03-08 at 14.26.32

Any help on how I can get the array to be formatted correctly so that I can use the content of each as separate inputs to subsequent steps would be great.

How about instead of using the array aggregator, use a text aggregator that allows you to create the necessary JSON that containts the values you want and the keys for each collection properly mapped? Then you can use the Parse JSON module in the JSON app that will create the necessary output bundles from the structure you can use later in the scenario.

2 Likes

That’s very helpful. I changed the OPENAI prompt to provide a response in JSON format and am now using the result of the JSON array. Thank you!

3 Likes

That’s brilliant and smart!

2 Likes