# reasoning_text

> **Function** in `deepagents_code`

📖 [View in docs](https://reference.langchain.com/python/deepagents-code/_content_blocks/reasoning_text)

Extract renderable reasoning text from a content block.

## Signature

```python
reasoning_text(
    block: object,
) -> str | None
```

## Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `block` | `object` | Yes | One entry of `AIMessage.content_blocks`. Typed loosely because the three surfaces reach it through differently typed streams. |

## Returns

`str | None`

The block's reasoning text, or `None` when the block is not reasoning

---

[View source on GitHub](https://github.com/langchain-ai/deepagents/blob/4bfa52000ef65ac623d8ada0cb67f67cbdd663ea/libs/code/deepagents_code/_content_blocks.py#L14)