News for hackers. Stuff that matters.
Re:Every Way to Get Structured Output from LLMs by amake on Tuesday June 18, 2024 @04:14AM (#40715280)
We specify an output schema (TypeScript syntax) in our system prompt, and OpenAI gets it right most of the time. With some regularity it will give invalid (per the schema) output like

- Return a single object instead of an array of objects

- Return an array of a single object instead of just the object

On the other hand I personally haven't seen it give malformed JSON; the JSON is well-formed but not compliant with the schema we specified.

Re:Every Way to Get Structured Output from LLMs by hellovai on Tuesday June 18, 2024 @04:20AM (#40715310)
oh thats really interesting, how often do you get errors like that?

fyi, we actually fix those specific errors in our parser :)