lesson 3 of 4 · reading the response — content blocks, stop_reason, usagereading the response — content blocks, stop_reason, usagereading the response — content blocks, stop_reason, usagereading the response — content blocks, stop_reason, usagereading the response — content blocks, stop_reason, usagereading the response — content blocks, stop_reason, usagereading the response — content blocks, stop_reason, usagereading the response — content blocks, stop_reason, usagereading the response — content blocks, stop_reason, usagereading the response — content blocks, stop_reason, usagereading the response — content blocks, stop_reason, usagelesson 3 of 4 · reading the response — content blocks, stop_reason, usagereading the response — content blocks, stop_reason, usagereading the response — content blocks, stop_reason, usagereading the response — content blocks, stop_reason, usagereading the response — content blocks, stop_reason, usagereading the response — content blocks, stop_reason, usagereading the response — content blocks, stop_reason, usagereading the response — content blocks, stop_reason, usagereading the response — content blocks, stop_reason, usagereading the response — content blocks, stop_reason, usagereading the response — content blocks, stop_reason, usagelesson 3 of 4 · reading the response — content blocks, stop_reason, usagereading the response — content blocks, stop_reason, usagereading the response — content blocks, stop_reason, usagereading the response — content blocks, stop_reason, usagereading the response — content blocks, stop_reason, usagereading the response — content blocks, stop_reason, usagereading the response — content blocks, stop_reason, usagereading the response — content blocks, stop_reason, usagereading the response — content blocks, stop_reason, usagereading the response — content blocks, stop_reason, usagereading the response — content blocks, stop_reason, usagelesson 3 of 4 · reading the response — content blocks, stop_reason, usagereading the response — content blocks, stop_reason, usagereading the response — content blocks, stop_reason, usagereading the response — content blocks, stop_reason, usagereading the response — content blocks, stop_reason, usagereading the response — content blocks, stop_reason, usagereading the response — content blocks, stop_reason, usagereading the response — content blocks, stop_reason, usagereading the response — content blocks, stop_reason, usagereading the response — content blocks, stop_reason, usagereading the response — content blocks, stop_reason, usagelesson 3 of 4 · reading the response — content blocks, stop_reason, usagereading the response — content blocks, stop_reason, usagereading the response — content blocks, stop_reason, usagereading the response — content blocks, stop_reason, usagereading the response — content blocks, stop_reason, usagereading the response — content blocks, stop_reason, usagereading the response — content blocks, stop_reason, usagereading the response — content blocks, stop_reason, usagereading the response — content blocks, stop_reason, usagereading the response — content blocks, stop_reason, usagereading the response — content blocks, stop_reason, usagelesson 3 of 4 · reading the response — content blocks, stop_reason, usagereading the response — content blocks, stop_reason, usagereading the response — content blocks, stop_reason, usagereading the response — content blocks, stop_reason, usagereading the response — content blocks, stop_reason, usagereading the response — content blocks, stop_reason, usagereading the response — content blocks, stop_reason, usagereading the response — content blocks, stop_reason, usagereading the response — content blocks, stop_reason, usagereading the response — content blocks, stop_reason, usagereading the response — content blocks, stop_reason, usagelesson 3 of 4 · reading the response — content blocks, stop_reason, usagereading the response — content blocks, stop_reason, usagereading the response — content blocks, stop_reason, usagereading the response — content blocks, stop_reason, usagereading the response — content blocks, stop_reason, usagereading the response — content blocks, stop_reason, usagereading the response — content blocks, stop_reason, usagereading the response — content blocks, stop_reason, usagereading the response — content blocks, stop_reason, usagereading the response — content blocks, stop_reason, usagereading the response — content blocks, stop_reason, usagelesson 3 of 4 · reading the response — content blocks, stop_reason, usagereading the response — content blocks, stop_reason, usagereading the response — content blocks, stop_reason, usagereading the response — content blocks, stop_reason, usagereading the response — content blocks, stop_reason, usagereading the response — content blocks, stop_reason, usagereading the response — content blocks, stop_reason, usagereading the response — content blocks, stop_reason, usagereading the response — content blocks, stop_reason, usagereading the response — content blocks, stop_reason, usagereading the response — content blocks, stop_reason, usagelesson 3 of 4 · reading the response — content blocks, stop_reason, usagereading the response — content blocks, stop_reason, usagereading the response — content blocks, stop_reason, usagereading the response — content blocks, stop_reason, usagereading the response — content blocks, stop_reason, usagereading the response — content blocks, stop_reason, usagereading the response — content blocks, stop_reason, usagereading the response — content blocks, stop_reason, usagereading the response — content blocks, stop_reason, usagereading the response — content blocks, stop_reason, usagereading the response — content blocks, stop_reason, usagelesson 3 of 4 · reading the response — content blocks, stop_reason, usagereading the response — content blocks, stop_reason, usagereading the response — content blocks, stop_reason, usagereading the response — content blocks, stop_reason, usagereading the response — content blocks, stop_reason, usagereading the response — content blocks, stop_reason, usagereading the response — content blocks, stop_reason, usagereading the response — content blocks, stop_reason, usagereading the response — content blocks, stop_reason, usagereading the response — content blocks, stop_reason, usagereading the response — content blocks, stop_reason, usagelesson 3 of 4 · reading the response — content blocks, stop_reason, usagereading the response — content blocks, stop_reason, usagereading the response — content blocks, stop_reason, usagereading the response — content blocks, stop_reason, usagereading the response — content blocks, stop_reason, usagereading the response — content blocks, stop_reason, usagereading the response — content blocks, stop_reason, usagereading the response — content blocks, stop_reason, usagereading the response — content blocks, stop_reason, usagereading the response — content blocks, stop_reason, usagereading the response — content blocks, stop_reason, usage
Checkpoint
One last thing before we move on. pass this to mark the lesson done, or skip and keep moving. hop to the next when you're ready.
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: alltextfields joined with" | "(skip empty texts).tool_call_count: total number of tool_use blocks across all responses.total_tokens: sum oftokensacross all responses.final_stop: thestop_reasonof 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