←back to thread

166 points EarlyOom | 1 comments | | HN request time: 0s | source
Show context
jasonjmcghee ◴[] No.43111653[source]
I've used "structured output" (with supplied schema) on Google and openai, and function calling / tool use on those, anthropic and others- and afaict they are functionally the same (if you force a specific function / schema). Has someone had a different experience?
replies(2): >>43111719 #>>43112057 #
fzysingularity ◴[] No.43111719[source]
They’re slightly nuanced - every model provider has a slightly different Pydantic /JSON schema compatibility (i.e for handling Literals, Unions, nested subtypes etc).

So you end up hitting roadblocks for seemingly simple Pydantic schemas.

replies(1): >>43111828 #
jasonjmcghee ◴[] No.43111828[source]
I meant between "structured output" and "function calling". Afaict one is outputting according to a schema and the other is outputting according to a schema... which will be used as the parameters to a function.

But they seem to be considered disparate concepts. So I'm trying to understand if there's some additional nuance I'm missing.

replies(2): >>43111942 #>>43111965 #
guntars ◴[] No.43111942[source]
With function calls the model may or may not output something that matches the schema, with structured output the schema is enforced at the logit level.
replies(1): >>43114509 #
1. jasonjmcghee ◴[] No.43114509{3}[source]
At least in the case of openai, you can set "strict" to "true" and function calling / tool use must / is enforced to follow the schema too.