feat: add DeerFlowClient for embedded programmatic access (#926)

Add `DeerFlowClient` class that provides direct in-process access to
DeerFlow's agent and Gateway capabilities without requiring LangGraph
Server or Gateway API processes. This enables users to import and use
DeerFlow as a Python library.

Co-authored-by: greatmengqi <chenmengqi.0376@bytedance.com>
This commit is contained in:
greatmengqi
2026-02-28 14:38:15 +08:00
committed by GitHub
parent 5ad8a657f4
commit 9d48c42a20
7 changed files with 2450 additions and 2 deletions

View File

@@ -236,6 +236,31 @@ DeerFlow is model-agnostic — it works with any LLM that implements the OpenAI-
- **Multimodal inputs** for image understanding and video comprehension
- **Strong tool-use** for reliable function calling and structured outputs
## Embedded Python Client
DeerFlow can be used as an embedded Python library without running the full HTTP services. The `DeerFlowClient` provides direct in-process access to all agent and Gateway capabilities:
```python
from src.client import DeerFlowClient
client = DeerFlowClient()
# Chat
response = client.chat("Analyze this paper for me", thread_id="my-thread")
# Streaming
for event in client.stream("hello"):
print(event.type, event.data)
# Configuration & management
print(client.list_models())
print(client.list_skills())
client.update_skill("web-search", enabled=True)
client.upload_files("thread-1", ["./report.pdf"])
```
See `backend/src/client.py` for full API documentation.
## Documentation
- [Contributing Guide](CONTRIBUTING.md) - Development environment setup and workflow