How to Apply format as JSON safe

I’m sending this query to GPT-3.

“prompt”: “File text :\n\n\n\nResearch Question :\n\n\n”,

It works for some files. However, if the input is not json-safe, then it fails.

Exactly how/where should I insert “:formatted as JSON-safe” in order to clean up the input? Or, eg, should I first copy the text into a variable and then clean it up, and then just insert the variable name into the above statement? If so, please include code; I am not technical.

thanks.

1 Like

BTW: The query as shown in the question is incomplete (so the problem is not a missing quote at the end of the query. :yum:). The full query is readable in the attached picture.

I’m not sure if the JSON operator goes next to the input I have that takes document uploads, which is where I’m having issues section :slight_smile: