🎓 All Courses | 📚 OpenAI API University Syllabus
Stickipedia University
📋 Study this course on TaskLoco

Function calling lets the model decide when to call your functions and with what arguments — the foundation of AI agents.

How It Works

  1. Define functions with name, description, and parameter schema
  2. Pass them to the API in the tools parameter
  3. Model returns a tool_calls object when it wants to call a function
  4. Your code executes the function
  5. Return the result to the model to continue

Example Tool Definition

tools = [{
    "type": "function",
    "function": {
        "name": "get_weather",
        "description": "Get current weather for a city",
        "parameters": {
            "type": "object",
            "properties": {
                "city": {"type": "string"}
            },
            "required": ["city"]
        }
    }
}]

YouTube • Top 10
OpenAI API University: Function Calling — Give the Model Tools
Tap to Watch ›
📸
Google Images • Top 10
OpenAI API University: Function Calling — Give the Model Tools
Tap to View ›

Reference:

Function calling documentation

image for linkhttps://en.wikipedia.org/wiki/Special:Search?search=Function%20Calling

📚 OpenAI API University — Full Course Syllabus
📋 Study this course on TaskLoco

TaskLoco™ — The Sticky Note GOAT