I have a prompt that worked well with GPT 4 and returned the response in JSON format, but now as I’m testing 4 Turbo modal its not working as expected.
The repones has the following in the begging it: “``json”
And that is something that is ‘messing up’ my system that is expecting a JSON formatted response.
Removing the json text from the beginning is definitely the simple solution I went with meanwhile.
I am just worried that this is not stable enough, that the ‘prefix’ might change and corrupt the response again.
Wondering if there’s a known solution to ‘not’ receive it originally in the response
Using JSON mode as suggested by sps should resolve the problem and only return the JSON object. I have justed tested it with a few different examples using both gpt-4-1106-preview and gpt-4-0125-preview and it worked fine, i.e. no more ``json was included in the response.