Parse JSON from ChatGPT / Claude (or any LLM)

Database & APIs

Hi! For my app I use Claude to generate a response for users and that is returned as a JSON that I want to parse to update the correct fields from the response. So it's different than just a flat text response.

The problem is that it get returned like this:
{\n \"dish\": \"Grilled Salmon with Quinoa and Roasted Vegetables\",\n \"ingredients\": [\n \"Atlantic Salmon\",\n \"Quinoa\",\n \"Broccoli\",\n \"Bell Peppers\",\n \"Olive Oil\",\n \"Lemon\"\n ],\n \"estimated_macros\": {\n \"protein\": 35,\n \"carbohydrates\": 45,\n \"fat\": 18\n },\n \"estimated_calories\": 480,\n \"serving_size\": \"1 serving\"\n}"

I think the delimiters are used to avoid errors, but now I can't use the native json paths as it's not recognized as json.

How can I parse this correctly, and update the right fields after the response for user?

Help is MUCH apprecaited!! Thank you ๐Ÿ™

What have you tried so far?

Tons of Youtube Videos, Claude, ChatGPT, Perplexity, couldn't find any solutions.

Did you check FlutterFlow's Documentation for this topic?
No