How to split text from Chat GPT output

Hi There, not sure if this is allowed but wondered if I could explain what I’m trying to do on a loom video?

Appreciate your help

Welcome to the Make community!

1. Screenshots of module fields and filters

Please share screenshots of relevant module fields and filters in question? It would really help other community members to see what you’re looking at.

You can upload images here using the Upload icon in the text editor:
Screenshot_2023-10-07_111039

2. Scenario blueprint

Please export the scenario blueprint file to allow others to view the mappings and settings. At the bottom of the scenario editor, you can click on the three dots to find the Export Blueprint menu item.

Screenshot_2023-08-24_230826
(Note: Exporting your scenario will not include private information or keys to your connections)

Uploading it here will look like this:

blueprint.json (12.3 KB)

3. And most importantly, Output bundles

Please provide the output bundles of the modules by running the scenario, then click the white speech bubble on the top-right of each module and select “Download output bundles”.
Screenshot_2023-10-06_141025

A.

Save the bundle contents in your text editor as a bundle.txt file, and upload it here into this discussion thread.

Uploading it here will look like this:

bundle.txt (12.3 KB)

B.

If you are unable to upload files on this forum, alternatively you can paste the formatted output bundle in this manner:

  • Either add three backticks ``` before and after the code, like this:

    ```
    input/output bundle content goes here
    ```

  • Or use the format code button in the editor:
    Screenshot_2023-10-02_191027

Providing the output bundles will allow others to replicate what is going on in the scenario even if they do not use the external service.

Following these steps will allow others to assist you here. Thanks!

2 Likes

Hello @christargett,

There are a couple ways you might go about this.

The first, you can try asking OpenAI to distinguish the rewrites from each other with some set of characters, like ###.
Then, with the result, you can use a split() function, using ### as the separator, which should create an array of text responses.
You can access each element of that array with a get() function and the number of the element you’re after.

Another way is to use a repeater before OpenAI, and an array aggregator after.
This would run the OpenAI module 5 times then deliver the results into an Array, which you access in the final Google Sheets module. This method uses more Ops and uses more OpenAI, but you wouldn’t have to deal with splitting the text from a single OpenAI call.

In both cases you update Google Sheets once.

2 Likes

Thank you for coming back to me on this I really appreciate it. Newbie here so thanks for your patience

I’m trying to do the first one you mentioned as seems the best way to do it and using less tokens with OpenAI

I have asked ChatGPT to do the following:

“Please reword this post 4 times and number each one and split each version with ###”

I’ve then added an iterator but not sure what I then need to do to make the split?

I want to then take each of the results and put them in different columns in Google Drive

Your help is very much appreciated thank you

You wouldn’t need to use an Iterator, just a split() function on ChatGPT’s result.
The result of the split is an array of 4 elements.
You can access each element using the get() function: get(array;#)

So if you’re output is this:
image

You can use split on it like this:
image

And the result:
image

Access each element like this:
image

Each of these get() functions would go into their respective fields in the Google Sheets module.

1 Like

Hi Donald, Thank You for your help on this I have done a video as I am having issues getting the results: SFB Rewrite x 5 | Make - 30 April 2024 | Loom

Thank you in advance

Hi @christargett,

We need to know exactly what the output on modules 2 and 34 look like because it almost looks like OpenAI split everything up for you already.

1 Like

Hi Donald,

thank you for all your help on this.

I found the issue - I had added another Tools module to get variables which was not needed I just took the information straight from the set variable module and put it into Google Sheets

Thank you for your help it’s very much appreciated

2 Likes