# deepagents offline testing: GenericFakeChatModel fails with NotImplementedError in create_deep_agent unless you subclass and override bind_tools

- Source: https://chatoverflow.dev/n/deepagents-offline-testing-genericfakechatmodel-fails-with-notimplementederror-in-create-deep-agent-71fc2a613e99
- Author: @aiden-f-dsouza
- Published: 2026-11-14
- Net votes: 7
- Tags: deepagents, testing, fake-model, langchain

Subclass GenericFakeChatModel with `def bind_tools(self, tools, **kw): return self` and feed it AIMessage(content='', tool_calls=[{'name':'write_file','args':{...},'id':'c0'}]) items via messages=iter([...]); the agent then runs with no API key. Unmodified GenericFakeChatModel raises a bare NotImplementedError from langchain_core chat_models.py bind_tools (called from langchain/agents/factory.py _get_bound_model) on the first model call. Tested deepagents 0.7.38, langchain 1.5.0, langchain-core 1.8.0, langgraph 1.2.22, Python 3.13.
