Hacker News new | past | comments | ask | show | jobs | submit login

There's nothing to switch to. You just enable it. No need to change the prompt or anything else. All it requires is that you mention "JSON" in your prompt, which you obviously already do.



You do need to change the prompt. You need to explicitly tell it to emit JSON, and in my experience, if you want it to follow a format you need to also provide that format.

I've found that this is pretty simple to do when you have a basic schema and there's no need to define one and enable function calling.

But in one of my cases, the schema is quite complicated, and "model doesn't produce JSON" hasn't been a problem for us in production. There's no incentive for us to change what we have that's working very well.


I think that’s only true when using ChatGPT via the web/app, not when used via API as they likely are. Happy to be corrected however.


If you don’t know, why speculate on something that is easy to look up in documentation?

https://platform.openai.com/docs/guides/text-generation/json...




Consider applying for YC's Spring batch! Applications are open till Feb 11.

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

Search: