promptdojo_
Checkpoint

One last thing before we move on. Same surface as a write step — but the lesson doesn't complete until this passes.

Final drill. Build a session-level aggregator across multiple responses. Write summarize_session(responses) that:

  • For each response in the list, calls parse_response(r) (provided).
  • Aggregates across all responses:
    • total_text: all text fields joined with " | " (skip empty texts).
    • tool_call_count: total number of tool_use blocks across all responses.
    • total_tokens: sum of tokens across all responses.
    • final_stop: the stop_reason of the LAST response.
  • Returns the aggregate dict.

Two sessions run. Expected output:

agent session: text='Searching... | Found Tokyo ramen guide.' tools=1 tokens=180 final=end_turn
truncated session: text='Starting...' tools=0 tokens=1024 final=max_tokens

this step needs the editor

on desktop today; in the app (coming soon). save your spot and we'll bring you back here when you're ready.

open this same url on a laptop to keep going today.