Skip to content

Commit 38fc119

Browse files
committed
Add example integration for Qwen-Deep-Research model
1 parent 2d02ccd commit 38fc119

6 files changed

Lines changed: 471 additions & 0 deletions

File tree

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ It includes **agent deployment** and **secure sandboxed tool execution**, and ca
9595
| **Browser Use** | browser_use/agent_browser ||| Command-line browser automation using AgentScope |
9696
| | browser_use/browser_use_fullstack_runtime ||| Full-stack browser automation with UI & sandbox |
9797
| **Deep Research** | deep_research/agent_deep_research ||| Multi-agent research pipeline |
98+
| | deep_research/agent_qwen_deep_research ||| Simplified deep research agent |
9899
| | deep_research/qwen_langgraph_search_fullstack_runtime ||| Full-stack deep research app |
99100
| **Games** | games/game_werewolves ||| Multi-agent roleplay game |
100101
| **Conversational Apps** | conversational_agents/chatbot_fullstack_runtime ||| Chatbot application with frontend/backend |

README_zh.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ AgentScope Runtime 是一个**全面的运行时框架**,主要解决部署和
9595
| **浏览器相关** | browser_use/agent_browser ||| 基于 AgentScope 的命令行浏览器自动化 |
9696
| | browser_use/browser_use_fullstack_runtime ||| 带 UI 和沙盒环境的全栈浏览器自动化 |
9797
| **深度研究** | deep_research/agent_deep_research ||| 多 Agent 研究流程 |
98+
| | deep_research/agent_qwen_deep_research ||| 简化的深度研究代理 |
9899
| | deep_research/qwen_langgraph_search_fullstack_runtime ||| 全栈运行时深度研究应用 |
99100
| **游戏** | games/game_werewolves ||| 多 Agent 角色扮演推理游戏 |
100101
| **对话应用** | conversational_agents/chatbot_fullstack_runtime ||| 带前端/后端的聊天机器人 |
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Deep Research Agent Example with Qwen-Deep-Research Model
2+
3+
This example shows an Agent implementation with **Qwen-Deep-Research** model using the AgentScope framework. It can break down complex problems, uses web searches to perform analysis, and generates research reports.
4+
5+
Reference: https://www.alibabacloud.com/help/en/model-studio/qwen-deep-research
6+
7+
## 🚀 Getting Started
8+
9+
### Prerequisites
10+
11+
- Python 3.10 or higher
12+
- DashScope API key from [Alibaba Cloud](https://dashscope.console.aliyun.com/)
13+
14+
### Installation
15+
16+
```bash
17+
pip install -r requirements.txt
18+
```
19+
20+
### Usage
21+
22+
1. **Set Environment Variable**:
23+
```bash
24+
export DASHSCOPE_API_KEY="your_dashscope_api_key_here"
25+
```
26+
2. **Run the script**:
27+
```bash
28+
python main.py
29+
```
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# -*- coding: utf-8 -*-
2+
"""The main entry point of the Qwen Deep Research agent example."""
3+
import asyncio
4+
5+
from qwen_deep_research_agent import QwenDeepResearchAgent
6+
from agentscope import logger
7+
from agentscope.message import Msg
8+
9+
10+
async def main() -> None:
11+
"""The main entry point for the Qwen Deep Research agent example."""
12+
# Create DeepResearch Agent
13+
researcher = QwenDeepResearchAgent(
14+
name="Researcher Qwen",
15+
verbose=True,
16+
)
17+
18+
# Step 1: Model follow-up question for confirmation
19+
# The model analyzes the user's question
20+
# and asks follow-up questions to clarify the research direction.
21+
user_msg = Msg(
22+
name="User",
23+
content="Research the applications of artificial intelligence in "
24+
"education",
25+
role="user",
26+
)
27+
28+
clarification = await researcher(user_msg)
29+
print(f"\n{clarification.name}: {clarification.content}\n")
30+
31+
# Step 2: Deep research
32+
# Based on the content of the follow-up question in Step 1,
33+
# the model executes the complete research process.
34+
user_response = Msg(
35+
name="User",
36+
content="I am mainly interested in personalized learning and "
37+
"intelligent assessment.",
38+
role="user",
39+
)
40+
41+
research_result = await researcher(user_response)
42+
print(f"\n{research_result.name}: {research_result.content}\n")
43+
44+
print("\n✅ Research complete!\n")
45+
46+
47+
if __name__ == "__main__":
48+
try:
49+
asyncio.run(main())
50+
except Exception as e:
51+
logger.exception(e)

0 commit comments

Comments
 (0)