top | item 45931450

(no title)

veonik | 3 months ago

I have had fairly bad luck specifying the JSONSchema for my structured outputs with Gemini. It seems like describing the schema with natural language descriptions works much better, though I do admit to needing that retry hack at times. Do you have any tips on getting the most out of a schema definition?

discuss

order

BoorishBears|3 months ago

Always have a top level object for one.

But also Gemini supports contrained generation which can't fail to match a schema, so why not use that instead of prompting?

astrange|3 months ago

Constrained generation makes models somewhat less intelligent. Although it shouldn't be an issue in thinking mode, since it can prepare an unconstrained response and then fix it up.