Comparison
Function calling / tool callingvsStructured output
Function calling / tool calling
the model replies with the name of one of your functions and its arguments instead of an answer, and your code runs it and hands the result back.
The model, given a list of tool definitions, replying with a structured request to call one, naming the tool and supplying JSON arguments. The model never executes anything; it only asks. Your code executes and returns the result. The two names are interchangeable.
Full entry →Structured output
you need JSON your code can parse rather than prose, so you constrain the shape of the response instead of writing a regex over the answer.
Any technique for making the model produce machine-parseable output, almost always JSON matching a schema. The difference between a demo and a product is usually whether this layer is reliable.
Full entry →