Function Calling
Structured model requests for application-executed functions
What is Function Calling?
Function calling lets a model propose a named function and structured arguments. The application validates, authorizes, and executes the operation, then returns its result. A consistent schema does not make model decisions deterministic or arguments factually correct.
How it works
Read the diagram
- Arguments
- Validate
- Authorize
- Execute
Key takeaways
-
The application executes and authorizes the function.
-
Schema validity and argument correctness are separate checks.
Illustrative example
For an illustrative calendar request, ask which date, timezone, and Maria the user means before proposing create_event with those resolved fields. Validate the schema, obtain required approval, and use the returned event ID as confirmation.
Function calls versus structured output
Structured output constrains a response’s shape. A function call proposes an operation within a tool cycle. Both still need semantic validation. Missing dates, invalid identifiers, or unauthorized actions can fit a valid JSON schema. Retried side effects need duplicate prevention; a model saying “done” does not confirm that the service accepted the action.