Function calling lets a language model select and instantiate an appropriate software function, turning a user request into a structured action such as querying a database, running a calculation, or accessing another model. section 9.1
Website analytics report
A content application can issue a function call to gather website analytics, then use the returned data to create a report tailored to the client. The same system can expose functions for user-specific rewriting and analytical tasks. section 5.1.3
Reliable function calling requires attention to the execution boundary:
- Connect the model to downstream functions or plug-ins that impose defined interfaces and constraints. section 5.2.2
- Guard execution against faulty or harmful outputs, such as a generated DELETE query replacing a read-only SELECT query. section 5.2.2
- Improve structural reliability through function-calling models, constrained inference, schema validation, or provider APIs. section 5.2.3
- Evaluate models with function-calling benchmarks and application-specific tests rather than relying only on general language benchmarks. section 5.4.2
Figure 5.9 LMs can generate code that is automatically executed by downstream components.
A process diagram showing how a language model generates code or another structured request for automatic execution by downstream components. section 5.2.2






