Lab 06
Tool Calling Lab
A model does not run code. It emits a structured request, and your program decides whether to honour it — which is where every permission decision lives.
Educational simulation. Tool selection here is keyword matching, not a model deciding. Four of the five tools return fixed sample data; the calculator genuinely computes. Nothing contacts a real service.
Ask something
What happens
- RequestWhat's 25 × 48?
- Decidetool needed
- Select toolCalculator
- Arguments
- Executecomputed
- Answer
Reading the result
- What just happened
- The request was routed to Calculator, which was called with structured arguments and returned a value the model could not have produced on its own.
- Why it matters
- The model never runs anything. It emits a request to run something, and your code decides whether to honour it. Every permission decision in an AI system lives in that gap.
- Where you meet this
- This is how an assistant checks a live price, reads your calendar, or queries a database. It is also why a model with a calculator gets arithmetic right and one without it does not.
Available tools
Calculatorcomputed
Evaluates an arithmetic expression exactly.
Weathersample data
Returns a weather observation for a city.
Searchsample data
Searches an internal knowledge base and returns matching passages.
Databasesample data
Runs a read-only query against a sample orders table.
Calendarsample data
Reads events from a sample calendar.
Filesample data
Reads a file from a small sample workspace.
API requestsample data
Models an HTTP request and returns a status code with a JSON body. Makes no real request.