diff --git a/README.md b/README.md
index 67ca777..45f146f 100644
--- a/README.md
+++ b/README.md
@@ -18,10 +18,8 @@
[![Star][star-image]][star-url]
[![Package License][package-license-image]][package-license-url]
-
-
@@ -56,10 +54,10 @@ Our vision is to revolutionize how AI agents collaborate to solve real-world tas
-
+
# 📋 Table of Contents
- [📋 Table of Contents](#-table-of-contents)
@@ -117,7 +115,6 @@ Our vision is to revolutionize how AI agents collaborate to solve real-world tas
# 🔥 News
-
🧩 NEW: COMMUNITY AGENT CHALLENGES! 🧩
@@ -146,8 +143,8 @@ Our vision is to revolutionize how AI agents collaborate to solve real-world tas
-->
- **[2025.09.22]**: Exicited to announce that OWL has been accepted by NeurIPS 2025!🚀 Check the latest paper [here](https://arxiv.org/abs/2505.23885).
-- **[2025.07.21]**: We open-sourced the training dataset and model checkpoints of OWL project. Training code coming soon. [huggingface link](https://huggingface.co/collections/camel-ai/optimized-workforce-learning-682ef4ab498befb9426e6e27).
-- **[2025.05.27]**: We released the technical report of OWL, including more details on the workforce (framework) and optimized workforce learning (training methodology). [paper](https://arxiv.org/abs/2505.23885).
+- **[2025.07.21]**: We open-sourced the training dataset and model checkpoints of OWL project. Training code coming soon. [huggingface link](https://huggingface.co/collections/camel-ai/optimized-workforce-learning-682ef4ab498befb9426e6e27).
+- **[2025.05.27]**: We released the technical report of OWL, including more details on the workforce (framework) and optimized workforce learning (training methodology). [paper](https://arxiv.org/abs/2505.23885).
- **[2025.05.18]**: We open-sourced an initial version for replicating workforce experiment on GAIA [here](https://github.com/camel-ai/owl/tree/gaia69).
- **[2025.04.18]**: We uploaded OWL's new GAIA benchmark score of **69.09%**, ranking #1 among open-source frameworks. Check the technical report [here](https://hypnotic-mind-6bd.notion.site/OWL-Optimized-Workforce-Learning-for-General-Multi-Agent-Assistance-in-Real-World-Task-Automation-1d4004aeb21380158749c7f84b20643f).
- **[2025.03.27]**: Integrate SearxNGToolkit performing web searches using SearxNG search engine.
@@ -162,7 +159,6 @@ Our vision is to revolutionize how AI agents collaborate to solve real-world tas
- **[2025.03.07]**: We open-sourced the codebase of the 🦉 OWL project.
- **[2025.03.03]**: OWL achieved the #1 position among open-source frameworks on the GAIA benchmark with a score of 58.18.
-
# 🎬 Demo Video
https://github.com/user-attachments/assets/2a2a825d-39ea-45c5-9ba1-f9d58efbc372
@@ -187,6 +183,7 @@ This video demonstrates how to install OWL locally and showcases its capabilitie
## **Prerequisites**
### Install Python
+
Before installing OWL, ensure you have Python installed (version 3.10, 3.11, or 3.12 is supported):
> **Note for GAIA Benchmark Users**: When running the GAIA benchmark evaluation, please use the `gaia58.18` branch which includes a customized version of the CAMEL framework in the `owl/camel` directory. This version contains enhanced toolkits with improved stability specifically optimized for the GAIA benchmark compared to the standard CAMEL installation.
@@ -334,12 +331,14 @@ OWL requires various API keys to interact with different services.
You can set environment variables directly in your terminal:
- **macOS/Linux (Bash/Zsh)**:
+
```bash
export OPENAI_API_KEY="your-openai-api-key-here"
# Add other required API keys as needed
```
- **Windows (Command Prompt)**:
+
```batch
set OPENAI_API_KEY=your-openai-api-key-here
```
@@ -356,11 +355,12 @@ You can set environment variables directly in your terminal:
If you prefer using a `.env` file instead, you can:
1. **Copy and Rename the Template**:
+
```bash
# For macOS/Linux
cd owl
cp .env_template .env
-
+
# For Windows
cd owl
copy .env_template .env
@@ -463,7 +463,6 @@ print(f"\033[94mAnswer: {answer}\033[0m")
OWL will then automatically invoke document-related tools to process the file and extract the answer.
-
### Example Tasks
Here are some tasks you can try with OWL:
@@ -481,7 +480,9 @@ Here are some tasks you can try with OWL:
OWL's MCP integration provides a standardized way for AI models to interact with various tools and data sources:
Before using MCP, you need to install Node.js first.
+
### **Install Node.js**
+
### Windows
Download the official installer: [Node.js](https://nodejs.org/en).
@@ -489,22 +490,27 @@ Download the official installer: [Node.js](https://nodejs.org/en).
Check "Add to PATH" option during installation.
### Linux
+
```bash
sudo apt update
sudo apt install nodejs npm -y
```
+
### Mac
+
```bash
brew install node
```
### **Install Playwright MCP Service**
+
```bash
npm install -g @executeautomation/playwright-mcp-server
npx playwright install-deps
```
Try our comprehensive MCP examples:
+
- `examples/run_mcp.py` - Basic MCP functionality demonstration (local call, requires dependencies)
- `examples/run_mcp_sse.py` - Example using the SSE protocol (Use remote services, no dependencies)
@@ -538,17 +544,19 @@ tools = [
Key toolkits include:
### Multimodal Toolkits (Require multimodal model capabilities)
+
- **BrowserToolkit**: Browser automation for web interaction and navigation
- **VideoAnalysisToolkit**: Video processing and content analysis
- **ImageAnalysisToolkit**: Image analysis and interpretation
### Text-Based Toolkits
+
- **AudioAnalysisToolkit**: Audio processing (requires OpenAI API)
- **CodeExecutionToolkit**: Python code execution and evaluation
- **SearchToolkit**: Web searches (Google, DuckDuckGo, Wikipedia)
- **DocumentProcessingToolkit**: Document parsing (PDF, DOCX, etc.)
-Additional specialized toolkits: ArxivToolkit, GitHubToolkit, GoogleMapsToolkit, MathToolkit, NetworkXToolkit, NotionToolkit, RedditToolkit, WeatherToolkit, and more. For a complete list, see the [CAMEL toolkits documentation](https://docs.camel-ai.org/key_modules/tools.html#built-in-toolkits).
+Additional specialized toolkits: ArxivToolkit, GitHubToolkit, GoogleMapsToolkit, MathToolkit, NetworkXToolkit, NotionToolkit, RedditToolkit, WeatherToolkit, and more. For a complete list, see the [CAMEL toolkits documentation](https://docs.camel-ai.org/key_modules/tools).
## Customizing Your Configuration
@@ -613,6 +621,7 @@ Furthermore, to ensure optimal performance on the GAIA benchmark, please note th
When running the benchmark evaluation:
1. Switch to the `gaia69` branch:
+
```bash
git checkout gaia69
```
@@ -624,7 +633,6 @@ When running the benchmark evaluation:
This will execute the same configuration that achieved our top-ranking performance on the GAIA benchmark.
-
# ⏱️ Future Plans
We're continuously working to improve OWL. Here's what's on our roadmap:
@@ -647,6 +655,7 @@ We welcome contributions from the community! Here's how you can help:
3. Submit pull requests with your improvements
**Current Issues Open for Contribution:**
+
- [#1915](https://github.com/camel-ai/camel/issues/1915)
- [#2190](https://github.com/camel-ai/camel/issues/2190)
- [#2165](https://github.com/camel-ai/camel/issues/2165)
@@ -659,9 +668,10 @@ To take on an issue, simply leave a comment stating your interest.
# 🔥 Community
-Join us ([*Discord*](https://discord.camel-ai.org/) or [*WeChat*](https://ghli.org/camel/wechat.png)) in pushing the boundaries of finding the scaling laws of agents.
+Join us ([_Discord_](https://discord.camel-ai.org/) or [_WeChat_](https://ghli.org/camel/wechat.png)) in pushing the boundaries of finding the scaling laws of agents.
Join us for further discussions!
+
@@ -675,7 +685,7 @@ A: If OWL determines that a task can be completed using non-browser tools (such
**Q: Which Python version should I use?**
-A: OWL supports Python 3.10, 3.11, and 3.12.
+A: OWL supports Python 3.10, 3.11, and 3.12.
**Q: How can I contribute to the project?**
@@ -709,16 +719,15 @@ cd camel
If you find this repo useful, please cite:
-
```
@misc{hu2025owl,
- title={OWL: Optimized Workforce Learning for General Multi-Agent Assistance in Real-World Task Automation},
+ title={OWL: Optimized Workforce Learning for General Multi-Agent Assistance in Real-World Task Automation},
author={Mengkang Hu and Yuhang Zhou and Wendong Fan and Yuzhou Nie and Bowei Xia and Tao Sun and Ziyu Ye and Zhaoxuan Jin and Yingru Li and Qiguang Chen and Zeyu Zhang and Yifeng Wang and Qianshuo Ye and Bernard Ghanem and Ping Luo and Guohao Li},
year={2025},
eprint={2505.23885},
archivePrefix={arXiv},
primaryClass={cs.AI},
- url={https://arxiv.org/abs/2505.23885},
+ url={https://arxiv.org/abs/2505.23885},
}
```
@@ -726,15 +735,12 @@ If you find this repo useful, please cite:
[](https://star-history.com/#camel-ai/owl&Date)
-
-
[docs-image]: https://img.shields.io/badge/Documentation-EB3ECC
[docs-url]: https://camel-ai.github.io/camel/index.html
[star-image]: https://img.shields.io/github/stars/camel-ai/owl?label=stars&logo=github&color=brightgreen
[star-url]: https://github.com/camel-ai/owl/stargazers
[package-license-image]: https://img.shields.io/badge/License-Apache_2.0-blue.svg
[package-license-url]: https://github.com/camel-ai/owl/blob/main/licenses/LICENSE
-
[colab-url]: https://colab.research.google.com/drive/1AzP33O8rnMW__7ocWJhVBXjKziJXPtim?usp=sharing
[colab-image]: https://colab.research.google.com/assets/colab-badge.svg
[huggingface-url]: https://huggingface.co/camel-ai
diff --git a/README_ja.md b/README_ja.md
index 5f35994..40d78c1 100644
--- a/README_ja.md
+++ b/README_ja.md
@@ -2,7 +2,6 @@
🦉 OWL: 労働力学習の最適化による、現実世界のタスク自動化における一般的なマルチエージェント支援
-
[![ドキュメント][docs-image]][docs-url]
@@ -15,10 +14,8 @@
[![Star][star-image]][star-url]
[![パッケージライセンス][package-license-image]][package-license-url]
-
-
@@ -55,10 +52,10 @@
-
+
# 📋 目次
- [📋 目次](#-目次)
@@ -113,7 +110,6 @@
# 🔥 ニュース
-
🧩 新機能:コミュニティエージェントチャレンジ! 🧩
@@ -255,6 +251,7 @@ OWLは、さまざまなサービスと対話するために複数のAPIキー
### オプション1:`.env`ファイルを使用する(推奨)
1. **テンプレートをコピーして名前を変更**:
+
```bash
cd owl
cp .env_template .env
@@ -262,7 +259,7 @@ OWLは、さまざまなサービスと対話するために複数のAPIキー
2. **APIキーを設定**:
お好みのテキストエディタで`.env`ファイルを開き、対応するフィールドにAPIキーを挿入します。
-
+
> **注意**:最小限の例(`examples/run_mini.py`)の場合、LLM APIキー(例:`OPENAI_API_KEY`)のみを設定する必要があります。
### オプション2:環境変数を直接設定
@@ -270,11 +267,13 @@ OWLは、さまざまなサービスと対話するために複数のAPIキー
または、ターミナルで環境変数を直接設定することもできます:
- **macOS/Linux (Bash/Zsh)**:
+
```bash
export OPENAI_API_KEY="your-openai-api-key-here"
```
- **Windows (コマンドプロンプト)**:
+
```batch
set OPENAI_API_KEY="your-openai-api-key-here"
```
@@ -286,8 +285,6 @@ OWLは、さまざまなサービスと対話するために複数のAPIキー
> **注意**:ターミナルで直接設定された環境変数は、現在のセッションでのみ有効です。
-
-
## **Dockerでの実行**
OWLはDockerを使用して簡単にデプロイでき、異なるプラットフォーム間で一貫した環境を提供します。
@@ -435,7 +432,6 @@ print(f"\033[94mAnswer: {answer}\033[0m")
OWLは自動的にドキュメント関連のツールを呼び出してファイルを処理し、回答を抽出します。
-
### 例のタスク
以下のタスクをOWLで試してみてください:
@@ -453,7 +449,9 @@ OWLは自動的にドキュメント関連のツールを呼び出してファ
OWLのMCP統合は、AIモデルがさまざまなツールやデータソースと相互作用するための標準化された方法を提供します:
MCPを使用する前に、まずNode.jsをインストールする必要があります。
+
### **Node.jsのインストール**
+
### Windows
公式インストーラーをダウンロード:[Node.js](https://nodejs.org/en)。
@@ -461,16 +459,20 @@ MCPを使用する前に、まずNode.jsをインストールする必要があ
インストール中に「Add to PATH」オプションをチェックします。
### Linux
+
```bash
sudo apt update
sudo apt install nodejs npm -y
```
+
### Mac
+
```bash
brew install node
```
### **Playwright MCPサービスのインストール**
+
```bash
npm install -g @executeautomation/playwright-mcp-server
npx playwright install-deps
@@ -508,17 +510,19 @@ tools = [
主要なツールキットには以下が含まれます:
### マルチモーダルツールキット(マルチモーダルモデル機能が必要)
+
- **BrowserToolkit**:ウェブインタラクションとナビゲーションのためのブラウザ自動化
- **VideoAnalysisToolkit**:ビデオ処理とコンテンツ分析
- **ImageAnalysisToolkit**:画像解析と解釈
### テキストベースのツールキット
+
- **AudioAnalysisToolkit**:音声処理(OpenAI APIが必要)
- **CodeExecutionToolkit**:Pythonコードの実行と評価
- **SearchToolkit**:ウェブ検索(Google、DuckDuckGo、Wikipedia)
- **DocumentProcessingToolkit**:ドキュメント解析(PDF、DOCXなど)
-その他の専門ツールキット:ArxivToolkit、GitHubToolkit、GoogleMapsToolkit、MathToolkit、NetworkXToolkit、NotionToolkit、RedditToolkit、WeatherToolkitなど。完全なツールキットのリストについては、[CAMELツールキットドキュメント](https://docs.camel-ai.org/key_modules/tools.html#built-in-toolkits)を参照してください。
+その他の専門ツールキット:ArxivToolkit、GitHubToolkit、GoogleMapsToolkit、MathToolkit、NetworkXToolkit、NotionToolkit、RedditToolkit、WeatherToolkitなど。完全なツールキットのリストについては、[CAMELツールキットドキュメント](https://docs.camel-ai.org/key_modules/tools)を参照してください。
## カスタマイズ設定
@@ -580,6 +584,7 @@ python owl/webapp_jp.py
OWLのGAIAベンチマークスコア58.18を再現するには:
1. `gaia58.18`ブランチに切り替え:
+
```bash
git checkout gaia58.18
```
@@ -608,7 +613,6 @@ OWLのGAIAベンチマークスコア58.18を再現するには:
このリポジトリが役立つと思われる場合は、以下を引用してください:
-
```
@misc{owl2025,
title = {OWL: Optimized Workforce Learning for General Multi-Agent Assistance in Real-World Task Automation},
@@ -628,6 +632,7 @@ OWLのGAIAベンチマークスコア58.18を再現するには:
3. 改善点を含むプルリクエストを提出する
**現在貢献を受け付けている問題:**
+
- [#1915](https://github.com/camel-ai/camel/issues/1915)
- [#2190](https://github.com/camel-ai/camel/issues/2190)
- [#2165](https://github.com/camel-ai/camel/issues/2165)
@@ -636,14 +641,16 @@ OWLのGAIAベンチマークスコア58.18を再現するには:
- [#1538](https://github.com/camel-ai/camel/issues/1538)
- [#1481](https://github.com/camel-ai/camel/issues/1481)
-
問題を引き受けるには、興味を示すコメントを残すだけです。
# 🔥 コミュニティ
-エージェントのスケーリング法則を見つけるための限界を押し広げるために、私たちと一緒に参加してください([*Discord*](https://discord.camel-ai.org/)または[*WeChat*](https://ghli.org/camel/wechat.png))。
+
+エージェントのスケーリング法則を見つけるための限界を押し広げるために、私たちと一緒に参加してください([_Discord_](https://discord.camel-ai.org/)または[_WeChat_](https://ghli.org/camel/wechat.png))。
さらなる議論に参加してください!
+
+

# ❓ FAQ
@@ -676,15 +683,12 @@ cd camel
[](https://star-history.com/#camel-ai/owl&Date)
-
-
[docs-image]: https://img.shields.io/badge/Documentation-EB3ECC
[docs-url]: https://camel-ai.github.io/camel/index.html
[star-image]: https://img.shields.io/github/stars/camel-ai/owl?label=stars&logo=github&color=brightgreen
[star-url]: https://github.com/camel-ai/owl/stargazers
[package-license-image]: https://img.shields.io/badge/License-Apache_2.0-blue.svg
[package-license-url]: https://github.com/camel-ai/owl/blob/main/licenses/LICENSE
-
[colab-url]: https://colab.research.google.com/drive/1AzP33O8rnMW__7ocWJhVBXjKziJXPtim?usp=sharing
[colab-image]: https://colab.research.google.com/assets/colab-badge.svg
[huggingface-url]: https://huggingface.co/camel-ai
diff --git a/README_zh.md b/README_zh.md
index 0c973f1..28871f1 100644
--- a/README_zh.md
+++ b/README_zh.md
@@ -3,7 +3,6 @@
🦉 OWL: 优化劳动力学习的通用智能体,用于处理现实世界的自动化任务
-
[![文档][docs-image]][docs-url]
@@ -16,7 +15,6 @@
[![Star][star-image]][star-url]
[![软件许可证][package-license-image]][package-license-url]
-
@@ -49,14 +47,12 @@

-
-
-
+
# 📋 目录
- [📋 目录](#-目录)
@@ -252,6 +248,7 @@ OWL 需要各种 API 密钥来与不同的服务进行交互。`owl/.env_templat
### 选项 1:使用 `.env` 文件(推荐)
1. **复制并重命名模板**:
+
```bash
cd owl
cp .env_template .env
@@ -259,7 +256,7 @@ OWL 需要各种 API 密钥来与不同的服务进行交互。`owl/.env_templat
2. **配置你的 API 密钥**:
在你喜欢的文本编辑器中打开 `.env` 文件,并在相应字段中插入你的 API 密钥。
-
+
> **注意**:对于最小示例(`examples/run_mini.py`),你只需要配置 LLM API 密钥(例如,`OPENAI_API_KEY`)。
### 选项 2:直接设置环境变量
@@ -267,11 +264,13 @@ OWL 需要各种 API 密钥来与不同的服务进行交互。`owl/.env_templat
或者,你可以直接在终端中设置环境变量:
- **macOS/Linux (Bash/Zsh)**:
+
```bash
export OPENAI_API_KEY="你的-openai-api-密钥"
```
- **Windows (命令提示符)**:
+
```batch
set OPENAI_API_KEY="你的-openai-api-密钥"
```
@@ -359,7 +358,7 @@ npx -y @wonderwhy-er/desktop-commander setup --force-file-protocol
# 🚀 快速开始
## 基本用法
-
+
运行以下示例:
```bash
@@ -438,6 +437,7 @@ print(f"答案:{answer}")
OWL 将自动调用与文档相关的工具来处理文件并提取答案。
你可以尝试以下示例任务:
+
- "查询苹果公司的最新股票价格"
- "分析关于气候变化的最新推文情绪"
- "帮我调试这段 Python 代码:[在此粘贴你的代码]"
@@ -449,7 +449,9 @@ OWL 将自动调用与文档相关的工具来处理文件并提取答案。
OWL 的 MCP 集成为 AI 模型与各种工具和数据源的交互提供了标准化的方式。
在使用MCP前,需要先安装Node.js。
+
### **安装 Node.js**
+
### Windows
下载官方安装包:[Node.js](https://nodejs.org/zh-cn)。
@@ -457,22 +459,27 @@ OWL 的 MCP 集成为 AI 模型与各种工具和数据源的交互提供了标
安装时,勾选 "Add to PATH" 选项。
### Linux
+
```bash
sudo apt update
sudo apt install nodejs npm -y
```
+
### Mac
+
```bash
brew install node
```
### **安装 MCP 服务**
+
```bash
npm install -g @executeautomation/playwright-mcp-server
npx playwright install-deps
```
查看我们的MCP示例:
+
- `examples/run_mcp.py` - 基础MCP功能演示 (本地调用,需要安装依赖)
- `examples/run_mcp_sse.py` - 使用SSE协议的示例 (使用远程服务,无需安装依赖)
@@ -506,17 +513,19 @@ tools = [
关键工具包包括:
### 多模态工具包(需要模型具备多模态能力)
+
- **BrowserToolkit**:浏览器自动化,用于网页交互和导航
- **VideoAnalysisToolkit**:视频处理和内容分析
- **ImageAnalysisToolkit**:图像分析和解释
### 基于文本的工具包
+
- **AudioAnalysisToolkit**:音频处理(需要 OpenAI API)
- **CodeExecutionToolkit**:Python 代码执行和评估
- **SearchToolkit**:网络搜索(Google、DuckDuckGo、维基百科)
- **DocumentProcessingToolkit**:文档解析(PDF、DOCX等)
-其他专用工具包:ArxivToolkit、GitHubToolkit、GoogleMapsToolkit、MathToolkit、NetworkXToolkit、NotionToolkit、RedditToolkit、WeatherToolkit等。完整工具包列表请参阅[CAMEL工具包文档](https://docs.camel-ai.org/key_modules/tools.html#built-in-toolkits)。
+其他专用工具包:ArxivToolkit、GitHubToolkit、GoogleMapsToolkit、MathToolkit、NetworkXToolkit、NotionToolkit、RedditToolkit、WeatherToolkit等。完整工具包列表请参阅[CAMEL工具包文档](https://docs.camel-ai.org/key_modules/tools)。
## 自定义配置
@@ -579,11 +588,13 @@ python owl/webapp_jp.py
要复现我们在 GAIA 基准测试中获得的 58.18 分:
1. 切换到 `gaia58.18` 分支:
+
```bash
git checkout gaia58.18
```
2. 运行评估脚本:
+
```bash
python examples/run_gaia_roleplaying.py
```
@@ -605,7 +616,6 @@ python examples/run_gaia_roleplaying.py
如果你觉得这个仓库对你有帮助,请引用:
-
```
@misc{owl2025,
title = {OWL: Optimized Workforce Learning for General Multi-Agent Assistance in Real-World Task Automation},
@@ -625,6 +635,7 @@ python examples/run_gaia_roleplaying.py
3. 提交包含您改进的拉取请求
**当前开放贡献的问题:**
+
- [#1915](https://github.com/camel-ai/camel/issues/1915)
- [#2190](https://github.com/camel-ai/camel/issues/2190)
- [#2165](https://github.com/camel-ai/camel/issues/2165)
@@ -636,7 +647,8 @@ python examples/run_gaia_roleplaying.py
要认领一个问题,只需在该问题下留言表明您的兴趣即可。
# 🔥 社区
-加入我们的 ([*Discord*](https://discord.camel-ai.org/) 或 [*微信*](https://ghli.org/camel/wechat.png)) 社区,一起探索智能体扩展规律的边界。
+
+加入我们的 ([_Discord_](https://discord.camel-ai.org/) 或 [_微信_](https://ghli.org/camel/wechat.png)) 社区,一起探索智能体扩展规律的边界。
加入我们,参与更多讨论!
@@ -678,7 +690,6 @@ cd camel
[star-url]: https://github.com/camel-ai/owl/stargazers
[package-license-image]: https://img.shields.io/badge/License-Apache_2.0-blue.svg
[package-license-url]: https://github.com/camel-ai/owl/blob/main/licenses/LICENSE
-
[colab-url]: https://colab.research.google.com/drive/1AzP33O8rnMW__7ocWJhVBXjKziJXPtim?usp=sharing
[colab-image]: https://colab.research.google.com/assets/colab-badge.svg
[huggingface-url]: https://huggingface.co/camel-ai
diff --git a/examples/run.py b/examples/run.py
index 2c02a0c..3b44e36 100644
--- a/examples/run.py
+++ b/examples/run.py
@@ -18,12 +18,10 @@ from camel.models import ModelFactory
from camel.agents import ChatAgent
from camel.toolkits import (
FunctionTool,
- AudioAnalysisToolkit,
CodeExecutionToolkit,
ExcelToolkit,
ImageAnalysisToolkit,
SearchToolkit,
- VideoAnalysisToolkit,
BrowserToolkit,
FileToolkit,
)
@@ -45,26 +43,25 @@ set_log_level(level="DEBUG")
def construct_agent_list() -> List[Dict[str, Any]]:
-
web_model = ModelFactory.create(
model_platform=ModelPlatformType.OPENAI,
model_type=ModelType.GPT_5_2,
model_config_dict={"temperature": 0},
)
-
+
document_processing_model = ModelFactory.create(
model_platform=ModelPlatformType.OPENAI,
model_type=ModelType.GPT_5_2,
model_config_dict={"temperature": 0},
)
-
+
reasoning_model = ModelFactory.create(
model_platform=ModelPlatformType.OPENAI,
model_type=ModelType.GPT_5_2,
model_config_dict={"temperature": 0},
)
-
- image_analysis_model = ModelFactory.create(
+
+ image_analysis_model = ModelFactory.create(
model_platform=ModelPlatformType.OPENAI,
model_type=ModelType.GPT_5_2,
model_config_dict={"temperature": 0},
@@ -83,7 +80,9 @@ def construct_agent_list() -> List[Dict[str, Any]]:
)
search_toolkit = SearchToolkit()
- document_processing_toolkit = DocumentProcessingToolkit(model=document_processing_model)
+ document_processing_toolkit = DocumentProcessingToolkit(
+ model=document_processing_model
+ )
image_analysis_toolkit = ImageAnalysisToolkit(model=image_analysis_model)
code_runner_toolkit = CodeExecutionToolkit(sandbox="subprocess", verbose=True)
file_toolkit = FileToolkit()
@@ -95,7 +94,7 @@ def construct_agent_list() -> List[Dict[str, Any]]:
)
web_agent = ChatAgent(
-"""
+ """
You are a helpful assistant that can search the web, extract webpage content, simulate browser actions, and provide relevant information to solve the given task.
Keep in mind that:
- Do not be overly confident in your own knowledge. Searching can provide a broader perspective and help validate existing knowledge.
@@ -121,9 +120,9 @@ Here are some tips that help you perform web search:
FunctionTool(search_toolkit.search_wiki),
FunctionTool(document_processing_toolkit.extract_document_content),
*browser_toolkit.get_tools(),
- ]
+ ],
)
-
+
document_processing_agent = ChatAgent(
"You are a helpful assistant that can process documents and multimodal data, and can interact with file system.",
document_processing_model,
@@ -132,9 +131,9 @@ Here are some tips that help you perform web search:
FunctionTool(image_analysis_toolkit.ask_question_about_image),
FunctionTool(code_runner_toolkit.execute_code),
*file_toolkit.get_tools(),
- ]
+ ],
)
-
+
reasoning_coding_agent = ChatAgent(
"You are a helpful assistant that specializes in reasoning and coding, and can think step by step to solve the task. When necessary, you can write python code to solve the task. If you have written code, do not forget to execute the code. Never generate codes like 'example code', your code should be able to fully solve the task. You can also leverage multiple libraries, such as requests, BeautifulSoup, re, pandas, etc, to solve the task. For processing excel files, you should write codes to process them.",
reasoning_model,
@@ -142,27 +141,27 @@ Here are some tips that help you perform web search:
FunctionTool(code_runner_toolkit.execute_code),
FunctionTool(excel_toolkit.extract_excel_content),
FunctionTool(document_processing_toolkit.extract_document_content),
- ]
+ ],
)
agent_list = []
-
+
web_agent_dict = {
"name": "Web Agent",
"description": "A helpful assistant that can search the web, extract webpage content, simulate browser actions, and retrieve relevant information.",
- "agent": web_agent
+ "agent": web_agent,
}
-
+
document_processing_agent_dict = {
"name": "Document Processing Agent",
"description": "A helpful assistant that can process a variety of local and remote documents, including pdf, docx, images, audio, and video, etc.",
- "agent": document_processing_agent
+ "agent": document_processing_agent,
}
-
+
reasoning_coding_agent_dict = {
"name": "Reasoning Coding Agent",
"description": "A helpful assistant that specializes in reasoning, coding, and processing excel files. However, it cannot access the internet to search for information. If the task requires python execution, it should be informed to execute the code after writing it.",
- "agent": reasoning_coding_agent
+ "agent": reasoning_coding_agent,
}
agent_list.append(web_agent_dict)
@@ -172,7 +171,6 @@ Here are some tips that help you perform web search:
def construct_workforce() -> Workforce:
-
coordinator_agent_kwargs = {
"model": ModelFactory.create(
model_platform=ModelPlatformType.OPENAI,
@@ -180,7 +178,7 @@ def construct_workforce() -> Workforce:
model_config_dict={"temperature": 0},
)
}
-
+
task_agent_kwargs = {
"model": ModelFactory.create(
model_platform=ModelPlatformType.OPENAI,
@@ -188,17 +186,17 @@ def construct_workforce() -> Workforce:
model_config_dict={"temperature": 0},
)
}
-
+
task_agent = ChatAgent(
"You are a helpful assistant that can decompose tasks and assign tasks to workers.",
- **task_agent_kwargs
+ **task_agent_kwargs,
)
-
+
coordinator_agent = ChatAgent(
"You are a helpful assistant that can assign tasks to workers.",
- **coordinator_agent_kwargs
+ **coordinator_agent_kwargs,
)
-
+
workforce = Workforce(
"Workforce",
task_agent=task_agent,
@@ -206,7 +204,7 @@ def construct_workforce() -> Workforce:
)
agent_list = construct_agent_list()
-
+
for agent_dict in agent_list:
workforce.add_single_agent_worker(
agent_dict["description"],
@@ -220,14 +218,14 @@ def main():
r"""Main function to run the OWL system with an example question."""
# Default research question
default_task_prompt = "Use Browser Toolkit to summarize the github stars, fork counts, etc. of camel-ai's owl framework, and write the numbers into a python file using the plot package, save it locally, and run the generated python file. Note: You have been provided with the necessary tools to complete this task."
-
+
# Override default task if command line argument is provided
task_prompt = sys.argv[1] if len(sys.argv) > 1 else default_task_prompt
-
+
task = Task(
content=task_prompt,
)
-
+
workforce = construct_workforce()
processed_task = workforce.process_task(task)
diff --git a/examples/run_claude.py b/examples/run_claude.py
index 0cdcaee..afe0df5 100644
--- a/examples/run_claude.py
+++ b/examples/run_claude.py
@@ -27,12 +27,10 @@ from camel.models import ModelFactory
from camel.agents import ChatAgent
from camel.toolkits import (
FunctionTool,
- AudioAnalysisToolkit,
CodeExecutionToolkit,
ExcelToolkit,
ImageAnalysisToolkit,
SearchToolkit,
- VideoAnalysisToolkit,
BrowserToolkit,
FileToolkit,
)
@@ -55,26 +53,26 @@ set_log_level(level="DEBUG")
def construct_agent_list() -> List[Dict[str, Any]]:
"""Construct a list of agents with their configurations."""
-
+
web_model = ModelFactory.create(
model_platform=ModelPlatformType.ANTHROPIC,
model_type=ModelType.CLAUDE_OPUS_4_6,
model_config_dict={"temperature": 0},
)
-
+
document_processing_model = ModelFactory.create(
model_platform=ModelPlatformType.ANTHROPIC,
model_type=ModelType.CLAUDE_OPUS_4_6,
model_config_dict={"temperature": 0},
)
-
+
reasoning_model = ModelFactory.create(
model_platform=ModelPlatformType.ANTHROPIC,
model_type=ModelType.CLAUDE_OPUS_4_6,
model_config_dict={"temperature": 0},
)
-
- image_analysis_model = ModelFactory.create(
+
+ image_analysis_model = ModelFactory.create(
model_platform=ModelPlatformType.ANTHROPIC,
model_type=ModelType.CLAUDE_OPUS_4_6,
model_config_dict={"temperature": 0},
@@ -93,7 +91,9 @@ def construct_agent_list() -> List[Dict[str, Any]]:
)
search_toolkit = SearchToolkit()
- document_processing_toolkit = DocumentProcessingToolkit(model=document_processing_model)
+ document_processing_toolkit = DocumentProcessingToolkit(
+ model=document_processing_model
+ )
image_analysis_toolkit = ImageAnalysisToolkit(model=image_analysis_model)
code_runner_toolkit = CodeExecutionToolkit(sandbox="subprocess", verbose=True)
file_toolkit = FileToolkit()
@@ -129,9 +129,9 @@ Here are some tips that help you perform web search:
FunctionTool(search_toolkit.search_wiki),
FunctionTool(document_processing_toolkit.extract_document_content),
*browser_toolkit.get_tools(),
- ]
+ ],
)
-
+
document_processing_agent = ChatAgent(
"You are a helpful assistant that can process documents and multimodal data, and can interact with file system.",
document_processing_model,
@@ -140,9 +140,9 @@ Here are some tips that help you perform web search:
FunctionTool(image_analysis_toolkit.ask_question_about_image),
FunctionTool(code_runner_toolkit.execute_code),
*file_toolkit.get_tools(),
- ]
+ ],
)
-
+
reasoning_coding_agent = ChatAgent(
"You are a helpful assistant that specializes in reasoning and coding, and can think step by step to solve the task. When necessary, you can write python code to solve the task. If you have written code, do not forget to execute the code. Never generate codes like 'example code', your code should be able to fully solve the task. You can also leverage multiple libraries, such as requests, BeautifulSoup, re, pandas, etc, to solve the task. For processing excel files, you should write codes to process them.",
reasoning_model,
@@ -150,27 +150,27 @@ Here are some tips that help you perform web search:
FunctionTool(code_runner_toolkit.execute_code),
FunctionTool(excel_toolkit.extract_excel_content),
FunctionTool(document_processing_toolkit.extract_document_content),
- ]
+ ],
)
agent_list = []
-
+
web_agent_dict = {
"name": "Web Agent",
"description": "A helpful assistant that can search the web, extract webpage content, simulate browser actions, and retrieve relevant information.",
- "agent": web_agent
+ "agent": web_agent,
}
-
+
document_processing_agent_dict = {
"name": "Document Processing Agent",
"description": "A helpful assistant that can process a variety of local and remote documents, including pdf, docx, images, audio, and video, etc.",
- "agent": document_processing_agent
+ "agent": document_processing_agent,
}
-
+
reasoning_coding_agent_dict = {
"name": "Reasoning Coding Agent",
"description": "A helpful assistant that specializes in reasoning, coding, and processing excel files. However, it cannot access the internet to search for information. If the task requires python execution, it should be informed to execute the code after writing it.",
- "agent": reasoning_coding_agent
+ "agent": reasoning_coding_agent,
}
agent_list.append(web_agent_dict)
@@ -181,7 +181,7 @@ Here are some tips that help you perform web search:
def construct_workforce() -> Workforce:
"""Construct a workforce with coordinator and task agents."""
-
+
coordinator_agent_kwargs = {
"model": ModelFactory.create(
model_platform=ModelPlatformType.ANTHROPIC,
@@ -189,7 +189,7 @@ def construct_workforce() -> Workforce:
model_config_dict={"temperature": 0},
)
}
-
+
task_agent_kwargs = {
"model": ModelFactory.create(
model_platform=ModelPlatformType.ANTHROPIC,
@@ -197,17 +197,17 @@ def construct_workforce() -> Workforce:
model_config_dict={"temperature": 0},
)
}
-
+
task_agent = ChatAgent(
"You are a helpful assistant that can decompose tasks and assign tasks to workers.",
- **task_agent_kwargs
+ **task_agent_kwargs,
)
-
+
coordinator_agent = ChatAgent(
"You are a helpful assistant that can assign tasks to workers.",
- **coordinator_agent_kwargs
+ **coordinator_agent_kwargs,
)
-
+
workforce = Workforce(
"Workforce",
task_agent=task_agent,
@@ -215,7 +215,7 @@ def construct_workforce() -> Workforce:
)
agent_list = construct_agent_list()
-
+
for agent_dict in agent_list:
workforce.add_single_agent_worker(
agent_dict["description"],
@@ -229,14 +229,14 @@ def main():
r"""Main function to run the OWL system with an example question."""
# Default research question
default_task_prompt = "Open Brave search, summarize the github stars, fork counts, etc. of camel-ai's camel framework, and write the numbers into a python file using the plot package, save it locally, and run the generated python file. Note: You have been provided with the necessary tools to complete this task."
-
+
# Override default task if command line argument is provided
task_prompt = sys.argv[1] if len(sys.argv) > 1 else default_task_prompt
-
+
task = Task(
content=task_prompt,
)
-
+
workforce = construct_workforce()
processed_task = workforce.process_task(task)
@@ -247,4 +247,3 @@ def main():
if __name__ == "__main__":
main()
-
diff --git a/examples/run_deepseek.py b/examples/run_deepseek.py
index dd9f37e..4b045da 100644
--- a/examples/run_deepseek.py
+++ b/examples/run_deepseek.py
@@ -51,19 +51,19 @@ set_log_level(level="DEBUG")
def construct_agent_list() -> List[Dict[str, Any]]:
"""Construct a list of agents with their configurations."""
-
+
web_model = ModelFactory.create(
model_platform=ModelPlatformType.DEEPSEEK,
model_type=ModelType.DEEPSEEK_CHAT,
model_config_dict={"temperature": 0},
)
-
+
document_processing_model = ModelFactory.create(
model_platform=ModelPlatformType.DEEPSEEK,
model_type=ModelType.DEEPSEEK_CHAT,
model_config_dict={"temperature": 0},
)
-
+
reasoning_model = ModelFactory.create(
model_platform=ModelPlatformType.DEEPSEEK,
model_type=ModelType.DEEPSEEK_CHAT,
@@ -71,7 +71,9 @@ def construct_agent_list() -> List[Dict[str, Any]]:
)
search_toolkit = SearchToolkit()
- document_processing_toolkit = DocumentProcessingToolkit(model=document_processing_model)
+ document_processing_toolkit = DocumentProcessingToolkit(
+ model=document_processing_model
+ )
code_runner_toolkit = CodeExecutionToolkit(sandbox="subprocess", verbose=True)
file_toolkit = FileToolkit()
excel_toolkit = ExcelToolkit()
@@ -96,9 +98,9 @@ Here are some tips that help you perform web search:
FunctionTool(search_toolkit.search_wiki),
FunctionTool(search_toolkit.search_baidu),
FunctionTool(document_processing_toolkit.extract_document_content),
- ]
+ ],
)
-
+
document_processing_agent = ChatAgent(
"You are a helpful assistant that can process documents and multimodal data, and can interact with file system.",
document_processing_model,
@@ -106,9 +108,9 @@ Here are some tips that help you perform web search:
FunctionTool(document_processing_toolkit.extract_document_content),
FunctionTool(code_runner_toolkit.execute_code),
*file_toolkit.get_tools(),
- ]
+ ],
)
-
+
reasoning_coding_agent = ChatAgent(
"You are a helpful assistant that specializes in reasoning and coding, and can think step by step to solve the task. When necessary, you can write python code to solve the task. If you have written code, do not forget to execute the code. Never generate codes like 'example code', your code should be able to fully solve the task. You can also leverage multiple libraries, such as requests, BeautifulSoup, re, pandas, etc, to solve the task. For processing excel files, you should write codes to process them.",
reasoning_model,
@@ -116,27 +118,27 @@ Here are some tips that help you perform web search:
FunctionTool(code_runner_toolkit.execute_code),
FunctionTool(excel_toolkit.extract_excel_content),
FunctionTool(document_processing_toolkit.extract_document_content),
- ]
+ ],
)
agent_list = []
-
+
web_agent_dict = {
"name": "Web Agent",
"description": "A helpful assistant that can search the web, extract webpage content, and retrieve relevant information.",
- "agent": web_agent
+ "agent": web_agent,
}
-
+
document_processing_agent_dict = {
"name": "Document Processing Agent",
"description": "A helpful assistant that can process a variety of local and remote documents, including pdf, docx, images, audio, and video, etc.",
- "agent": document_processing_agent
+ "agent": document_processing_agent,
}
-
+
reasoning_coding_agent_dict = {
"name": "Reasoning Coding Agent",
"description": "A helpful assistant that specializes in reasoning, coding, and processing excel files. However, it cannot access the internet to search for information. If the task requires python execution, it should be informed to execute the code after writing it.",
- "agent": reasoning_coding_agent
+ "agent": reasoning_coding_agent,
}
agent_list.append(web_agent_dict)
@@ -147,7 +149,7 @@ Here are some tips that help you perform web search:
def construct_workforce() -> Workforce:
"""Construct a workforce with coordinator and task agents."""
-
+
coordinator_agent_kwargs = {
"model": ModelFactory.create(
model_platform=ModelPlatformType.DEEPSEEK,
@@ -155,7 +157,7 @@ def construct_workforce() -> Workforce:
model_config_dict={"temperature": 0},
)
}
-
+
task_agent_kwargs = {
"model": ModelFactory.create(
model_platform=ModelPlatformType.DEEPSEEK,
@@ -163,17 +165,17 @@ def construct_workforce() -> Workforce:
model_config_dict={"temperature": 0},
)
}
-
+
task_agent = ChatAgent(
"You are a helpful assistant that can decompose tasks and assign tasks to workers.",
- **task_agent_kwargs
+ **task_agent_kwargs,
)
-
+
coordinator_agent = ChatAgent(
"You are a helpful assistant that can assign tasks to workers.",
- **coordinator_agent_kwargs
+ **coordinator_agent_kwargs,
)
-
+
workforce = Workforce(
"Workforce",
task_agent=task_agent,
@@ -181,7 +183,7 @@ def construct_workforce() -> Workforce:
)
agent_list = construct_agent_list()
-
+
for agent_dict in agent_list:
workforce.add_single_agent_worker(
agent_dict["description"],
@@ -195,14 +197,14 @@ def main():
r"""Main function to run the OWL system with an example question."""
# Default research question
default_task_prompt = "Search for recent news about the OWL project and generate a report, then save it locally."
-
+
# Override default task if command line argument is provided
task_prompt = sys.argv[1] if len(sys.argv) > 1 else default_task_prompt
-
+
task = Task(
content=task_prompt,
)
-
+
workforce = construct_workforce()
processed_task = workforce.process_task(task)
@@ -213,4 +215,3 @@ def main():
if __name__ == "__main__":
main()
-
diff --git a/examples/run_groq.py b/examples/run_groq.py
index 431235e..21f47c3 100644
--- a/examples/run_groq.py
+++ b/examples/run_groq.py
@@ -58,20 +58,20 @@ set_log_level(level="DEBUG")
def construct_agent_list() -> List[Dict[str, Any]]:
"""Construct a list of agents with their configurations."""
-
+
# Use larger models for tool-intensive roles
web_model = ModelFactory.create(
model_platform=ModelPlatformType.GROQ,
model_type=ModelType.GROQ_LLAMA_3_3_70B,
model_config_dict={"temperature": 0},
)
-
+
document_processing_model = ModelFactory.create(
model_platform=ModelPlatformType.GROQ,
model_type=ModelType.GROQ_LLAMA_3_3_70B,
model_config_dict={"temperature": 0},
)
-
+
reasoning_model = ModelFactory.create(
model_platform=ModelPlatformType.GROQ,
model_type=ModelType.GROQ_LLAMA_3_3_70B,
@@ -91,7 +91,9 @@ def construct_agent_list() -> List[Dict[str, Any]]:
)
search_toolkit = SearchToolkit()
- document_processing_toolkit = DocumentProcessingToolkit(model=document_processing_model)
+ document_processing_toolkit = DocumentProcessingToolkit(
+ model=document_processing_model
+ )
code_runner_toolkit = CodeExecutionToolkit(sandbox="subprocess", verbose=True)
file_toolkit = FileToolkit()
excel_toolkit = ExcelToolkit()
@@ -126,9 +128,9 @@ Here are some tips that help you perform web search:
FunctionTool(search_toolkit.search_wiki),
FunctionTool(document_processing_toolkit.extract_document_content),
*browser_toolkit.get_tools(),
- ]
+ ],
)
-
+
document_processing_agent = ChatAgent(
"You are a helpful assistant that can process documents and multimodal data, and can interact with file system.",
document_processing_model,
@@ -136,9 +138,9 @@ Here are some tips that help you perform web search:
FunctionTool(document_processing_toolkit.extract_document_content),
FunctionTool(code_runner_toolkit.execute_code),
*file_toolkit.get_tools(),
- ]
+ ],
)
-
+
reasoning_coding_agent = ChatAgent(
"You are a helpful assistant that specializes in reasoning and coding, and can think step by step to solve the task. When necessary, you can write python code to solve the task. If you have written code, do not forget to execute the code. Never generate codes like 'example code', your code should be able to fully solve the task. You can also leverage multiple libraries, such as requests, BeautifulSoup, re, pandas, etc, to solve the task. For processing excel files, you should write codes to process them.",
reasoning_model,
@@ -146,27 +148,27 @@ Here are some tips that help you perform web search:
FunctionTool(code_runner_toolkit.execute_code),
FunctionTool(excel_toolkit.extract_excel_content),
FunctionTool(document_processing_toolkit.extract_document_content),
- ]
+ ],
)
agent_list = []
-
+
web_agent_dict = {
"name": "Web Agent",
"description": "A helpful assistant that can search the web, extract webpage content, and retrieve relevant information.",
- "agent": web_agent
+ "agent": web_agent,
}
-
+
document_processing_agent_dict = {
"name": "Document Processing Agent",
"description": "A helpful assistant that can process a variety of local and remote documents, including pdf, docx, images, audio, and video, etc.",
- "agent": document_processing_agent
+ "agent": document_processing_agent,
}
-
+
reasoning_coding_agent_dict = {
"name": "Reasoning Coding Agent",
"description": "A helpful assistant that specializes in reasoning, coding, and processing excel files. However, it cannot access the internet to search for information. If the task requires python execution, it should be informed to execute the code after writing it.",
- "agent": reasoning_coding_agent
+ "agent": reasoning_coding_agent,
}
agent_list.append(web_agent_dict)
@@ -177,7 +179,7 @@ Here are some tips that help you perform web search:
def construct_workforce() -> Workforce:
"""Construct a workforce with coordinator and task agents."""
-
+
# Use smaller model for coordinator and task agent (they don't need tool capabilities)
coordinator_agent_kwargs = {
"model": ModelFactory.create(
@@ -186,7 +188,7 @@ def construct_workforce() -> Workforce:
model_config_dict={"temperature": 0},
)
}
-
+
task_agent_kwargs = {
"model": ModelFactory.create(
model_platform=ModelPlatformType.GROQ,
@@ -194,17 +196,17 @@ def construct_workforce() -> Workforce:
model_config_dict={"temperature": 0},
)
}
-
+
task_agent = ChatAgent(
"You are a helpful assistant that can decompose tasks and assign tasks to workers.",
- **task_agent_kwargs
+ **task_agent_kwargs,
)
-
+
coordinator_agent = ChatAgent(
"You are a helpful assistant that can assign tasks to workers.",
- **coordinator_agent_kwargs
+ **coordinator_agent_kwargs,
)
-
+
workforce = Workforce(
"Workforce",
task_agent=task_agent,
@@ -212,7 +214,7 @@ def construct_workforce() -> Workforce:
)
agent_list = construct_agent_list()
-
+
for agent_dict in agent_list:
workforce.add_single_agent_worker(
agent_dict["description"],
@@ -226,14 +228,14 @@ def main():
r"""Main function to run the OWL system with an example question."""
# Default research question
default_task_prompt = "Summarize the github stars, fork counts, etc. of camel-ai's owl framework, and write the numbers into a python file using the plot package, save it locally, and run the generated python file. Note: You have been provided with the necessary tools to complete this task."
-
+
# Override default task if command line argument is provided
task_prompt = sys.argv[1] if len(sys.argv) > 1 else default_task_prompt
-
+
task = Task(
content=task_prompt,
)
-
+
workforce = construct_workforce()
processed_task = workforce.process_task(task)
@@ -244,4 +246,3 @@ def main():
if __name__ == "__main__":
main()
-
diff --git a/examples/run_qwen.py b/examples/run_qwen.py
index 42eefd5..b68bc13 100644
--- a/examples/run_qwen.py
+++ b/examples/run_qwen.py
@@ -31,11 +31,10 @@ from camel.toolkits import (
ExcelToolkit,
ImageAnalysisToolkit,
SearchToolkit,
- VideoAnalysisToolkit,
BrowserToolkit,
FileToolkit,
)
-from camel.types import ModelPlatformType, ModelType
+from camel.types import ModelPlatformType
from camel.logger import set_log_level
from camel.tasks.task import Task
@@ -54,26 +53,26 @@ set_log_level(level="DEBUG")
def construct_agent_list() -> List[Dict[str, Any]]:
"""Construct a list of agents with their configurations."""
-
+
web_model = ModelFactory.create(
model_platform=ModelPlatformType.QWEN,
model_type="qwen3.5-plus",
model_config_dict={"temperature": 0},
)
-
+
document_processing_model = ModelFactory.create(
model_platform=ModelPlatformType.QWEN,
model_type="qwen3.5-plus",
model_config_dict={"temperature": 0},
)
-
+
reasoning_model = ModelFactory.create(
model_platform=ModelPlatformType.QWEN,
model_type="qwen3.5-plus",
model_config_dict={"temperature": 0},
)
-
- image_analysis_model = ModelFactory.create(
+
+ image_analysis_model = ModelFactory.create(
model_platform=ModelPlatformType.QWEN,
model_type="qwen3.5-plus",
model_config_dict={"temperature": 0},
@@ -92,7 +91,9 @@ def construct_agent_list() -> List[Dict[str, Any]]:
)
search_toolkit = SearchToolkit()
- document_processing_toolkit = DocumentProcessingToolkit(model=document_processing_model)
+ document_processing_toolkit = DocumentProcessingToolkit(
+ model=document_processing_model
+ )
image_analysis_toolkit = ImageAnalysisToolkit(model=image_analysis_model)
code_runner_toolkit = CodeExecutionToolkit(sandbox="subprocess", verbose=True)
file_toolkit = FileToolkit()
@@ -129,9 +130,9 @@ Here are some tips that help you perform web search:
FunctionTool(search_toolkit.search_baidu),
FunctionTool(document_processing_toolkit.extract_document_content),
*browser_toolkit.get_tools(),
- ]
+ ],
)
-
+
document_processing_agent = ChatAgent(
"You are a helpful assistant that can process documents and multimodal data, and can interact with file system.",
document_processing_model,
@@ -140,9 +141,9 @@ Here are some tips that help you perform web search:
FunctionTool(image_analysis_toolkit.ask_question_about_image),
FunctionTool(code_runner_toolkit.execute_code),
*file_toolkit.get_tools(),
- ]
+ ],
)
-
+
reasoning_coding_agent = ChatAgent(
"You are a helpful assistant that specializes in reasoning and coding, and can think step by step to solve the task. When necessary, you can write python code to solve the task. If you have written code, do not forget to execute the code. Never generate codes like 'example code', your code should be able to fully solve the task. You can also leverage multiple libraries, such as requests, BeautifulSoup, re, pandas, etc, to solve the task. For processing excel files, you should write codes to process them.",
reasoning_model,
@@ -150,27 +151,27 @@ Here are some tips that help you perform web search:
FunctionTool(code_runner_toolkit.execute_code),
FunctionTool(excel_toolkit.extract_excel_content),
FunctionTool(document_processing_toolkit.extract_document_content),
- ]
+ ],
)
agent_list = []
-
+
web_agent_dict = {
"name": "Web Agent",
"description": "A helpful assistant that can search the web, extract webpage content, and retrieve relevant information.",
- "agent": web_agent
+ "agent": web_agent,
}
-
+
document_processing_agent_dict = {
"name": "Document Processing Agent",
"description": "A helpful assistant that can process a variety of local and remote documents, including pdf, docx, images, audio, and video, etc.",
- "agent": document_processing_agent
+ "agent": document_processing_agent,
}
-
+
reasoning_coding_agent_dict = {
"name": "Reasoning Coding Agent",
"description": "A helpful assistant that specializes in reasoning, coding, and processing excel files. However, it cannot access the internet to search for information. If the task requires python execution, it should be informed to execute the code after writing it.",
- "agent": reasoning_coding_agent
+ "agent": reasoning_coding_agent,
}
agent_list.append(web_agent_dict)
@@ -181,7 +182,7 @@ Here are some tips that help you perform web search:
def construct_workforce() -> Workforce:
"""Construct a workforce with coordinator and task agents."""
-
+
coordinator_agent_kwargs = {
"model": ModelFactory.create(
model_platform=ModelPlatformType.QWEN,
@@ -189,7 +190,7 @@ def construct_workforce() -> Workforce:
model_config_dict={"temperature": 0},
)
}
-
+
task_agent_kwargs = {
"model": ModelFactory.create(
model_platform=ModelPlatformType.QWEN,
@@ -197,17 +198,17 @@ def construct_workforce() -> Workforce:
model_config_dict={"temperature": 0},
)
}
-
+
task_agent = ChatAgent(
"You are a helpful assistant that can decompose tasks and assign tasks to workers.",
- **task_agent_kwargs
+ **task_agent_kwargs,
)
-
+
coordinator_agent = ChatAgent(
"You are a helpful assistant that can assign tasks to workers.",
- **coordinator_agent_kwargs
+ **coordinator_agent_kwargs,
)
-
+
workforce = Workforce(
"Workforce",
task_agent=task_agent,
@@ -215,7 +216,7 @@ def construct_workforce() -> Workforce:
)
agent_list = construct_agent_list()
-
+
for agent_dict in agent_list:
workforce.add_single_agent_worker(
agent_dict["description"],
@@ -229,14 +230,14 @@ def main():
r"""Main function to run the OWL system with an example question."""
# Default research question
default_task_prompt = "Summarize the github stars, fork counts, etc. of camel-ai's owl framework, and write the numbers into a python file using the plot package, save it locally, and run the generated python file. Note: You have been provided with the necessary tools to complete this task."
-
+
# Override default task if command line argument is provided
task_prompt = sys.argv[1] if len(sys.argv) > 1 else default_task_prompt
-
+
task = Task(
content=task_prompt,
)
-
+
workforce = construct_workforce()
processed_task = workforce.process_task(task)
@@ -247,4 +248,3 @@ def main():
if __name__ == "__main__":
main()
-
diff --git a/examples/run_vllm.py b/examples/run_vllm.py
index 5056b5f..4547c71 100644
--- a/examples/run_vllm.py
+++ b/examples/run_vllm.py
@@ -72,12 +72,12 @@ set_log_level(level="DEBUG")
def construct_agent_list() -> List[Dict[str, Any]]:
"""Construct a list of agents with their configurations."""
-
+
# Get configuration from environment variables
api_url = os.getenv("VLLM_API_URL", "http://localhost:8000/v1")
api_key = os.getenv("VLLM_API_KEY", None)
model_name = os.getenv("VLLM_MODEL_NAME", "meta-llama/Llama-3.1-8B-Instruct")
-
+
web_model = ModelFactory.create(
model_platform=ModelPlatformType.OPENAI_COMPATIBLE_MODEL,
model_type=model_name,
@@ -85,7 +85,7 @@ def construct_agent_list() -> List[Dict[str, Any]]:
api_key=api_key,
model_config_dict={"temperature": 0},
)
-
+
document_processing_model = ModelFactory.create(
model_platform=ModelPlatformType.OPENAI_COMPATIBLE_MODEL,
model_type=model_name,
@@ -93,7 +93,7 @@ def construct_agent_list() -> List[Dict[str, Any]]:
api_key=api_key,
model_config_dict={"temperature": 0},
)
-
+
reasoning_model = ModelFactory.create(
model_platform=ModelPlatformType.OPENAI_COMPATIBLE_MODEL,
model_type=model_name,
@@ -119,7 +119,9 @@ def construct_agent_list() -> List[Dict[str, Any]]:
)
search_toolkit = SearchToolkit()
- document_processing_toolkit = DocumentProcessingToolkit(model=document_processing_model)
+ document_processing_toolkit = DocumentProcessingToolkit(
+ model=document_processing_model
+ )
code_runner_toolkit = CodeExecutionToolkit(sandbox="subprocess", verbose=True)
file_toolkit = FileToolkit()
excel_toolkit = ExcelToolkit()
@@ -154,9 +156,9 @@ Here are some tips that help you perform web search:
FunctionTool(search_toolkit.search_wiki),
FunctionTool(document_processing_toolkit.extract_document_content),
*browser_toolkit.get_tools(),
- ]
+ ],
)
-
+
document_processing_agent = ChatAgent(
"You are a helpful assistant that can process documents and multimodal data, and can interact with file system.",
document_processing_model,
@@ -164,9 +166,9 @@ Here are some tips that help you perform web search:
FunctionTool(document_processing_toolkit.extract_document_content),
FunctionTool(code_runner_toolkit.execute_code),
*file_toolkit.get_tools(),
- ]
+ ],
)
-
+
reasoning_coding_agent = ChatAgent(
"You are a helpful assistant that specializes in reasoning and coding, and can think step by step to solve the task. When necessary, you can write python code to solve the task. If you have written code, do not forget to execute the code. Never generate codes like 'example code', your code should be able to fully solve the task. You can also leverage multiple libraries, such as requests, BeautifulSoup, re, pandas, etc, to solve the task. For processing excel files, you should write codes to process them.",
reasoning_model,
@@ -174,27 +176,27 @@ Here are some tips that help you perform web search:
FunctionTool(code_runner_toolkit.execute_code),
FunctionTool(excel_toolkit.extract_excel_content),
FunctionTool(document_processing_toolkit.extract_document_content),
- ]
+ ],
)
agent_list = []
-
+
web_agent_dict = {
"name": "Web Agent",
"description": "A helpful assistant that can search the web, extract webpage content, and retrieve relevant information.",
- "agent": web_agent
+ "agent": web_agent,
}
-
+
document_processing_agent_dict = {
"name": "Document Processing Agent",
"description": "A helpful assistant that can process a variety of local and remote documents, including pdf, docx, images, audio, and video, etc.",
- "agent": document_processing_agent
+ "agent": document_processing_agent,
}
-
+
reasoning_coding_agent_dict = {
"name": "Reasoning Coding Agent",
"description": "A helpful assistant that specializes in reasoning, coding, and processing excel files. However, it cannot access the internet to search for information. If the task requires python execution, it should be informed to execute the code after writing it.",
- "agent": reasoning_coding_agent
+ "agent": reasoning_coding_agent,
}
agent_list.append(web_agent_dict)
@@ -205,12 +207,12 @@ Here are some tips that help you perform web search:
def construct_workforce() -> Workforce:
"""Construct a workforce with coordinator and task agents."""
-
+
# Get configuration from environment variables
api_url = os.getenv("VLLM_API_URL", "http://localhost:8000/v1")
api_key = os.getenv("VLLM_API_KEY", None)
model_name = os.getenv("VLLM_MODEL_NAME", "meta-llama/Llama-2-7b-chat-hf")
-
+
coordinator_agent_kwargs = {
"model": ModelFactory.create(
model_platform=ModelPlatformType.OPENAI_COMPATIBLE_MODEL,
@@ -220,7 +222,7 @@ def construct_workforce() -> Workforce:
model_config_dict={"temperature": 0},
)
}
-
+
task_agent_kwargs = {
"model": ModelFactory.create(
model_platform=ModelPlatformType.OPENAI_COMPATIBLE_MODEL,
@@ -230,17 +232,17 @@ def construct_workforce() -> Workforce:
model_config_dict={"temperature": 0},
)
}
-
+
task_agent = ChatAgent(
"You are a helpful assistant that can decompose tasks and assign tasks to workers.",
- **task_agent_kwargs
+ **task_agent_kwargs,
)
-
+
coordinator_agent = ChatAgent(
"You are a helpful assistant that can assign tasks to workers.",
- **coordinator_agent_kwargs
+ **coordinator_agent_kwargs,
)
-
+
workforce = Workforce(
"Workforce",
task_agent=task_agent,
@@ -248,7 +250,7 @@ def construct_workforce() -> Workforce:
)
agent_list = construct_agent_list()
-
+
for agent_dict in agent_list:
workforce.add_single_agent_worker(
agent_dict["description"],
@@ -262,14 +264,14 @@ def main():
r"""Main function to run the OWL system with an example question."""
# Default research question
default_task_prompt = "Summarize the github stars, fork counts, etc. of camel-ai's owl framework, and write the numbers into a python file using the plot package, save it locally, and run the generated python file. Note: You have been provided with the necessary tools to complete this task."
-
+
# Override default task if command line argument is provided
task_prompt = sys.argv[1] if len(sys.argv) > 1 else default_task_prompt
-
+
task = Task(
content=task_prompt,
)
-
+
workforce = construct_workforce()
processed_task = workforce.process_task(task)
@@ -280,4 +282,3 @@ def main():
if __name__ == "__main__":
main()
-
diff --git a/owl/utils/document_toolkit.py b/owl/utils/document_toolkit.py
index 5b4d1cf..6e5bbf4 100644
--- a/owl/utils/document_toolkit.py
+++ b/owl/utils/document_toolkit.py
@@ -238,10 +238,11 @@ class DocumentProcessingToolkit(BaseToolkit):
return str(data["data"][0]["markdown"])
else:
- logger.warning("Firecrawl API key is not set. Use crawl4ai to extract the content of the webpage.")
+ logger.warning(
+ "Firecrawl API key is not set. Use crawl4ai to extract the content of the webpage."
+ )
return self._extract_webpage_content_with_crawl4ai(url)
-
-
+
def _extract_webpage_content_with_crawl4ai(self, url: str) -> str:
r"""Extract the content of a webpage using crawl4ai."""
try:
@@ -250,7 +251,7 @@ class DocumentProcessingToolkit(BaseToolkit):
except Exception as e:
logger.error(f"Error while extracting the content of the webpage: {e}")
return "Error while extracting the content of the webpage."
-
+
async def _async_extract_webpage_content_with_crawl4ai(self, url: str) -> str:
r"""Async helper method to extract webpage content using crawl4ai."""
try:
@@ -262,10 +263,11 @@ class DocumentProcessingToolkit(BaseToolkit):
logger.warning("No markdown content extracted from the webpage.")
return "No content found on the webpage."
except Exception as e:
- logger.error(f"Error while extracting the content of the webpage with crawl4ai: {e}")
+ logger.error(
+ f"Error while extracting the content of the webpage with crawl4ai: {e}"
+ )
return "Error while extracting the content of the webpage."
-
def _download_file(self, url: str):
r"""Download a file from a URL and save it to the cache directory."""
try:
diff --git a/owl/utils/enhanced_role_playing.py b/owl/utils/enhanced_role_playing.py
index cba8321..9dda2c5 100644
--- a/owl/utils/enhanced_role_playing.py
+++ b/owl/utils/enhanced_role_playing.py
@@ -110,11 +110,11 @@ class OwlRolePlaying(RolePlaying):
if assistant_agent is not None:
# Ensure functionality consistent with our configuration
if (
- hasattr(assistant_agent, 'output_language')
+ hasattr(assistant_agent, "output_language")
and output_language is not None
):
assistant_agent.output_language = output_language
- if hasattr(assistant_agent, 'stop_event'):
+ if hasattr(assistant_agent, "stop_event"):
assistant_agent.stop_event = stop_event
self.assistant_agent = assistant_agent
# Handle potential None system_message - use provided or fallback
@@ -137,12 +137,9 @@ class OwlRolePlaying(RolePlaying):
if user_agent is not None:
# Ensure functionality consistent with our configuration
- if (
- hasattr(user_agent, 'output_language')
- and output_language is not None
- ):
+ if hasattr(user_agent, "output_language") and output_language is not None:
user_agent.output_language = output_language
- if hasattr(user_agent, 'stop_event'):
+ if hasattr(user_agent, "stop_event"):
user_agent.stop_event = stop_event
self.user_agent = user_agent
# Handle potential None system_message - use provided or fallback
diff --git a/owl/utils/gaia.py b/owl/utils/gaia.py
index 138e02c..a4afdd7 100644
--- a/owl/utils/gaia.py
+++ b/owl/utils/gaia.py
@@ -144,7 +144,9 @@ class GAIABenchmark(BaseBenchmark):
data["file_name"] = path / data["file_name"]
self._data[label].append(data)
else:
- raise FileNotFoundError(f"Metadata file not found: {metadata_parquet_path} or {metadata_jsonl_path}")
+ raise FileNotFoundError(
+ f"Metadata file not found: {metadata_parquet_path} or {metadata_jsonl_path}"
+ )
return self