Codele / LLMs, RAG and agentic AI
Tool calling
A model can only write text. So how does it check the weather or do a sum? It writes a request, and the program around it does the real work. Pick a question.
- A model only writes text. A tool call is text in an agreed format that asks the program to do something.
- The program around the model runs the real function and pastes the result back as more text.
- The model chooses whether to call a tool. Some questions need none. It can choose wrongly, so programs check requests.
- A tool can be any small function: a calculator, a weather lookup, a database search. Only offer tools you are happy for the model to ask for.
- In this lesson a hand-written rule stands in for the model, and the tools return made-up data. It is a toy that shows the mechanism.
Loading the playable lesson…