Learn/Core Concept How does function calling work in LLMs? Function calling lets LLMs invoke external APIs or tools by generating structured JSON matching predefined schemas, rather than just producing text. The model learns to output function names and parameters when tasks require external data or actions. This enables agents to perform calculations, query databases, or control systems whilst maintaining conversational flow. It's why modern AI assistants can book flights or run code snippets. Structured OutputTool Use |