Definition
Function calling enables large language models to interact with external tools and APIs by generating structured outputs, such as JSON objects, that specify which function to execute and what arguments to pass. This bridges the gap between natural language understanding and programmatic action, allowing models to perform calculations, retrieve real-time data, or control devices without hallucinating code. It is essential for building robust agentic workflows where the model acts as a controller for external systems rather than just a text generator.
Summary
A mechanism allowing LLMs to output structured data that triggers specific software functions.
Key Concepts
- Structured Output
- API Integration
- Tool Use
- JSON Schema
Use Cases
- Booking flights via travel APIs
- Performing complex mathematical calculations
- Querying database records