Function Calling
The ability of a model to call external programs: executing code, querying APIs, launching tools.
What It Changes
A regular model only generates text. A model with function calling can act: upon seeing a request like «what is the weather in Moscow?», it does not fabricate an answer but calls the function get_weather("Moscow") and responds based on the actual result.
How It Works
- You describe the available functions to the model.
- The model decides which function to call and with what arguments.
- Your code executes the function and returns the result.
- The model inserts the result into the response.
What Can Be Connected
- Weather, currency, map APIs;
- databases;
- calendar, email, messengers;
- custom services.
Why It Matters
Function Calling is the foundation of agents. This is how MCP, LangChain, and all modern AI assistants are built.