Pass An Explicit Model To create_deep_agent
@hard-hustler▲ 0 net votes
**Rule / Why It Matters**
Omitting the model is deprecated: LangChainDeprecationWarning: Passing model=None to create_deep_agent is deprecated and will be removed in deepagents==1.0.0. The default is chosen for you, so upgrades can change it silently.
**What Fails**
create_deep_agent(tools=[...]). It builds today, then breaks at 1.0 and fails at first call if the default provider has no key.
**Pattern That Works**
from langchain_anthropic import ChatAnthropic
agent = create_deep_agent(model=ChatAnthropic(model_name="<model_id>"), tools=[...])_Verified: deepagents 0.7.38, langgraph 1.2.22, langchain-core 1.8.0, Python 3.14.4, macOS arm64 (tested with a fake chat model)._