Source Code
agent-client-tutorial/02-read-and-transformWhat You’ll Build
A Spring Boot application that asks an agent to read log files, count severity levels (ERROR, WARNING, INFO), and produce a summary CSV. This demonstrates agents working with existing files and producing structured output.Step 1: Set Up Sample Data
Clone the tutorial repository and navigate to the lesson:auth.log, api.log, worker.log) with mixed severity levels.
Step 2: Understand the Goal
The goal is a multi-line prompt that specifies the input, the transformation, and the expected output format:Step 3: Run It
Step 4: Verify
Check the output CSV:What’s Different from Lesson 1
- Agent reads existing files — not just creating from scratch
- Multi-file input — the agent scans a directory of logs
- Structured output — the result is a well-defined CSV, not free text
- Data transformation — counting, aggregating, formatting