logoalt Hacker News

swe_dimatoday at 3:45 PM2 repliesview on HN

OpenAI structured outputs are pretty stable for me. Gemini sometimes responds with a completely different structure. Gemini 3 flash with grounding sometimes returns json inside ```json...``` causing parsing errors.


Replies

euazOntoday at 4:24 PM

In case you're using OpenRouter, check out their new Response Healing feature that claims to solve exactly this issue.

https://openrouter.ai/announcements/response-healing-reduce-...

codegladiatortoday at 3:49 PM

https://github.com/josdejong/jsonrepair

might be useful ( i am not the author )