内嵌 Python Client

长按二维码关注

DeerFlow 也可以作为内嵌的 Python 库使用,不必启动完整的 HTTP 服务。DeerFlowClient 提供了进程内的直接访问方式,覆盖所有 agent 和 Gateway 能力,返回的数据结构与 HTTP Gateway API 保持一致:

from deerflow.client import DeerFlowClient client = DeerFlowClient() # Chat response = client.chat("Analyze this paper for me", thread_id="my-thread") # Streaming(LangGraph SSE 协议:values、messages-tuple、end) for event in client.stream("hello"): if event.type == "messages-tuple" and event.data.get("type") == "ai": print(event.data["content"]) # 配置与管理:返回值与 Gateway 对齐的 dict models = client.list_models() # {"models": [...]} skills = client.list_skills() # {"skills": [...]} client.update_skill("web-search", enabled=True) client.upload_files("thread-1", ["./report.pdf"]) # {"success": True, "files": [...]}

所有返回 dict 的方法都会在 CI 中通过 Gateway 的 Pydantic 响应模型校验(TestGatewayConformance),以确保内嵌 client 始终和 HTTP API schema 保持同步。完整 API 说明见 backend/packages/harness/deerflow/client.py。

 

DeerFlow 2.0

DeerFlow(Deep Exploration and Efficient Research Flow)是一个开源的 super agent harness。它把 sub-agents、memory 和 sandbox 组织在一起,再配合可扩展的 skills,让 agent 可以完成几乎任何事情。

DeerFlow 2.0 是一次彻底重写。 它和 v1 没有共用代码。如果你要找的是最初的 Deep Research 框架,可以前往 1.x 分支。那里仍然欢迎贡献;当前的主要开发已经转向 2.0。

 

 

扫二维码

关注我们

不迷路^_^


我们愿景

城市更繁荣

乡村更美丽