promptdojo_

Wire the real model — swap fake_llm for the Anthropic SDK shape — step 7 of 9

The loop is reading .text on every block in response.content, but one of the blocks is a tool_use block that has no .text attribute — it has .name, .input, .id. The current code raises AttributeError on that block.

Fix the loop to branch on block.type first, so text blocks emit their text and tool_use blocks emit their name.

Expected output:

TEXT: Let me search.
TOOL: search
The break is on line 18 — but read the whole snippet first.

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