# ModelOutputTruncatedError

> **Class** in `deepagents_code`

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

The model stopped before it gave any reply.

Subclasses `ValueError` so that the LangGraph server keeps the message when
it serializes the error for the client. Other exception types are redacted
to "An internal error occurred".

## Signature

```python
ModelOutputTruncatedError(
    self,
    truncation: OutputTruncation,
    model: str | None = None,
    *,
    no_usage: bool = False,
    has_reasoning: bool = False,
    invalid_tool_call: bool = False,
)
```

## Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `truncation` | `OutputTruncation` | Yes | Why the provider stopped the reply. |
| `model` | `str \| None` | No | Model identifier, when known. (default: `None`) |
| `no_usage` | `bool` | No | The provider reported zero tokens for the request, so the stated reason is likely not the real cause. (default: `False`) |
| `has_reasoning` | `bool` | No | The reply contained reasoning content. (default: `False`) |
| `invalid_tool_call` | `bool` | No | The reply contains an unparseable tool call. (default: `False`) |

## Extends

- `ValueError`

## Constructors

```python
__init__(
    self,
    truncation: OutputTruncation,
    model: str | None = None,
    *,
    no_usage: bool = False,
    has_reasoning: bool = False,
    invalid_tool_call: bool = False,
) -> None
```

| Name | Type |
|------|------|
| `truncation` | `OutputTruncation` |
| `model` | `str \| None` |
| `no_usage` | `bool` |
| `has_reasoning` | `bool` |
| `invalid_tool_call` | `bool` |


## Properties

- `truncation`
- `model`
- `no_usage`
- `has_reasoning`
- `invalid_tool_call`

---

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