deepagents-python-quickstart

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Deep Agents Python quickstart

Deep Agents Python快速入门

Follow the live docs — do not invent an alternate API from memory:
Fetch that page (Docs MCP or HTTP) and implement the research-agent shape it shows (
create_deep_agent
, research system prompt, invoke with a research question like “What is LangGraph?”).
请遵循在线文档操作——不要凭记忆自行设计替代API:
获取该页面内容(通过Docs MCP或HTTP)并实现其中展示的research-agent结构(
create_deep_agent
、研究系统提示词、传入研究问题如“What is LangGraph?”进行调用)。

Local setup constraints

本地设置约束

Apply these on top of the quickstart (they keep setup minimal and model-agnostic):
  1. Ask which provider/model to use. Showcase that Deep Agents are model-agnostic. Suggested prompt:
    Which model should this agent use? Pass a
    provider:model
    string — e.g.
    openai:gpt-5.5
    ,
    anthropic:claude-sonnet-5
    ,
    google_genai:gemini-3.5-flash
    . Default if you're unsure:
    anthropic:claude-sonnet-5
    .
    We'll use that provider's built-in web search (no separate search API key).
  2. Create a new directory (e.g.
    deep-agent/
    ) and do all work there — do not pollute the open project.
  3. Do not use Tavily (or any second search vendor). Replace the quickstart's
    internet_search
    / Tavily tool with the chosen provider's built-in web search. Look up the current tool shape on that provider's LangChain chat docs (examples as of writing — re-check if needed):
    ProviderBuilt-in search tool
    Anthropic
    {"type": "web_search_20260209", "name": "web_search", "max_uses": 5}
    OpenAI
    {"type": "web_search"}
    Google
    {"google_search": {}}
    Prefer Anthropic / OpenAI / Google so provider search is available. Only secret: that provider's API key in
    .env
    (gitignored). Skip LangSmith tracing unless they ask.
  4. Install
    deepagents
    (+
    python-dotenv
    ) and the provider package for their model — not
    tavily-python
    .
  5. Run the research example, show output, then stop. Point to
    deep-agents-core
    / customization / Managed Deep Agents for next steps.
在快速入门基础上应用以下约束(这些约束可保持设置极简且与模型无关):
  1. 询问要使用的提供商/模型。展示Deep Agents的模型无关特性。建议提示词:
    该代理应使用哪个模型?请传入
    provider:model
    格式的字符串——例如
    openai:gpt-5.5
    anthropic:claude-sonnet-5
    google_genai:gemini-3.5-flash
    。若不确定,默认使用:
    anthropic:claude-sonnet-5

    我们将使用该提供商的内置网页搜索功能(无需单独的搜索API密钥)。
  2. 创建一个目录(例如
    deep-agent/
    )并在其中完成所有操作——不要污染现有项目。
  3. 不要使用Tavily(或任何其他第三方搜索供应商)。将快速入门中的
    internet_search
    /Tavily工具替换为所选提供商的内置网页搜索。请查阅该提供商LangChain聊天文档中的当前工具结构(撰写本文时的示例——如有需要请重新核对):
    提供商内置搜索工具
    Anthropic
    {"type": "web_search_20260209", "name": "web_search", "max_uses": 5}
    OpenAI
    {"type": "web_search"}
    Google
    {"google_search": {}}
    优先选择Anthropic/OpenAI/Google,因为这些提供商支持内置搜索功能。唯一需要的密钥是该提供商的API密钥,需存储在
    .env
    文件中(已添加到git忽略列表)。除非用户要求,否则跳过LangSmith追踪。
  4. 安装
    deepagents
    (以及
    python-dotenv
    )和对应模型的提供商包——不要安装
    tavily-python
  5. 运行研究示例,展示输出结果,然后停止。后续步骤可参考
    deep-agents-core
    /自定义/托管Deep Agents。