Parse Json from OpenAI with '''json delimiter

Hello, I’m running an HTTP module to trigger an AI. In the AI’s prompt, I requested that the response be in JSON, so I then added another module (PARSE JSON) to extract the JSON parts for use in subsequent modules. However, I’m encountering an error when trying to parse the JSON. Analyzing the error and the output generated by the HTTP request module, it seems that the issue is occurring because the response from the HTTP request module comes with delimiters starting with ‘’‘json and ending with ‘’’.

It seems that the JSON parse module cannot identify the data because of this. Since I have little experience dealing with JSON files and limited knowledge of regex, I think I might be doing something wrong or forgetting something important. Could you help me solve this issue? Attached is the blueprint.

The result obtained by the HTTP module is:

[
  "Happiness is a choice that can be made regardless of external circumstances.",
  "Experiencing happiness can improve both physical and mental health.",
  "Sharing happiness with others can create a positive feedback loop, making everyone feel better."
]

blueprint_X.json (13.0 KB)

Thank you,
Bruno

Welcome to the Make community!

Please see these duplicate questions asked by others before you:

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 —

Getting Started

Help Centre Basics

Articles & Videos

Hope this helps! Let me know if there are any further questions or issues.

@samliew

P.S.: Investing some effort into the Make Academy will save you lots of time and frustration using Make.