# should_collapse_paste

> **Function** in `deepagents_code`

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

Return whether `text` should be collapsed into a placeholder.

Collapses when the text exceeds the character threshold or the line
threshold.

## Signature

```python
should_collapse_paste(
    text: str,
) -> bool
```

## Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `text` | `str` | Yes | The pasted text to evaluate. |

## Returns

`bool`

`True` if the paste should be collapsed.

---

[View source on GitHub](https://github.com/langchain-ai/deepagents/blob/e14e0adcbe78565ed3650e7f24b2a775d5437d25/libs/code/deepagents_code/paste_collapse.py#L52)