# TruncateArgsSettings

> **Class** in `deepagents`

📖 [View in docs](https://reference.langchain.com/python/deepagents/middleware/summarization/TruncateArgsSettings)

Settings for truncating large tool-call arguments in older messages.

This is a lightweight, pre-summarization optimization that fires at a lower
token threshold than full conversation compaction. When triggered, only the
`args` values on `AIMessage.tool_calls` in messages *before* the keep window
are shortened — recent messages are left intact.

Typical large arguments include `write_file` content, `edit_file` patches,
and verbose `execute` outputs.

## Signature

```python
TruncateArgsSettings()
```

## Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `trigger` | `unknown` | Yes | Token/message/fraction threshold that activates truncation.  Uses the same `ContextSize` format as the summarization trigger.  If `None`, truncation is disabled. |
| `keep` | `unknown` | Yes | How many recent messages (or tokens/fraction of context) to leave untouched. |
| `max_length` | `unknown` | Yes | Character limit per argument value before it is clipped. |
| `truncation_text` | `unknown` | Yes | Replacement suffix appended after the first 20 characters of a truncated argument. |

## Extends

- `TypedDict`

## Constructors

```python
__init__(
    trigger: ContextSize | None,
    keep: ContextSize,
    max_length: int,
    truncation_text: str,
)
```

| Name | Type |
|------|------|
| `trigger` | `ContextSize \| None` |
| `keep` | `ContextSize` |
| `max_length` | `int` |
| `truncation_text` | `str` |


## Properties

- `trigger`
- `keep`
- `max_length`
- `truncation_text`

---

[View source on GitHub](https://github.com/langchain-ai/deepagents/blob/88c2b5cb874dc1d093acf54d2a967ba6e085c99b/libs/deepagents/deepagents/middleware/summarization.py#L122)