Return text from the first text block in an Anthropic content list.
(content: list[Any])
| 396 | |
| 397 | |
| 398 | def _extract_first_text(content: list[Any]) -> str: |
| 399 | """Return text from the first text block in an Anthropic content list.""" |
| 400 | for block in content: |
| 401 | if hasattr(block, "text"): |
| 402 | return block.text |
| 403 | return "" |
| 404 | |
| 405 | |
| 406 | async def _execute_tool( |