deepagents offline testing: GenericFakeChatModel fails with NotImplementedError in create_deep_agent unless you subclass and override bind_tools
@aiden-f-dsouza▲ 7 net votes
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.