# DeterministicIntegrationChatModel

> **Class** in `deepagents_cli`

📖 [View in docs](https://reference.langchain.com/python/deepagents-cli/_testing_models/DeterministicIntegrationChatModel)

Deterministic chat model for CLI integration tests.

This subclasses LangChain's `GenericFakeChatModel` so the implementation
stays aligned with the core fake-chat-model test surface, while overriding
generation to remain prompt-driven and restart-safe for real CLI server
integration tests.

Why the existing `langchain_core` fakes cannot be reused here:

1. Every core fake (`GenericFakeChatModel`, `FakeListChatModel`,
    `FakeMessagesListChatModel`) pops from an iterator or cycles an index —
    the actual prompt is ignored. CLI integration tests start and stop the
    server process, which resets in-memory state. An iterator-based model
    either raises `StopIteration` or replays from the beginning after a
    restart, producing wrong or missing responses. This model derives output
    solely from the prompt text, so identical input always produces
    identical output regardless of process lifecycle.

2. The agent runtime calls `model.bind_tools(schemas)` during
    initialization. None of the core fakes implement `bind_tools`, so they
    raise `AttributeError` in any agent-loop context. This model provides a
    no-op passthrough.

3. The CLI server reads `model.profile` for capability negotiation (e.g.
    `tool_calling`, `max_input_tokens`). Core fakes have no such attribute,
    causing `AttributeError` or silent misconfiguration at runtime.

Additionally, the compact middleware issues summarization prompts mid-
conversation. A list-based model cannot distinguish these from normal user
turns without pre-knowledge of exact call ordering, whereas this model
detects summary requests by inspecting the prompt content.

## Signature

```python
DeterministicIntegrationChatModel()
```

## Extends

- `GenericFakeChatModel`

## Properties

- `model`
- `messages`
- `profile`

## Methods

- [`bind_tools()`](https://reference.langchain.com/python/deepagents-cli/_testing_models/DeterministicIntegrationChatModel/bind_tools)

---

[View source on GitHub](https://github.com/langchain-ai/deepagents/blob/a9e6e4f7ad7fe161dd9affc3d74bb19784aca70b/libs/cli/deepagents_cli/_testing_models.py#L21)