reading agent traces and telemetry8 / 9
what an agent leaves behind
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
⌘↵ runs the editor.
Booting Python…
Output
[promptdojo:~]$ _