4 ms·
Thanks for sharing your experience. We also get pretty reliable JSON output (on a smaller scale though) even without JSON mode. We usually don't use JSON mode
by __jl__ 2y ago
Thanks for sharing your experience.
We also get pretty reliable JSON output (on a smaller scale though) even without JSON mode. We usually don't use JSON mode because we often include a chain of thought part in <brainstorming> and then ask for JSON in <json> tags. With some prompt engineering, we get over 98% valid JSON in complex prompts (with long context and modestly complex JSON format). We catch the rest with json5.loads, which is only used as a fallback if json.loads fails.
4o-mini has been less reliable for us particularly with large context. The new structured output might make it possible to use mini in more situations.
- borsch 2y agomy recommendation? use chain of thought, then feed that into a second prompt asking for json
- JimDabell 2y agoThe linked article includes a section on this, under “Separating a final answer from supporting reasoning or additional commentary”. They suggest defining a JSON schema with a reasoning field and an answer field.