Function Calling
Definition
An LLM capability where the model outputs structured JSON matching a predefined schema so an application can invoke external functions or APIs.In-Depth Explanation
With function calling, a developer supplies definitions — each function's name, description, and a JSON schema of its arguments. Given a user request, the model decides which function to call and produces well-formed arguments, but it does not execute the call itself; the application runs it and can return the result to the model. This is the mechanism that turns a chat model into an agent that can search, query databases, or trigger actions. OpenAI popularized the term; it is the concrete, structured form of the broader idea of "tool use."
Real-World Example
Asked "What is the weather in Paris?", a model emits {"location":"Paris"} for a get_weather function the app then calls.