Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> necessary to get the model to behave

Don't I know it. Despite my telling GPT-4 to ONLY respond as valid, well-formed JSON it keeps coming back with things like, "I'm not able to process external files but if I could, this is what the JSON would look like: []"



With a recent project, I was _moderately_ successful by providing a jsonschema to follow for the response. I still had to sanitize the json a bit, but the fixes were minor and the resulting data otherwise fit the schema well.


It'll do that. Just look for the largest substring that's valid JSON in the response.


why don’t you use the new JSON mode?


tl;dr the JSON mode is functionally useless and is made completely redundant by function calling / structured data if you really really need JSON output.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: