Best way to clean chatgpt answers?

Hi everyone
I’m setting up a scenario where our personalized gpt answers our user and post the answer in Basecamp.

Anyway i’m having trouble with the last step: sometimes it gives me an error 400. I suspect because chatgpt is answering and inserting symbols like * \ or " that messes with the api call.

When this happens the output of the api call is null:

I tried to insert two steps to mitigate that:

  • an html to text parser
  • a replace function “replace(10. Text;”;emptystring)"

Any tip or suggestion?

Welcome to the Make community!

What are you trying to replace? replace(10. Text;”;emptystring) is not valid.

Did you mean to do this instead?

{{ replace(10.text; """; emptystring) }}

If you need further assistance, please provide the following:

  • Please provide a screenshot of it.

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:

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.


(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, Input/Output bundles

Please provide the input and output bundles of the trigger/iterator/aggregator modules by running the scenario (or get from the scenario History tab), then click the white speech bubble on the top-right of each module and select “Download input/output bundles”.

A.

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

Uploading them here will look like this:

module-1-output-bundle.txt (12.3 KB)

B.

If you are unable to upload files on this forum, alternatively you can paste the formatted bundles 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:

Providing the input/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!
samliewrequest private consultation

Join the Make Fans Discord server to chat with other makers!

Thanks! I was trying to replace " with an empty string :slight_smile:

This is the blueprint (i anonymized it)

blueprint.json (27.6 KB)

All you need is put 10.text variable in a “Transform to JSON” module, which automatically escapes (cleans) the text.

samliewrequest private consultation

Join the Make Fans Discord server to chat with other makers!

3 Likes

Unfortunately it doesn’t work, the output of the API CALL is

[
null
]

I can’t help you further, your blueprint was invalid, and the other requested information was not provided.

If your scenario contains sensitive data, and is not suitable for discussion on the forum, you can also hire a professional by posting in the #hire-a-pro:professional-services category.

Here are some useful links and guides you can use to learn more on how to use the Make platform, apps, and app modules. I found these useful when I was learning Make, and hope they might benefit you too —

General

Help Center Basics

Articles & Videos

samliewrequest private consultation

Join the Make Fans Discord server to chat with other makers!

I solved with nested replace functions. I think the problem was with the \n

2 Likes