while True:
response = llm(messages, tools)
if response.tool_call:
result = run_tool(response.tool_call)
messages.append(result)
else:
breakWatch the loop run. This is what every agent framework does.
Each lesson adds one concept. ~60 lines total.