Hi -
Long story short, I’m sending a prompt to OpenAI and asking for the response to be sent back in a JSON format. The issue is, that the JSON is one long string of text, not an actual JSON. The output looks something like this:
{
“Workout #1”: {
“Exercises”: [{
“Name”: “Bench Press”,
“Sets”: 4,
“Reps”: [
12,
15
]
},
{
“Name”: “Incline Press”,
“Sets”: 3,
“Reps”: [
12,
15
]
},
{
“Name”: “Incline Dumbbell Flye”,
“Sets”: 3,
“Reps”: [
12,
15
]
}
]
}
}
How can I parse this text into manageable data types and fields?