Function Calling
A feature that lets an AI model trigger specific functions or APIs in your app instead of just returning text.
In plain English
Function calling (also called tool use) lets you tell an AI model about functions it can invoke — for example, get_weather(city) or search_database(query). When the model decides it needs that information, it outputs a structured request for your code to execute, then uses the result in its reply.
Example flow:
- User asks: "What's the weather in Tokyo?"
- Model outputs:
{ "function": "get_weather", "args": { "city": "Tokyo" } } - Your code calls the real weather API
- Model receives the result and writes a natural language response
This is how AI assistants do anything beyond text — searching the web, reading calendars, updating databases, or controlling software.