# DeterministicIntegrationChatModel

> **Class** in `deepagents_code`

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

Deterministic chat model for integration tests.

This subclasses `_ToolBindingFakeModel` (itself a `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. App 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. A bare `GenericFakeChatModel` inherits
    `BaseChatModel.bind_tools`, which raises `NotImplementedError` in any
    agent-loop context. The inherited `_ToolBindingFakeModel` supplies a
    no-op passthrough.

3. The app server reads `model.profile` for capability negotiation (e.g.
    `tool_calling`, `max_input_tokens`). A bare fake's `profile` is `None`,
    causing silent misconfiguration at runtime. The inherited
    `_ToolBindingFakeModel` supplies a minimal profile.

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

- `_ToolBindingFakeModel`

## Properties

- `model`

---

[View source on GitHub](https://github.com/langchain-ai/deepagents/blob/6a8d452d70f9bcb978e6bd44831dda093ecbe928/libs/code/deepagents_code/_testing_models.py#L50)