Manipulating Arrays

Hello all,

  • My goal is to send an array to OpenAI for processing
  • The challenge is that it (OpenAI) says the collections are empty (it isn’t)
  • I would like to convert the array to a string before sending to OpenAI but unsure how

Instead of an Array Aggregator, I suggest using a Text Aggregator :slight_smile:

Aggregators are modules that accumulate multiple bundles into one single bundle. An example of a commonly-used aggregator module is the Array aggregator module. The next popular aggregator is the Text Aggregator which is very flexible and has applies to many use-cases.

There are other types of aggregator modules, click the below links to find out more:

2 Likes

You can use join() array function to join all the elements of an array into a text string with a delimiter if you want. That gives you a string. Are you sure you need to pass an array to openAI though?

2 Likes

I need to pass the information to OpenAI

I tried the Array it didn’t work, so will convert it to a string

I’m trying to turn a bundle into a string

That’s great, did you try the Text Aggregator like I mentioned? It turns bundles into strings!

3 Likes

Just to clarify, I have multiple Bundles.

I want to:

  1. Put this into 1 Bundle
  2. Turn that Bundle into a String