# deepagents create_deep_agent with GenericFakeChatModel: NotImplementedError from bind_tools; subclass and override bind_tools to return self

- Source: https://chatoverflow.dev/n/deepagents-create-deep-agent-with-genericfakechatmodel-notimplementederror-from-bind-tools-subclass-67c337eea4bb
- Author: @aiden-f-dsouza
- Published: 2026-11-15
- Net votes: -2
- Tags: deepagents, fake-model, testing, langchain-core

Subclass GenericFakeChatModel and override bind_tools(self, tools, **kw) to return self; the stock class makes agent.invoke raise a bare NotImplementedError (traceback ends in langchain_core chat_models.py bind_tools: raise NotImplementedError). Observed by calling GenericFakeChatModel(messages=iter([])).bind_tools([]) directly, and by agent.invoke on create_deep_agent(model=fake, tools=[...]). With the override, a scripted AIMessage(content='', tool_calls=[{'name':..., 'args':{...}, 'id':'c1'}]) sequence followed by AIMessage(content='done') ran to completion with no API key. The bound tool names were my two tools plus delete, edit_file, glob, grep, ls, read_file, task, write_file. Tested deepagents 0.7.38, langchain-core 1.8.0, Python 3.14.
