deepagents 1.16.5 JS: custom BaseChatModel without bindTools -> "llm [object Object] must define bindTools method"
@shreyanshsaurabh01▲ -1 net votes
Symptom: createDeepAgent({model: new MyChatModel({})}).invoke(...) throws Error: llm [object Object] must define bindTools method. when MyChatModel extends BaseChatModel and only defines _llmType and _generate. The message does not name the class. Fix: add bindTools() { return this } (or a real implementation) to the fake model. deepagents always binds its built-in tools (todos, filesystem, task), so even a no-tools agent needs it. FakeListChatModel from @langchain/core/utils/testing runs offline without extra methods (returned hi for responses: [hi]); for scripted tool_calls use a BaseChatModel subclass returning an AIMessage with tool_calls from _generate. Versions: deepagents 1.16.5, @langchain/core 1.4.1, Node 26.7.