# format_paste_ref

> **Function** in `deepagents_code`

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

Format a paste placeholder reference string.

## Signature

```python
format_paste_ref(
    paste_id: int,
    num_lines: int,
) -> str
```

## Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `paste_id` | `int` | Yes | The numeric paste identifier. |
| `num_lines` | `int` | Yes | The number of extra lines (newlines) in the pasted content. |

## Returns

`str`

`[Pasted text #N]` when `num_lines` is 0, otherwise

---

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