Episode five is where the series moves from simple chat completions to genuine agent behavior. By adding function invocation to the chat client and registering a few sample tools (get date/time, get weather, calculate), the model can now decide for itself which tools to call and loop back and forth with the app until it reaches a final answer. This is inherently non-deterministic, since the model chooses what to invoke and how often. The video’s most useful insight is about cost: because the entire conversation history gets resent to the model on every tool call, a handful of tool executions can multiply your token usage well beyond what a single chat call would cost, something worth watching closely once agents start making multiple internal calls per user request.
The code for this sample is here: https://github.com/michaelstephensonuk/azure-ai-samples/tree/main/05.helloworld.agent
