Tool Calling
An LLM only knows what it learned in training and what is in your prompt. It cannot check your train ticket or send an email. With tool calling, the model asks your code to do these jobs. Then it uses the result to answer.
New words
- Tool calling
- The model asks your code to run a function, then uses the result.
- Schema
- A form that lists the inputs a tool takes and the type of each.
- Agent loop
- The cycle of asking the model, running its tool and sending back the result.
- Round trip
- One request to the model and its reply.
- Latency
- The time you wait before the answer arrives.
- Side effect
- An action that changes something real, such as a refund or an email.
- Least privilege
- Give a tool only the smallest access it needs.
What you will learn
- Why does the model need tools?
- How does tool calling work?
- Try it: follow the agent loop step by step
- How do you write good tools?
- What can go wrong?
- Habits for a real system
- In code
- In a real system
- Interview tip
- Key takeaways
10 quiz questions at the end.
The full lesson, with interactive demos and the quiz, opens after you sign in with Google. It is free.