promptdojo_

What an agent leaves behind — step 8 of 9

Write a function summarize(trace) that takes a list of turns (each is a dict with n and stop_reason) and returns a single string in this exact form:

turns: N | tool_use: T | end_turn: E | other: O

...where N is the total number of turns, T is the count of tool_use stops, E is the count of end_turn stops, and O is the count of everything else.

Then call it on the provided trace and print the result.

Expected output:

turns: 5 | tool_use: 3 | end_turn: 1 | other: 1

full-screen editor opens — close anytime to keep reading.