Function Calling
Function calling is an AI model capability where the model analyzes a user's prompt and generates structured JSON specifying which external function to invoke and what arguments to pass. The model does not execute the function itself — it outputs the function name and parameters, and your application code handles the actual execution and returns results for the model to incorporate into its response.
Example
You ask a chatbot "What's the weather in Tokyo?" and provide a get_weather function definition via the API. The model returns {"name": "get_weather", "arguments": {"location": "Tokyo"}}. Your app calls the weather API, gets 72°F and sunny, and passes that back to the model, which responds: "It's currently 72°F and sunny in Tokyo."
Put this into practice
Build polished, copy-ready prompts in under 60 seconds with SurePrompts.
Try SurePrompts