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 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
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.