Hacker News new | ask | show | jobs
by slashtmpslashme 392 days ago
Use structured output / response format with JSON schema feature if your models provide it (openai for sure does, I think it's json_schema instead of json_object and provide a schema).

Otherwise there are libraries like instructor (python) which can help to generate json in markdown code blocks.