minor update

This commit is contained in:
Sun Tao
2026-02-26 16:03:50 +08:00
parent 338087f95c
commit 5f4e80ae6d
12 changed files with 258 additions and 236 deletions

View File

@@ -18,10 +18,8 @@
[![Star][star-image]][star-url] [![Star][star-image]][star-url]
[![Package License][package-license-image]][package-license-url] [![Package License][package-license-image]][package-license-url]
</div> </div>
<hr> <hr>
<div align="center"> <div align="center">
@@ -56,10 +54,10 @@ Our vision is to revolutionize how AI agents collaborate to solve real-world tas
<br> <br>
</div> </div>
<!-- # Key Features --> <!-- # Key Features -->
# 📋 Table of Contents # 📋 Table of Contents
- [📋 Table of Contents](#-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 # 🔥 News
<div align="center" style="background-color: #e8f5e9; padding: 15px; border-radius: 10px; border: 2px solid #4caf50; margin: 20px 0;"> <div align="center" style="background-color: #e8f5e9; padding: 15px; border-radius: 10px; border: 2px solid #4caf50; margin: 20px 0;">
<h3 style="color: #2e7d32; margin: 0; font-size: 1.3em;"> <h3 style="color: #2e7d32; margin: 0; font-size: 1.3em;">
🧩 <b>NEW: COMMUNITY AGENT CHALLENGES!</b> 🧩 🧩 <b>NEW: COMMUNITY AGENT CHALLENGES!</b> 🧩
@@ -146,8 +143,8 @@ Our vision is to revolutionize how AI agents collaborate to solve real-world tas
</div> --> </div> -->
- **[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.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.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.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.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.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. - **[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.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. - **[2025.03.03]**: OWL achieved the #1 position among open-source frameworks on the GAIA benchmark with a score of 58.18.
# 🎬 Demo Video # 🎬 Demo Video
https://github.com/user-attachments/assets/2a2a825d-39ea-45c5-9ba1-f9d58efbc372 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** ## **Prerequisites**
### Install Python ### Install Python
Before installing OWL, ensure you have Python installed (version 3.10, 3.11, or 3.12 is supported): 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. > **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: You can set environment variables directly in your terminal:
- **macOS/Linux (Bash/Zsh)**: - **macOS/Linux (Bash/Zsh)**:
```bash ```bash
export OPENAI_API_KEY="your-openai-api-key-here" export OPENAI_API_KEY="your-openai-api-key-here"
# Add other required API keys as needed # Add other required API keys as needed
``` ```
- **Windows (Command Prompt)**: - **Windows (Command Prompt)**:
```batch ```batch
set OPENAI_API_KEY=your-openai-api-key-here 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: If you prefer using a `.env` file instead, you can:
1. **Copy and Rename the Template**: 1. **Copy and Rename the Template**:
```bash ```bash
# For macOS/Linux # For macOS/Linux
cd owl cd owl
cp .env_template .env cp .env_template .env
# For Windows # For Windows
cd owl cd owl
copy .env_template .env 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. OWL will then automatically invoke document-related tools to process the file and extract the answer.
### Example Tasks ### Example Tasks
Here are some tasks you can try with OWL: 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: 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. Before using MCP, you need to install Node.js first.
### **Install Node.js** ### **Install Node.js**
### Windows ### Windows
Download the official installer: [Node.js](https://nodejs.org/en). 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. Check "Add to PATH" option during installation.
### Linux ### Linux
```bash ```bash
sudo apt update sudo apt update
sudo apt install nodejs npm -y sudo apt install nodejs npm -y
``` ```
### Mac ### Mac
```bash ```bash
brew install node brew install node
``` ```
### **Install Playwright MCP Service** ### **Install Playwright MCP Service**
```bash ```bash
npm install -g @executeautomation/playwright-mcp-server npm install -g @executeautomation/playwright-mcp-server
npx playwright install-deps npx playwright install-deps
``` ```
Try our comprehensive MCP examples: Try our comprehensive MCP examples:
- `examples/run_mcp.py` - Basic MCP functionality demonstration (local call, requires dependencies) - `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) - `examples/run_mcp_sse.py` - Example using the SSE protocol (Use remote services, no dependencies)
@@ -538,17 +544,19 @@ tools = [
Key toolkits include: Key toolkits include:
### Multimodal Toolkits (Require multimodal model capabilities) ### Multimodal Toolkits (Require multimodal model capabilities)
- **BrowserToolkit**: Browser automation for web interaction and navigation - **BrowserToolkit**: Browser automation for web interaction and navigation
- **VideoAnalysisToolkit**: Video processing and content analysis - **VideoAnalysisToolkit**: Video processing and content analysis
- **ImageAnalysisToolkit**: Image analysis and interpretation - **ImageAnalysisToolkit**: Image analysis and interpretation
### Text-Based Toolkits ### Text-Based Toolkits
- **AudioAnalysisToolkit**: Audio processing (requires OpenAI API) - **AudioAnalysisToolkit**: Audio processing (requires OpenAI API)
- **CodeExecutionToolkit**: Python code execution and evaluation - **CodeExecutionToolkit**: Python code execution and evaluation
- **SearchToolkit**: Web searches (Google, DuckDuckGo, Wikipedia) - **SearchToolkit**: Web searches (Google, DuckDuckGo, Wikipedia)
- **DocumentProcessingToolkit**: Document parsing (PDF, DOCX, etc.) - **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 ## Customizing Your Configuration
@@ -613,6 +621,7 @@ Furthermore, to ensure optimal performance on the GAIA benchmark, please note th
When running the benchmark evaluation: When running the benchmark evaluation:
1. Switch to the `gaia69` branch: 1. Switch to the `gaia69` branch:
```bash ```bash
git checkout gaia69 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. This will execute the same configuration that achieved our top-ranking performance on the GAIA benchmark.
# ⏱️ Future Plans # ⏱️ Future Plans
We're continuously working to improve OWL. Here's what's on our roadmap: 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 3. Submit pull requests with your improvements
**Current Issues Open for Contribution:** **Current Issues Open for Contribution:**
- [#1915](https://github.com/camel-ai/camel/issues/1915) - [#1915](https://github.com/camel-ai/camel/issues/1915)
- [#2190](https://github.com/camel-ai/camel/issues/2190) - [#2190](https://github.com/camel-ai/camel/issues/2190)
- [#2165](https://github.com/camel-ai/camel/issues/2165) - [#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 # 🔥 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! Join us for further discussions!
<!-- ![](./assets/community.png) --> <!-- ![](./assets/community.png) -->
<img src="./assets/community_code.jpeg" width="50%" /> <img src="./assets/community_code.jpeg" width="50%" />
@@ -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?** **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?** **Q: How can I contribute to the project?**
@@ -709,16 +719,15 @@ cd camel
If you find this repo useful, please cite: If you find this repo useful, please cite:
``` ```
@misc{hu2025owl, @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}, 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}, year={2025},
eprint={2505.23885}, eprint={2505.23885},
archivePrefix={arXiv}, archivePrefix={arXiv},
primaryClass={cs.AI}, 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:
[![Star History Chart](https://api.star-history.com/svg?repos=camel-ai/owl&type=Date)](https://star-history.com/#camel-ai/owl&Date) [![Star History Chart](https://api.star-history.com/svg?repos=camel-ai/owl&type=Date)](https://star-history.com/#camel-ai/owl&Date)
[docs-image]: https://img.shields.io/badge/Documentation-EB3ECC [docs-image]: https://img.shields.io/badge/Documentation-EB3ECC
[docs-url]: https://camel-ai.github.io/camel/index.html [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-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 [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-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 [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-url]: https://colab.research.google.com/drive/1AzP33O8rnMW__7ocWJhVBXjKziJXPtim?usp=sharing
[colab-image]: https://colab.research.google.com/assets/colab-badge.svg [colab-image]: https://colab.research.google.com/assets/colab-badge.svg
[huggingface-url]: https://huggingface.co/camel-ai [huggingface-url]: https://huggingface.co/camel-ai

View File

@@ -2,7 +2,6 @@
🦉 OWL: 労働力学習の最適化による、現実世界のタスク自動化における一般的なマルチエージェント支援 🦉 OWL: 労働力学習の最適化による、現実世界のタスク自動化における一般的なマルチエージェント支援
</h1> </h1>
<div align="center"> <div align="center">
[![ドキュメント][docs-image]][docs-url] [![ドキュメント][docs-image]][docs-url]
@@ -15,10 +14,8 @@
[![Star][star-image]][star-url] [![Star][star-image]][star-url]
[![パッケージライセンス][package-license-image]][package-license-url] [![パッケージライセンス][package-license-image]][package-license-url]
</div> </div>
<hr> <hr>
<hr> <hr>
@@ -55,10 +52,10 @@
<br> <br>
</div> </div>
<!-- # Key Features --> <!-- # Key Features -->
# 📋 目次 # 📋 目次
- [📋 目次](#-目次) - [📋 目次](#-目次)
@@ -113,7 +110,6 @@
# 🔥 ニュース # 🔥 ニュース
<div align="center" style="background-color: #e8f5e9; padding: 15px; border-radius: 10px; border: 2px solid #4caf50; margin: 20px 0;"> <div align="center" style="background-color: #e8f5e9; padding: 15px; border-radius: 10px; border: 2px solid #4caf50; margin: 20px 0;">
<h3 style="color: #2e7d32; margin: 0; font-size: 1.3em;"> <h3 style="color: #2e7d32; margin: 0; font-size: 1.3em;">
🧩 <b>新機能:コミュニティエージェントチャレンジ!</b> 🧩 🧩 <b>新機能:コミュニティエージェントチャレンジ!</b> 🧩
@@ -255,6 +251,7 @@ OWLは、さまざまなサービスと対話するために複数のAPIキー
### オプション1`.env`ファイルを使用する(推奨) ### オプション1`.env`ファイルを使用する(推奨)
1. **テンプレートをコピーして名前を変更** 1. **テンプレートをコピーして名前を変更**
```bash ```bash
cd owl cd owl
cp .env_template .env cp .env_template .env
@@ -262,7 +259,7 @@ OWLは、さまざまなサービスと対話するために複数のAPIキー
2. **APIキーを設定** 2. **APIキーを設定**
お好みのテキストエディタで`.env`ファイルを開き、対応するフィールドにAPIキーを挿入します。 お好みのテキストエディタで`.env`ファイルを開き、対応するフィールドにAPIキーを挿入します。
> **注意**:最小限の例(`examples/run_mini.py`の場合、LLM APIキー`OPENAI_API_KEY`)のみを設定する必要があります。 > **注意**:最小限の例(`examples/run_mini.py`の場合、LLM APIキー`OPENAI_API_KEY`)のみを設定する必要があります。
### オプション2環境変数を直接設定 ### オプション2環境変数を直接設定
@@ -270,11 +267,13 @@ OWLは、さまざまなサービスと対話するために複数のAPIキー
または、ターミナルで環境変数を直接設定することもできます: または、ターミナルで環境変数を直接設定することもできます:
- **macOS/Linux (Bash/Zsh)** - **macOS/Linux (Bash/Zsh)**
```bash ```bash
export OPENAI_API_KEY="your-openai-api-key-here" export OPENAI_API_KEY="your-openai-api-key-here"
``` ```
- **Windows (コマンドプロンプト)** - **Windows (コマンドプロンプト)**
```batch ```batch
set OPENAI_API_KEY="your-openai-api-key-here" set OPENAI_API_KEY="your-openai-api-key-here"
``` ```
@@ -286,8 +285,6 @@ OWLは、さまざまなサービスと対話するために複数のAPIキー
> **注意**:ターミナルで直接設定された環境変数は、現在のセッションでのみ有効です。 > **注意**:ターミナルで直接設定された環境変数は、現在のセッションでのみ有効です。
## **Dockerでの実行** ## **Dockerでの実行**
OWLはDockerを使用して簡単にデプロイでき、異なるプラットフォーム間で一貫した環境を提供します。 OWLはDockerを使用して簡単にデプロイでき、異なるプラットフォーム間で一貫した環境を提供します。
@@ -435,7 +432,6 @@ print(f"\033[94mAnswer: {answer}\033[0m")
OWLは自動的にドキュメント関連のツールを呼び出してファイルを処理し、回答を抽出します。 OWLは自動的にドキュメント関連のツールを呼び出してファイルを処理し、回答を抽出します。
### 例のタスク ### 例のタスク
以下のタスクをOWLで試してみてください 以下のタスクをOWLで試してみてください
@@ -453,7 +449,9 @@ OWLは自動的にドキュメント関連のツールを呼び出してファ
OWLのMCP統合は、AIモデルがさまざまなツールやデータソースと相互作用するための標準化された方法を提供します OWLのMCP統合は、AIモデルがさまざまなツールやデータソースと相互作用するための標準化された方法を提供します
MCPを使用する前に、まずNode.jsをインストールする必要があります。 MCPを使用する前に、まずNode.jsをインストールする必要があります。
### **Node.jsのインストール** ### **Node.jsのインストール**
### Windows ### Windows
公式インストーラーをダウンロード:[Node.js](https://nodejs.org/en)。 公式インストーラーをダウンロード:[Node.js](https://nodejs.org/en)。
@@ -461,16 +459,20 @@ MCPを使用する前に、まずNode.jsをインストールする必要があ
インストール中に「Add to PATH」オプションをチェックします。 インストール中に「Add to PATH」オプションをチェックします。
### Linux ### Linux
```bash ```bash
sudo apt update sudo apt update
sudo apt install nodejs npm -y sudo apt install nodejs npm -y
``` ```
### Mac ### Mac
```bash ```bash
brew install node brew install node
``` ```
### **Playwright MCPサービスのインストール** ### **Playwright MCPサービスのインストール**
```bash ```bash
npm install -g @executeautomation/playwright-mcp-server npm install -g @executeautomation/playwright-mcp-server
npx playwright install-deps npx playwright install-deps
@@ -508,17 +510,19 @@ tools = [
主要なツールキットには以下が含まれます: 主要なツールキットには以下が含まれます:
### マルチモーダルツールキット(マルチモーダルモデル機能が必要) ### マルチモーダルツールキット(マルチモーダルモデル機能が必要)
- **BrowserToolkit**:ウェブインタラクションとナビゲーションのためのブラウザ自動化 - **BrowserToolkit**:ウェブインタラクションとナビゲーションのためのブラウザ自動化
- **VideoAnalysisToolkit**:ビデオ処理とコンテンツ分析 - **VideoAnalysisToolkit**:ビデオ処理とコンテンツ分析
- **ImageAnalysisToolkit**:画像解析と解釈 - **ImageAnalysisToolkit**:画像解析と解釈
### テキストベースのツールキット ### テキストベースのツールキット
- **AudioAnalysisToolkit**音声処理OpenAI APIが必要 - **AudioAnalysisToolkit**音声処理OpenAI APIが必要
- **CodeExecutionToolkit**Pythonコードの実行と評価 - **CodeExecutionToolkit**Pythonコードの実行と評価
- **SearchToolkit**ウェブ検索Google、DuckDuckGo、Wikipedia - **SearchToolkit**ウェブ検索Google、DuckDuckGo、Wikipedia
- **DocumentProcessingToolkit**ドキュメント解析PDF、DOCXなど - **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を再現するには: OWLのGAIAベンチマークスコア58.18を再現するには:
1. `gaia58.18`ブランチに切り替え: 1. `gaia58.18`ブランチに切り替え:
```bash ```bash
git checkout gaia58.18 git checkout gaia58.18
``` ```
@@ -608,7 +613,6 @@ OWLのGAIAベンチマークスコア58.18を再現するには:
このリポジトリが役立つと思われる場合は、以下を引用してください: このリポジトリが役立つと思われる場合は、以下を引用してください:
``` ```
@misc{owl2025, @misc{owl2025,
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},
@@ -628,6 +632,7 @@ OWLのGAIAベンチマークスコア58.18を再現するには:
3. 改善点を含むプルリクエストを提出する 3. 改善点を含むプルリクエストを提出する
**現在貢献を受け付けている問題:** **現在貢献を受け付けている問題:**
- [#1915](https://github.com/camel-ai/camel/issues/1915) - [#1915](https://github.com/camel-ai/camel/issues/1915)
- [#2190](https://github.com/camel-ai/camel/issues/2190) - [#2190](https://github.com/camel-ai/camel/issues/2190)
- [#2165](https://github.com/camel-ai/camel/issues/2165) - [#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) - [#1538](https://github.com/camel-ai/camel/issues/1538)
- [#1481](https://github.com/camel-ai/camel/issues/1481) - [#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))。
さらなる議論に参加してください! さらなる議論に参加してください!
<!-- ![](./assets/community.png) --> <!-- ![](./assets/community.png) -->
![](./assets/community.jpeg) ![](./assets/community.jpeg)
# ❓ FAQ # ❓ FAQ
@@ -676,15 +683,12 @@ cd camel
[![Star History Chart](https://api.star-history.com/svg?repos=camel-ai/owl&type=Date)](https://star-history.com/#camel-ai/owl&Date) [![Star History Chart](https://api.star-history.com/svg?repos=camel-ai/owl&type=Date)](https://star-history.com/#camel-ai/owl&Date)
[docs-image]: https://img.shields.io/badge/Documentation-EB3ECC [docs-image]: https://img.shields.io/badge/Documentation-EB3ECC
[docs-url]: https://camel-ai.github.io/camel/index.html [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-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 [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-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 [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-url]: https://colab.research.google.com/drive/1AzP33O8rnMW__7ocWJhVBXjKziJXPtim?usp=sharing
[colab-image]: https://colab.research.google.com/assets/colab-badge.svg [colab-image]: https://colab.research.google.com/assets/colab-badge.svg
[huggingface-url]: https://huggingface.co/camel-ai [huggingface-url]: https://huggingface.co/camel-ai

View File

@@ -3,7 +3,6 @@
🦉 OWL: 优化劳动力学习的通用智能体,用于处理现实世界的自动化任务 🦉 OWL: 优化劳动力学习的通用智能体,用于处理现实世界的自动化任务
</h1> </h1>
<div align="center"> <div align="center">
[![文档][docs-image]][docs-url] [![文档][docs-image]][docs-url]
@@ -16,7 +15,6 @@
[![Star][star-image]][star-url] [![Star][star-image]][star-url]
[![软件许可证][package-license-image]][package-license-url] [![软件许可证][package-license-image]][package-license-url]
</div> </div>
<div align="center"> <div align="center">
@@ -49,14 +47,12 @@
![](./assets/owl_architecture.png) ![](./assets/owl_architecture.png)
<br> <br>
</div> </div>
<!-- # Key Features --> <!-- # Key Features -->
# 📋 目录 # 📋 目录
- [📋 目录](#-目录) - [📋 目录](#-目录)
@@ -252,6 +248,7 @@ OWL 需要各种 API 密钥来与不同的服务进行交互。`owl/.env_templat
### 选项 1使用 `.env` 文件(推荐) ### 选项 1使用 `.env` 文件(推荐)
1. **复制并重命名模板** 1. **复制并重命名模板**
```bash ```bash
cd owl cd owl
cp .env_template .env cp .env_template .env
@@ -259,7 +256,7 @@ OWL 需要各种 API 密钥来与不同的服务进行交互。`owl/.env_templat
2. **配置你的 API 密钥** 2. **配置你的 API 密钥**
在你喜欢的文本编辑器中打开 `.env` 文件,并在相应字段中插入你的 API 密钥。 在你喜欢的文本编辑器中打开 `.env` 文件,并在相应字段中插入你的 API 密钥。
> **注意**:对于最小示例(`examples/run_mini.py`),你只需要配置 LLM API 密钥(例如,`OPENAI_API_KEY`)。 > **注意**:对于最小示例(`examples/run_mini.py`),你只需要配置 LLM API 密钥(例如,`OPENAI_API_KEY`)。
### 选项 2直接设置环境变量 ### 选项 2直接设置环境变量
@@ -267,11 +264,13 @@ OWL 需要各种 API 密钥来与不同的服务进行交互。`owl/.env_templat
或者,你可以直接在终端中设置环境变量: 或者,你可以直接在终端中设置环境变量:
- **macOS/Linux (Bash/Zsh)** - **macOS/Linux (Bash/Zsh)**
```bash ```bash
export OPENAI_API_KEY="你的-openai-api-密钥" export OPENAI_API_KEY="你的-openai-api-密钥"
``` ```
- **Windows (命令提示符)** - **Windows (命令提示符)**
```batch ```batch
set OPENAI_API_KEY="你的-openai-api-密钥" set OPENAI_API_KEY="你的-openai-api-密钥"
``` ```
@@ -359,7 +358,7 @@ npx -y @wonderwhy-er/desktop-commander setup --force-file-protocol
# 🚀 快速开始 # 🚀 快速开始
## 基本用法 ## 基本用法
运行以下示例: 运行以下示例:
```bash ```bash
@@ -438,6 +437,7 @@ print(f"答案:{answer}")
OWL 将自动调用与文档相关的工具来处理文件并提取答案。 OWL 将自动调用与文档相关的工具来处理文件并提取答案。
你可以尝试以下示例任务: 你可以尝试以下示例任务:
- "查询苹果公司的最新股票价格" - "查询苹果公司的最新股票价格"
- "分析关于气候变化的最新推文情绪" - "分析关于气候变化的最新推文情绪"
- "帮我调试这段 Python 代码:[在此粘贴你的代码]" - "帮我调试这段 Python 代码:[在此粘贴你的代码]"
@@ -449,7 +449,9 @@ OWL 将自动调用与文档相关的工具来处理文件并提取答案。
OWL 的 MCP 集成为 AI 模型与各种工具和数据源的交互提供了标准化的方式。 OWL 的 MCP 集成为 AI 模型与各种工具和数据源的交互提供了标准化的方式。
在使用MCP前需要先安装Node.js。 在使用MCP前需要先安装Node.js。
### **安装 Node.js** ### **安装 Node.js**
### Windows ### Windows
下载官方安装包:[Node.js](https://nodejs.org/zh-cn)。 下载官方安装包:[Node.js](https://nodejs.org/zh-cn)。
@@ -457,22 +459,27 @@ OWL 的 MCP 集成为 AI 模型与各种工具和数据源的交互提供了标
安装时,勾选 "Add to PATH" 选项。 安装时,勾选 "Add to PATH" 选项。
### Linux ### Linux
```bash ```bash
sudo apt update sudo apt update
sudo apt install nodejs npm -y sudo apt install nodejs npm -y
``` ```
### Mac ### Mac
```bash ```bash
brew install node brew install node
``` ```
### **安装 MCP 服务** ### **安装 MCP 服务**
```bash ```bash
npm install -g @executeautomation/playwright-mcp-server npm install -g @executeautomation/playwright-mcp-server
npx playwright install-deps npx playwright install-deps
``` ```
查看我们的MCP示例 查看我们的MCP示例
- `examples/run_mcp.py` - 基础MCP功能演示 (本地调用,需要安装依赖) - `examples/run_mcp.py` - 基础MCP功能演示 (本地调用,需要安装依赖)
- `examples/run_mcp_sse.py` - 使用SSE协议的示例 (使用远程服务,无需安装依赖) - `examples/run_mcp_sse.py` - 使用SSE协议的示例 (使用远程服务,无需安装依赖)
@@ -506,17 +513,19 @@ tools = [
关键工具包包括: 关键工具包包括:
### 多模态工具包(需要模型具备多模态能力) ### 多模态工具包(需要模型具备多模态能力)
- **BrowserToolkit**:浏览器自动化,用于网页交互和导航 - **BrowserToolkit**:浏览器自动化,用于网页交互和导航
- **VideoAnalysisToolkit**:视频处理和内容分析 - **VideoAnalysisToolkit**:视频处理和内容分析
- **ImageAnalysisToolkit**:图像分析和解释 - **ImageAnalysisToolkit**:图像分析和解释
### 基于文本的工具包 ### 基于文本的工具包
- **AudioAnalysisToolkit**:音频处理(需要 OpenAI API - **AudioAnalysisToolkit**:音频处理(需要 OpenAI API
- **CodeExecutionToolkit**Python 代码执行和评估 - **CodeExecutionToolkit**Python 代码执行和评估
- **SearchToolkit**网络搜索Google、DuckDuckGo、维基百科 - **SearchToolkit**网络搜索Google、DuckDuckGo、维基百科
- **DocumentProcessingToolkit**文档解析PDF、DOCX等 - **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 分: 要复现我们在 GAIA 基准测试中获得的 58.18 分:
1. 切换到 `gaia58.18` 分支: 1. 切换到 `gaia58.18` 分支:
```bash ```bash
git checkout gaia58.18 git checkout gaia58.18
``` ```
2. 运行评估脚本: 2. 运行评估脚本:
```bash ```bash
python examples/run_gaia_roleplaying.py python examples/run_gaia_roleplaying.py
``` ```
@@ -605,7 +616,6 @@ python examples/run_gaia_roleplaying.py
如果你觉得这个仓库对你有帮助,请引用: 如果你觉得这个仓库对你有帮助,请引用:
``` ```
@misc{owl2025, @misc{owl2025,
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},
@@ -625,6 +635,7 @@ python examples/run_gaia_roleplaying.py
3. 提交包含您改进的拉取请求 3. 提交包含您改进的拉取请求
**当前开放贡献的问题:** **当前开放贡献的问题:**
- [#1915](https://github.com/camel-ai/camel/issues/1915) - [#1915](https://github.com/camel-ai/camel/issues/1915)
- [#2190](https://github.com/camel-ai/camel/issues/2190) - [#2190](https://github.com/camel-ai/camel/issues/2190)
- [#2165](https://github.com/camel-ai/camel/issues/2165) - [#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 [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-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 [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-url]: https://colab.research.google.com/drive/1AzP33O8rnMW__7ocWJhVBXjKziJXPtim?usp=sharing
[colab-image]: https://colab.research.google.com/assets/colab-badge.svg [colab-image]: https://colab.research.google.com/assets/colab-badge.svg
[huggingface-url]: https://huggingface.co/camel-ai [huggingface-url]: https://huggingface.co/camel-ai

View File

@@ -18,12 +18,10 @@ from camel.models import ModelFactory
from camel.agents import ChatAgent from camel.agents import ChatAgent
from camel.toolkits import ( from camel.toolkits import (
FunctionTool, FunctionTool,
AudioAnalysisToolkit,
CodeExecutionToolkit, CodeExecutionToolkit,
ExcelToolkit, ExcelToolkit,
ImageAnalysisToolkit, ImageAnalysisToolkit,
SearchToolkit, SearchToolkit,
VideoAnalysisToolkit,
BrowserToolkit, BrowserToolkit,
FileToolkit, FileToolkit,
) )
@@ -45,26 +43,25 @@ set_log_level(level="DEBUG")
def construct_agent_list() -> List[Dict[str, Any]]: def construct_agent_list() -> List[Dict[str, Any]]:
web_model = ModelFactory.create( web_model = ModelFactory.create(
model_platform=ModelPlatformType.OPENAI, model_platform=ModelPlatformType.OPENAI,
model_type=ModelType.GPT_5_2, model_type=ModelType.GPT_5_2,
model_config_dict={"temperature": 0}, model_config_dict={"temperature": 0},
) )
document_processing_model = ModelFactory.create( document_processing_model = ModelFactory.create(
model_platform=ModelPlatformType.OPENAI, model_platform=ModelPlatformType.OPENAI,
model_type=ModelType.GPT_5_2, model_type=ModelType.GPT_5_2,
model_config_dict={"temperature": 0}, model_config_dict={"temperature": 0},
) )
reasoning_model = ModelFactory.create( reasoning_model = ModelFactory.create(
model_platform=ModelPlatformType.OPENAI, model_platform=ModelPlatformType.OPENAI,
model_type=ModelType.GPT_5_2, model_type=ModelType.GPT_5_2,
model_config_dict={"temperature": 0}, model_config_dict={"temperature": 0},
) )
image_analysis_model = ModelFactory.create( image_analysis_model = ModelFactory.create(
model_platform=ModelPlatformType.OPENAI, model_platform=ModelPlatformType.OPENAI,
model_type=ModelType.GPT_5_2, model_type=ModelType.GPT_5_2,
model_config_dict={"temperature": 0}, model_config_dict={"temperature": 0},
@@ -83,7 +80,9 @@ def construct_agent_list() -> List[Dict[str, Any]]:
) )
search_toolkit = SearchToolkit() 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) image_analysis_toolkit = ImageAnalysisToolkit(model=image_analysis_model)
code_runner_toolkit = CodeExecutionToolkit(sandbox="subprocess", verbose=True) code_runner_toolkit = CodeExecutionToolkit(sandbox="subprocess", verbose=True)
file_toolkit = FileToolkit() file_toolkit = FileToolkit()
@@ -95,7 +94,7 @@ def construct_agent_list() -> List[Dict[str, Any]]:
) )
web_agent = ChatAgent( 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. 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: Keep in mind that:
- Do not be overly confident in your own knowledge. Searching can provide a broader perspective and help validate existing knowledge. - 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(search_toolkit.search_wiki),
FunctionTool(document_processing_toolkit.extract_document_content), FunctionTool(document_processing_toolkit.extract_document_content),
*browser_toolkit.get_tools(), *browser_toolkit.get_tools(),
] ],
) )
document_processing_agent = ChatAgent( document_processing_agent = ChatAgent(
"You are a helpful assistant that can process documents and multimodal data, and can interact with file system.", "You are a helpful assistant that can process documents and multimodal data, and can interact with file system.",
document_processing_model, 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(image_analysis_toolkit.ask_question_about_image),
FunctionTool(code_runner_toolkit.execute_code), FunctionTool(code_runner_toolkit.execute_code),
*file_toolkit.get_tools(), *file_toolkit.get_tools(),
] ],
) )
reasoning_coding_agent = ChatAgent( 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.", "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, reasoning_model,
@@ -142,27 +141,27 @@ Here are some tips that help you perform web search:
FunctionTool(code_runner_toolkit.execute_code), FunctionTool(code_runner_toolkit.execute_code),
FunctionTool(excel_toolkit.extract_excel_content), FunctionTool(excel_toolkit.extract_excel_content),
FunctionTool(document_processing_toolkit.extract_document_content), FunctionTool(document_processing_toolkit.extract_document_content),
] ],
) )
agent_list = [] agent_list = []
web_agent_dict = { web_agent_dict = {
"name": "Web Agent", "name": "Web Agent",
"description": "A helpful assistant that can search the web, extract webpage content, simulate browser actions, and retrieve relevant information.", "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 = { document_processing_agent_dict = {
"name": "Document Processing Agent", "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.", "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 = { reasoning_coding_agent_dict = {
"name": "Reasoning Coding Agent", "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.", "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) agent_list.append(web_agent_dict)
@@ -172,7 +171,6 @@ Here are some tips that help you perform web search:
def construct_workforce() -> Workforce: def construct_workforce() -> Workforce:
coordinator_agent_kwargs = { coordinator_agent_kwargs = {
"model": ModelFactory.create( "model": ModelFactory.create(
model_platform=ModelPlatformType.OPENAI, model_platform=ModelPlatformType.OPENAI,
@@ -180,7 +178,7 @@ def construct_workforce() -> Workforce:
model_config_dict={"temperature": 0}, model_config_dict={"temperature": 0},
) )
} }
task_agent_kwargs = { task_agent_kwargs = {
"model": ModelFactory.create( "model": ModelFactory.create(
model_platform=ModelPlatformType.OPENAI, model_platform=ModelPlatformType.OPENAI,
@@ -188,17 +186,17 @@ def construct_workforce() -> Workforce:
model_config_dict={"temperature": 0}, model_config_dict={"temperature": 0},
) )
} }
task_agent = ChatAgent( task_agent = ChatAgent(
"You are a helpful assistant that can decompose tasks and assign tasks to workers.", "You are a helpful assistant that can decompose tasks and assign tasks to workers.",
**task_agent_kwargs **task_agent_kwargs,
) )
coordinator_agent = ChatAgent( coordinator_agent = ChatAgent(
"You are a helpful assistant that can assign tasks to workers.", "You are a helpful assistant that can assign tasks to workers.",
**coordinator_agent_kwargs **coordinator_agent_kwargs,
) )
workforce = Workforce( workforce = Workforce(
"Workforce", "Workforce",
task_agent=task_agent, task_agent=task_agent,
@@ -206,7 +204,7 @@ def construct_workforce() -> Workforce:
) )
agent_list = construct_agent_list() agent_list = construct_agent_list()
for agent_dict in agent_list: for agent_dict in agent_list:
workforce.add_single_agent_worker( workforce.add_single_agent_worker(
agent_dict["description"], agent_dict["description"],
@@ -220,14 +218,14 @@ def main():
r"""Main function to run the OWL system with an example question.""" r"""Main function to run the OWL system with an example question."""
# Default research 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." 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 # Override default task if command line argument is provided
task_prompt = sys.argv[1] if len(sys.argv) > 1 else default_task_prompt task_prompt = sys.argv[1] if len(sys.argv) > 1 else default_task_prompt
task = Task( task = Task(
content=task_prompt, content=task_prompt,
) )
workforce = construct_workforce() workforce = construct_workforce()
processed_task = workforce.process_task(task) processed_task = workforce.process_task(task)

View File

@@ -27,12 +27,10 @@ from camel.models import ModelFactory
from camel.agents import ChatAgent from camel.agents import ChatAgent
from camel.toolkits import ( from camel.toolkits import (
FunctionTool, FunctionTool,
AudioAnalysisToolkit,
CodeExecutionToolkit, CodeExecutionToolkit,
ExcelToolkit, ExcelToolkit,
ImageAnalysisToolkit, ImageAnalysisToolkit,
SearchToolkit, SearchToolkit,
VideoAnalysisToolkit,
BrowserToolkit, BrowserToolkit,
FileToolkit, FileToolkit,
) )
@@ -55,26 +53,26 @@ set_log_level(level="DEBUG")
def construct_agent_list() -> List[Dict[str, Any]]: def construct_agent_list() -> List[Dict[str, Any]]:
"""Construct a list of agents with their configurations.""" """Construct a list of agents with their configurations."""
web_model = ModelFactory.create( web_model = ModelFactory.create(
model_platform=ModelPlatformType.ANTHROPIC, model_platform=ModelPlatformType.ANTHROPIC,
model_type=ModelType.CLAUDE_OPUS_4_6, model_type=ModelType.CLAUDE_OPUS_4_6,
model_config_dict={"temperature": 0}, model_config_dict={"temperature": 0},
) )
document_processing_model = ModelFactory.create( document_processing_model = ModelFactory.create(
model_platform=ModelPlatformType.ANTHROPIC, model_platform=ModelPlatformType.ANTHROPIC,
model_type=ModelType.CLAUDE_OPUS_4_6, model_type=ModelType.CLAUDE_OPUS_4_6,
model_config_dict={"temperature": 0}, model_config_dict={"temperature": 0},
) )
reasoning_model = ModelFactory.create( reasoning_model = ModelFactory.create(
model_platform=ModelPlatformType.ANTHROPIC, model_platform=ModelPlatformType.ANTHROPIC,
model_type=ModelType.CLAUDE_OPUS_4_6, model_type=ModelType.CLAUDE_OPUS_4_6,
model_config_dict={"temperature": 0}, model_config_dict={"temperature": 0},
) )
image_analysis_model = ModelFactory.create( image_analysis_model = ModelFactory.create(
model_platform=ModelPlatformType.ANTHROPIC, model_platform=ModelPlatformType.ANTHROPIC,
model_type=ModelType.CLAUDE_OPUS_4_6, model_type=ModelType.CLAUDE_OPUS_4_6,
model_config_dict={"temperature": 0}, model_config_dict={"temperature": 0},
@@ -93,7 +91,9 @@ def construct_agent_list() -> List[Dict[str, Any]]:
) )
search_toolkit = SearchToolkit() 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) image_analysis_toolkit = ImageAnalysisToolkit(model=image_analysis_model)
code_runner_toolkit = CodeExecutionToolkit(sandbox="subprocess", verbose=True) code_runner_toolkit = CodeExecutionToolkit(sandbox="subprocess", verbose=True)
file_toolkit = FileToolkit() file_toolkit = FileToolkit()
@@ -129,9 +129,9 @@ Here are some tips that help you perform web search:
FunctionTool(search_toolkit.search_wiki), FunctionTool(search_toolkit.search_wiki),
FunctionTool(document_processing_toolkit.extract_document_content), FunctionTool(document_processing_toolkit.extract_document_content),
*browser_toolkit.get_tools(), *browser_toolkit.get_tools(),
] ],
) )
document_processing_agent = ChatAgent( document_processing_agent = ChatAgent(
"You are a helpful assistant that can process documents and multimodal data, and can interact with file system.", "You are a helpful assistant that can process documents and multimodal data, and can interact with file system.",
document_processing_model, 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(image_analysis_toolkit.ask_question_about_image),
FunctionTool(code_runner_toolkit.execute_code), FunctionTool(code_runner_toolkit.execute_code),
*file_toolkit.get_tools(), *file_toolkit.get_tools(),
] ],
) )
reasoning_coding_agent = ChatAgent( 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.", "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, reasoning_model,
@@ -150,27 +150,27 @@ Here are some tips that help you perform web search:
FunctionTool(code_runner_toolkit.execute_code), FunctionTool(code_runner_toolkit.execute_code),
FunctionTool(excel_toolkit.extract_excel_content), FunctionTool(excel_toolkit.extract_excel_content),
FunctionTool(document_processing_toolkit.extract_document_content), FunctionTool(document_processing_toolkit.extract_document_content),
] ],
) )
agent_list = [] agent_list = []
web_agent_dict = { web_agent_dict = {
"name": "Web Agent", "name": "Web Agent",
"description": "A helpful assistant that can search the web, extract webpage content, simulate browser actions, and retrieve relevant information.", "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 = { document_processing_agent_dict = {
"name": "Document Processing Agent", "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.", "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 = { reasoning_coding_agent_dict = {
"name": "Reasoning Coding Agent", "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.", "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) agent_list.append(web_agent_dict)
@@ -181,7 +181,7 @@ Here are some tips that help you perform web search:
def construct_workforce() -> Workforce: def construct_workforce() -> Workforce:
"""Construct a workforce with coordinator and task agents.""" """Construct a workforce with coordinator and task agents."""
coordinator_agent_kwargs = { coordinator_agent_kwargs = {
"model": ModelFactory.create( "model": ModelFactory.create(
model_platform=ModelPlatformType.ANTHROPIC, model_platform=ModelPlatformType.ANTHROPIC,
@@ -189,7 +189,7 @@ def construct_workforce() -> Workforce:
model_config_dict={"temperature": 0}, model_config_dict={"temperature": 0},
) )
} }
task_agent_kwargs = { task_agent_kwargs = {
"model": ModelFactory.create( "model": ModelFactory.create(
model_platform=ModelPlatformType.ANTHROPIC, model_platform=ModelPlatformType.ANTHROPIC,
@@ -197,17 +197,17 @@ def construct_workforce() -> Workforce:
model_config_dict={"temperature": 0}, model_config_dict={"temperature": 0},
) )
} }
task_agent = ChatAgent( task_agent = ChatAgent(
"You are a helpful assistant that can decompose tasks and assign tasks to workers.", "You are a helpful assistant that can decompose tasks and assign tasks to workers.",
**task_agent_kwargs **task_agent_kwargs,
) )
coordinator_agent = ChatAgent( coordinator_agent = ChatAgent(
"You are a helpful assistant that can assign tasks to workers.", "You are a helpful assistant that can assign tasks to workers.",
**coordinator_agent_kwargs **coordinator_agent_kwargs,
) )
workforce = Workforce( workforce = Workforce(
"Workforce", "Workforce",
task_agent=task_agent, task_agent=task_agent,
@@ -215,7 +215,7 @@ def construct_workforce() -> Workforce:
) )
agent_list = construct_agent_list() agent_list = construct_agent_list()
for agent_dict in agent_list: for agent_dict in agent_list:
workforce.add_single_agent_worker( workforce.add_single_agent_worker(
agent_dict["description"], agent_dict["description"],
@@ -229,14 +229,14 @@ def main():
r"""Main function to run the OWL system with an example question.""" r"""Main function to run the OWL system with an example question."""
# Default research 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." 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 # Override default task if command line argument is provided
task_prompt = sys.argv[1] if len(sys.argv) > 1 else default_task_prompt task_prompt = sys.argv[1] if len(sys.argv) > 1 else default_task_prompt
task = Task( task = Task(
content=task_prompt, content=task_prompt,
) )
workforce = construct_workforce() workforce = construct_workforce()
processed_task = workforce.process_task(task) processed_task = workforce.process_task(task)
@@ -247,4 +247,3 @@ def main():
if __name__ == "__main__": if __name__ == "__main__":
main() main()

View File

@@ -51,19 +51,19 @@ set_log_level(level="DEBUG")
def construct_agent_list() -> List[Dict[str, Any]]: def construct_agent_list() -> List[Dict[str, Any]]:
"""Construct a list of agents with their configurations.""" """Construct a list of agents with their configurations."""
web_model = ModelFactory.create( web_model = ModelFactory.create(
model_platform=ModelPlatformType.DEEPSEEK, model_platform=ModelPlatformType.DEEPSEEK,
model_type=ModelType.DEEPSEEK_CHAT, model_type=ModelType.DEEPSEEK_CHAT,
model_config_dict={"temperature": 0}, model_config_dict={"temperature": 0},
) )
document_processing_model = ModelFactory.create( document_processing_model = ModelFactory.create(
model_platform=ModelPlatformType.DEEPSEEK, model_platform=ModelPlatformType.DEEPSEEK,
model_type=ModelType.DEEPSEEK_CHAT, model_type=ModelType.DEEPSEEK_CHAT,
model_config_dict={"temperature": 0}, model_config_dict={"temperature": 0},
) )
reasoning_model = ModelFactory.create( reasoning_model = ModelFactory.create(
model_platform=ModelPlatformType.DEEPSEEK, model_platform=ModelPlatformType.DEEPSEEK,
model_type=ModelType.DEEPSEEK_CHAT, model_type=ModelType.DEEPSEEK_CHAT,
@@ -71,7 +71,9 @@ def construct_agent_list() -> List[Dict[str, Any]]:
) )
search_toolkit = SearchToolkit() 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) code_runner_toolkit = CodeExecutionToolkit(sandbox="subprocess", verbose=True)
file_toolkit = FileToolkit() file_toolkit = FileToolkit()
excel_toolkit = ExcelToolkit() 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_wiki),
FunctionTool(search_toolkit.search_baidu), FunctionTool(search_toolkit.search_baidu),
FunctionTool(document_processing_toolkit.extract_document_content), FunctionTool(document_processing_toolkit.extract_document_content),
] ],
) )
document_processing_agent = ChatAgent( document_processing_agent = ChatAgent(
"You are a helpful assistant that can process documents and multimodal data, and can interact with file system.", "You are a helpful assistant that can process documents and multimodal data, and can interact with file system.",
document_processing_model, 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(document_processing_toolkit.extract_document_content),
FunctionTool(code_runner_toolkit.execute_code), FunctionTool(code_runner_toolkit.execute_code),
*file_toolkit.get_tools(), *file_toolkit.get_tools(),
] ],
) )
reasoning_coding_agent = ChatAgent( 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.", "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, reasoning_model,
@@ -116,27 +118,27 @@ Here are some tips that help you perform web search:
FunctionTool(code_runner_toolkit.execute_code), FunctionTool(code_runner_toolkit.execute_code),
FunctionTool(excel_toolkit.extract_excel_content), FunctionTool(excel_toolkit.extract_excel_content),
FunctionTool(document_processing_toolkit.extract_document_content), FunctionTool(document_processing_toolkit.extract_document_content),
] ],
) )
agent_list = [] agent_list = []
web_agent_dict = { web_agent_dict = {
"name": "Web Agent", "name": "Web Agent",
"description": "A helpful assistant that can search the web, extract webpage content, and retrieve relevant information.", "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 = { document_processing_agent_dict = {
"name": "Document Processing Agent", "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.", "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 = { reasoning_coding_agent_dict = {
"name": "Reasoning Coding Agent", "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.", "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) agent_list.append(web_agent_dict)
@@ -147,7 +149,7 @@ Here are some tips that help you perform web search:
def construct_workforce() -> Workforce: def construct_workforce() -> Workforce:
"""Construct a workforce with coordinator and task agents.""" """Construct a workforce with coordinator and task agents."""
coordinator_agent_kwargs = { coordinator_agent_kwargs = {
"model": ModelFactory.create( "model": ModelFactory.create(
model_platform=ModelPlatformType.DEEPSEEK, model_platform=ModelPlatformType.DEEPSEEK,
@@ -155,7 +157,7 @@ def construct_workforce() -> Workforce:
model_config_dict={"temperature": 0}, model_config_dict={"temperature": 0},
) )
} }
task_agent_kwargs = { task_agent_kwargs = {
"model": ModelFactory.create( "model": ModelFactory.create(
model_platform=ModelPlatformType.DEEPSEEK, model_platform=ModelPlatformType.DEEPSEEK,
@@ -163,17 +165,17 @@ def construct_workforce() -> Workforce:
model_config_dict={"temperature": 0}, model_config_dict={"temperature": 0},
) )
} }
task_agent = ChatAgent( task_agent = ChatAgent(
"You are a helpful assistant that can decompose tasks and assign tasks to workers.", "You are a helpful assistant that can decompose tasks and assign tasks to workers.",
**task_agent_kwargs **task_agent_kwargs,
) )
coordinator_agent = ChatAgent( coordinator_agent = ChatAgent(
"You are a helpful assistant that can assign tasks to workers.", "You are a helpful assistant that can assign tasks to workers.",
**coordinator_agent_kwargs **coordinator_agent_kwargs,
) )
workforce = Workforce( workforce = Workforce(
"Workforce", "Workforce",
task_agent=task_agent, task_agent=task_agent,
@@ -181,7 +183,7 @@ def construct_workforce() -> Workforce:
) )
agent_list = construct_agent_list() agent_list = construct_agent_list()
for agent_dict in agent_list: for agent_dict in agent_list:
workforce.add_single_agent_worker( workforce.add_single_agent_worker(
agent_dict["description"], agent_dict["description"],
@@ -195,14 +197,14 @@ def main():
r"""Main function to run the OWL system with an example question.""" r"""Main function to run the OWL system with an example question."""
# Default research question # Default research question
default_task_prompt = "Search for recent news about the OWL project and generate a report, then save it locally." 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 # Override default task if command line argument is provided
task_prompt = sys.argv[1] if len(sys.argv) > 1 else default_task_prompt task_prompt = sys.argv[1] if len(sys.argv) > 1 else default_task_prompt
task = Task( task = Task(
content=task_prompt, content=task_prompt,
) )
workforce = construct_workforce() workforce = construct_workforce()
processed_task = workforce.process_task(task) processed_task = workforce.process_task(task)
@@ -213,4 +215,3 @@ def main():
if __name__ == "__main__": if __name__ == "__main__":
main() main()

View File

@@ -58,20 +58,20 @@ set_log_level(level="DEBUG")
def construct_agent_list() -> List[Dict[str, Any]]: def construct_agent_list() -> List[Dict[str, Any]]:
"""Construct a list of agents with their configurations.""" """Construct a list of agents with their configurations."""
# Use larger models for tool-intensive roles # Use larger models for tool-intensive roles
web_model = ModelFactory.create( web_model = ModelFactory.create(
model_platform=ModelPlatformType.GROQ, model_platform=ModelPlatformType.GROQ,
model_type=ModelType.GROQ_LLAMA_3_3_70B, model_type=ModelType.GROQ_LLAMA_3_3_70B,
model_config_dict={"temperature": 0}, model_config_dict={"temperature": 0},
) )
document_processing_model = ModelFactory.create( document_processing_model = ModelFactory.create(
model_platform=ModelPlatformType.GROQ, model_platform=ModelPlatformType.GROQ,
model_type=ModelType.GROQ_LLAMA_3_3_70B, model_type=ModelType.GROQ_LLAMA_3_3_70B,
model_config_dict={"temperature": 0}, model_config_dict={"temperature": 0},
) )
reasoning_model = ModelFactory.create( reasoning_model = ModelFactory.create(
model_platform=ModelPlatformType.GROQ, model_platform=ModelPlatformType.GROQ,
model_type=ModelType.GROQ_LLAMA_3_3_70B, model_type=ModelType.GROQ_LLAMA_3_3_70B,
@@ -91,7 +91,9 @@ def construct_agent_list() -> List[Dict[str, Any]]:
) )
search_toolkit = SearchToolkit() 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) code_runner_toolkit = CodeExecutionToolkit(sandbox="subprocess", verbose=True)
file_toolkit = FileToolkit() file_toolkit = FileToolkit()
excel_toolkit = ExcelToolkit() excel_toolkit = ExcelToolkit()
@@ -126,9 +128,9 @@ Here are some tips that help you perform web search:
FunctionTool(search_toolkit.search_wiki), FunctionTool(search_toolkit.search_wiki),
FunctionTool(document_processing_toolkit.extract_document_content), FunctionTool(document_processing_toolkit.extract_document_content),
*browser_toolkit.get_tools(), *browser_toolkit.get_tools(),
] ],
) )
document_processing_agent = ChatAgent( document_processing_agent = ChatAgent(
"You are a helpful assistant that can process documents and multimodal data, and can interact with file system.", "You are a helpful assistant that can process documents and multimodal data, and can interact with file system.",
document_processing_model, 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(document_processing_toolkit.extract_document_content),
FunctionTool(code_runner_toolkit.execute_code), FunctionTool(code_runner_toolkit.execute_code),
*file_toolkit.get_tools(), *file_toolkit.get_tools(),
] ],
) )
reasoning_coding_agent = ChatAgent( 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.", "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, reasoning_model,
@@ -146,27 +148,27 @@ Here are some tips that help you perform web search:
FunctionTool(code_runner_toolkit.execute_code), FunctionTool(code_runner_toolkit.execute_code),
FunctionTool(excel_toolkit.extract_excel_content), FunctionTool(excel_toolkit.extract_excel_content),
FunctionTool(document_processing_toolkit.extract_document_content), FunctionTool(document_processing_toolkit.extract_document_content),
] ],
) )
agent_list = [] agent_list = []
web_agent_dict = { web_agent_dict = {
"name": "Web Agent", "name": "Web Agent",
"description": "A helpful assistant that can search the web, extract webpage content, and retrieve relevant information.", "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 = { document_processing_agent_dict = {
"name": "Document Processing Agent", "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.", "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 = { reasoning_coding_agent_dict = {
"name": "Reasoning Coding Agent", "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.", "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) agent_list.append(web_agent_dict)
@@ -177,7 +179,7 @@ Here are some tips that help you perform web search:
def construct_workforce() -> Workforce: def construct_workforce() -> Workforce:
"""Construct a workforce with coordinator and task agents.""" """Construct a workforce with coordinator and task agents."""
# Use smaller model for coordinator and task agent (they don't need tool capabilities) # Use smaller model for coordinator and task agent (they don't need tool capabilities)
coordinator_agent_kwargs = { coordinator_agent_kwargs = {
"model": ModelFactory.create( "model": ModelFactory.create(
@@ -186,7 +188,7 @@ def construct_workforce() -> Workforce:
model_config_dict={"temperature": 0}, model_config_dict={"temperature": 0},
) )
} }
task_agent_kwargs = { task_agent_kwargs = {
"model": ModelFactory.create( "model": ModelFactory.create(
model_platform=ModelPlatformType.GROQ, model_platform=ModelPlatformType.GROQ,
@@ -194,17 +196,17 @@ def construct_workforce() -> Workforce:
model_config_dict={"temperature": 0}, model_config_dict={"temperature": 0},
) )
} }
task_agent = ChatAgent( task_agent = ChatAgent(
"You are a helpful assistant that can decompose tasks and assign tasks to workers.", "You are a helpful assistant that can decompose tasks and assign tasks to workers.",
**task_agent_kwargs **task_agent_kwargs,
) )
coordinator_agent = ChatAgent( coordinator_agent = ChatAgent(
"You are a helpful assistant that can assign tasks to workers.", "You are a helpful assistant that can assign tasks to workers.",
**coordinator_agent_kwargs **coordinator_agent_kwargs,
) )
workforce = Workforce( workforce = Workforce(
"Workforce", "Workforce",
task_agent=task_agent, task_agent=task_agent,
@@ -212,7 +214,7 @@ def construct_workforce() -> Workforce:
) )
agent_list = construct_agent_list() agent_list = construct_agent_list()
for agent_dict in agent_list: for agent_dict in agent_list:
workforce.add_single_agent_worker( workforce.add_single_agent_worker(
agent_dict["description"], agent_dict["description"],
@@ -226,14 +228,14 @@ def main():
r"""Main function to run the OWL system with an example question.""" r"""Main function to run the OWL system with an example question."""
# Default research 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." 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 # Override default task if command line argument is provided
task_prompt = sys.argv[1] if len(sys.argv) > 1 else default_task_prompt task_prompt = sys.argv[1] if len(sys.argv) > 1 else default_task_prompt
task = Task( task = Task(
content=task_prompt, content=task_prompt,
) )
workforce = construct_workforce() workforce = construct_workforce()
processed_task = workforce.process_task(task) processed_task = workforce.process_task(task)
@@ -244,4 +246,3 @@ def main():
if __name__ == "__main__": if __name__ == "__main__":
main() main()

View File

@@ -31,11 +31,10 @@ from camel.toolkits import (
ExcelToolkit, ExcelToolkit,
ImageAnalysisToolkit, ImageAnalysisToolkit,
SearchToolkit, SearchToolkit,
VideoAnalysisToolkit,
BrowserToolkit, BrowserToolkit,
FileToolkit, FileToolkit,
) )
from camel.types import ModelPlatformType, ModelType from camel.types import ModelPlatformType
from camel.logger import set_log_level from camel.logger import set_log_level
from camel.tasks.task import Task from camel.tasks.task import Task
@@ -54,26 +53,26 @@ set_log_level(level="DEBUG")
def construct_agent_list() -> List[Dict[str, Any]]: def construct_agent_list() -> List[Dict[str, Any]]:
"""Construct a list of agents with their configurations.""" """Construct a list of agents with their configurations."""
web_model = ModelFactory.create( web_model = ModelFactory.create(
model_platform=ModelPlatformType.QWEN, model_platform=ModelPlatformType.QWEN,
model_type="qwen3.5-plus", model_type="qwen3.5-plus",
model_config_dict={"temperature": 0}, model_config_dict={"temperature": 0},
) )
document_processing_model = ModelFactory.create( document_processing_model = ModelFactory.create(
model_platform=ModelPlatformType.QWEN, model_platform=ModelPlatformType.QWEN,
model_type="qwen3.5-plus", model_type="qwen3.5-plus",
model_config_dict={"temperature": 0}, model_config_dict={"temperature": 0},
) )
reasoning_model = ModelFactory.create( reasoning_model = ModelFactory.create(
model_platform=ModelPlatformType.QWEN, model_platform=ModelPlatformType.QWEN,
model_type="qwen3.5-plus", model_type="qwen3.5-plus",
model_config_dict={"temperature": 0}, model_config_dict={"temperature": 0},
) )
image_analysis_model = ModelFactory.create( image_analysis_model = ModelFactory.create(
model_platform=ModelPlatformType.QWEN, model_platform=ModelPlatformType.QWEN,
model_type="qwen3.5-plus", model_type="qwen3.5-plus",
model_config_dict={"temperature": 0}, model_config_dict={"temperature": 0},
@@ -92,7 +91,9 @@ def construct_agent_list() -> List[Dict[str, Any]]:
) )
search_toolkit = SearchToolkit() 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) image_analysis_toolkit = ImageAnalysisToolkit(model=image_analysis_model)
code_runner_toolkit = CodeExecutionToolkit(sandbox="subprocess", verbose=True) code_runner_toolkit = CodeExecutionToolkit(sandbox="subprocess", verbose=True)
file_toolkit = FileToolkit() file_toolkit = FileToolkit()
@@ -129,9 +130,9 @@ Here are some tips that help you perform web search:
FunctionTool(search_toolkit.search_baidu), FunctionTool(search_toolkit.search_baidu),
FunctionTool(document_processing_toolkit.extract_document_content), FunctionTool(document_processing_toolkit.extract_document_content),
*browser_toolkit.get_tools(), *browser_toolkit.get_tools(),
] ],
) )
document_processing_agent = ChatAgent( document_processing_agent = ChatAgent(
"You are a helpful assistant that can process documents and multimodal data, and can interact with file system.", "You are a helpful assistant that can process documents and multimodal data, and can interact with file system.",
document_processing_model, 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(image_analysis_toolkit.ask_question_about_image),
FunctionTool(code_runner_toolkit.execute_code), FunctionTool(code_runner_toolkit.execute_code),
*file_toolkit.get_tools(), *file_toolkit.get_tools(),
] ],
) )
reasoning_coding_agent = ChatAgent( 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.", "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, reasoning_model,
@@ -150,27 +151,27 @@ Here are some tips that help you perform web search:
FunctionTool(code_runner_toolkit.execute_code), FunctionTool(code_runner_toolkit.execute_code),
FunctionTool(excel_toolkit.extract_excel_content), FunctionTool(excel_toolkit.extract_excel_content),
FunctionTool(document_processing_toolkit.extract_document_content), FunctionTool(document_processing_toolkit.extract_document_content),
] ],
) )
agent_list = [] agent_list = []
web_agent_dict = { web_agent_dict = {
"name": "Web Agent", "name": "Web Agent",
"description": "A helpful assistant that can search the web, extract webpage content, and retrieve relevant information.", "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 = { document_processing_agent_dict = {
"name": "Document Processing Agent", "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.", "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 = { reasoning_coding_agent_dict = {
"name": "Reasoning Coding Agent", "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.", "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) agent_list.append(web_agent_dict)
@@ -181,7 +182,7 @@ Here are some tips that help you perform web search:
def construct_workforce() -> Workforce: def construct_workforce() -> Workforce:
"""Construct a workforce with coordinator and task agents.""" """Construct a workforce with coordinator and task agents."""
coordinator_agent_kwargs = { coordinator_agent_kwargs = {
"model": ModelFactory.create( "model": ModelFactory.create(
model_platform=ModelPlatformType.QWEN, model_platform=ModelPlatformType.QWEN,
@@ -189,7 +190,7 @@ def construct_workforce() -> Workforce:
model_config_dict={"temperature": 0}, model_config_dict={"temperature": 0},
) )
} }
task_agent_kwargs = { task_agent_kwargs = {
"model": ModelFactory.create( "model": ModelFactory.create(
model_platform=ModelPlatformType.QWEN, model_platform=ModelPlatformType.QWEN,
@@ -197,17 +198,17 @@ def construct_workforce() -> Workforce:
model_config_dict={"temperature": 0}, model_config_dict={"temperature": 0},
) )
} }
task_agent = ChatAgent( task_agent = ChatAgent(
"You are a helpful assistant that can decompose tasks and assign tasks to workers.", "You are a helpful assistant that can decompose tasks and assign tasks to workers.",
**task_agent_kwargs **task_agent_kwargs,
) )
coordinator_agent = ChatAgent( coordinator_agent = ChatAgent(
"You are a helpful assistant that can assign tasks to workers.", "You are a helpful assistant that can assign tasks to workers.",
**coordinator_agent_kwargs **coordinator_agent_kwargs,
) )
workforce = Workforce( workforce = Workforce(
"Workforce", "Workforce",
task_agent=task_agent, task_agent=task_agent,
@@ -215,7 +216,7 @@ def construct_workforce() -> Workforce:
) )
agent_list = construct_agent_list() agent_list = construct_agent_list()
for agent_dict in agent_list: for agent_dict in agent_list:
workforce.add_single_agent_worker( workforce.add_single_agent_worker(
agent_dict["description"], agent_dict["description"],
@@ -229,14 +230,14 @@ def main():
r"""Main function to run the OWL system with an example question.""" r"""Main function to run the OWL system with an example question."""
# Default research 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." 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 # Override default task if command line argument is provided
task_prompt = sys.argv[1] if len(sys.argv) > 1 else default_task_prompt task_prompt = sys.argv[1] if len(sys.argv) > 1 else default_task_prompt
task = Task( task = Task(
content=task_prompt, content=task_prompt,
) )
workforce = construct_workforce() workforce = construct_workforce()
processed_task = workforce.process_task(task) processed_task = workforce.process_task(task)
@@ -247,4 +248,3 @@ def main():
if __name__ == "__main__": if __name__ == "__main__":
main() main()

View File

@@ -72,12 +72,12 @@ set_log_level(level="DEBUG")
def construct_agent_list() -> List[Dict[str, Any]]: def construct_agent_list() -> List[Dict[str, Any]]:
"""Construct a list of agents with their configurations.""" """Construct a list of agents with their configurations."""
# Get configuration from environment variables # Get configuration from environment variables
api_url = os.getenv("VLLM_API_URL", "http://localhost:8000/v1") api_url = os.getenv("VLLM_API_URL", "http://localhost:8000/v1")
api_key = os.getenv("VLLM_API_KEY", None) api_key = os.getenv("VLLM_API_KEY", None)
model_name = os.getenv("VLLM_MODEL_NAME", "meta-llama/Llama-3.1-8B-Instruct") model_name = os.getenv("VLLM_MODEL_NAME", "meta-llama/Llama-3.1-8B-Instruct")
web_model = ModelFactory.create( web_model = ModelFactory.create(
model_platform=ModelPlatformType.OPENAI_COMPATIBLE_MODEL, model_platform=ModelPlatformType.OPENAI_COMPATIBLE_MODEL,
model_type=model_name, model_type=model_name,
@@ -85,7 +85,7 @@ def construct_agent_list() -> List[Dict[str, Any]]:
api_key=api_key, api_key=api_key,
model_config_dict={"temperature": 0}, model_config_dict={"temperature": 0},
) )
document_processing_model = ModelFactory.create( document_processing_model = ModelFactory.create(
model_platform=ModelPlatformType.OPENAI_COMPATIBLE_MODEL, model_platform=ModelPlatformType.OPENAI_COMPATIBLE_MODEL,
model_type=model_name, model_type=model_name,
@@ -93,7 +93,7 @@ def construct_agent_list() -> List[Dict[str, Any]]:
api_key=api_key, api_key=api_key,
model_config_dict={"temperature": 0}, model_config_dict={"temperature": 0},
) )
reasoning_model = ModelFactory.create( reasoning_model = ModelFactory.create(
model_platform=ModelPlatformType.OPENAI_COMPATIBLE_MODEL, model_platform=ModelPlatformType.OPENAI_COMPATIBLE_MODEL,
model_type=model_name, model_type=model_name,
@@ -119,7 +119,9 @@ def construct_agent_list() -> List[Dict[str, Any]]:
) )
search_toolkit = SearchToolkit() 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) code_runner_toolkit = CodeExecutionToolkit(sandbox="subprocess", verbose=True)
file_toolkit = FileToolkit() file_toolkit = FileToolkit()
excel_toolkit = ExcelToolkit() excel_toolkit = ExcelToolkit()
@@ -154,9 +156,9 @@ Here are some tips that help you perform web search:
FunctionTool(search_toolkit.search_wiki), FunctionTool(search_toolkit.search_wiki),
FunctionTool(document_processing_toolkit.extract_document_content), FunctionTool(document_processing_toolkit.extract_document_content),
*browser_toolkit.get_tools(), *browser_toolkit.get_tools(),
] ],
) )
document_processing_agent = ChatAgent( document_processing_agent = ChatAgent(
"You are a helpful assistant that can process documents and multimodal data, and can interact with file system.", "You are a helpful assistant that can process documents and multimodal data, and can interact with file system.",
document_processing_model, 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(document_processing_toolkit.extract_document_content),
FunctionTool(code_runner_toolkit.execute_code), FunctionTool(code_runner_toolkit.execute_code),
*file_toolkit.get_tools(), *file_toolkit.get_tools(),
] ],
) )
reasoning_coding_agent = ChatAgent( 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.", "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, reasoning_model,
@@ -174,27 +176,27 @@ Here are some tips that help you perform web search:
FunctionTool(code_runner_toolkit.execute_code), FunctionTool(code_runner_toolkit.execute_code),
FunctionTool(excel_toolkit.extract_excel_content), FunctionTool(excel_toolkit.extract_excel_content),
FunctionTool(document_processing_toolkit.extract_document_content), FunctionTool(document_processing_toolkit.extract_document_content),
] ],
) )
agent_list = [] agent_list = []
web_agent_dict = { web_agent_dict = {
"name": "Web Agent", "name": "Web Agent",
"description": "A helpful assistant that can search the web, extract webpage content, and retrieve relevant information.", "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 = { document_processing_agent_dict = {
"name": "Document Processing Agent", "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.", "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 = { reasoning_coding_agent_dict = {
"name": "Reasoning Coding Agent", "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.", "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) agent_list.append(web_agent_dict)
@@ -205,12 +207,12 @@ Here are some tips that help you perform web search:
def construct_workforce() -> Workforce: def construct_workforce() -> Workforce:
"""Construct a workforce with coordinator and task agents.""" """Construct a workforce with coordinator and task agents."""
# Get configuration from environment variables # Get configuration from environment variables
api_url = os.getenv("VLLM_API_URL", "http://localhost:8000/v1") api_url = os.getenv("VLLM_API_URL", "http://localhost:8000/v1")
api_key = os.getenv("VLLM_API_KEY", None) api_key = os.getenv("VLLM_API_KEY", None)
model_name = os.getenv("VLLM_MODEL_NAME", "meta-llama/Llama-2-7b-chat-hf") model_name = os.getenv("VLLM_MODEL_NAME", "meta-llama/Llama-2-7b-chat-hf")
coordinator_agent_kwargs = { coordinator_agent_kwargs = {
"model": ModelFactory.create( "model": ModelFactory.create(
model_platform=ModelPlatformType.OPENAI_COMPATIBLE_MODEL, model_platform=ModelPlatformType.OPENAI_COMPATIBLE_MODEL,
@@ -220,7 +222,7 @@ def construct_workforce() -> Workforce:
model_config_dict={"temperature": 0}, model_config_dict={"temperature": 0},
) )
} }
task_agent_kwargs = { task_agent_kwargs = {
"model": ModelFactory.create( "model": ModelFactory.create(
model_platform=ModelPlatformType.OPENAI_COMPATIBLE_MODEL, model_platform=ModelPlatformType.OPENAI_COMPATIBLE_MODEL,
@@ -230,17 +232,17 @@ def construct_workforce() -> Workforce:
model_config_dict={"temperature": 0}, model_config_dict={"temperature": 0},
) )
} }
task_agent = ChatAgent( task_agent = ChatAgent(
"You are a helpful assistant that can decompose tasks and assign tasks to workers.", "You are a helpful assistant that can decompose tasks and assign tasks to workers.",
**task_agent_kwargs **task_agent_kwargs,
) )
coordinator_agent = ChatAgent( coordinator_agent = ChatAgent(
"You are a helpful assistant that can assign tasks to workers.", "You are a helpful assistant that can assign tasks to workers.",
**coordinator_agent_kwargs **coordinator_agent_kwargs,
) )
workforce = Workforce( workforce = Workforce(
"Workforce", "Workforce",
task_agent=task_agent, task_agent=task_agent,
@@ -248,7 +250,7 @@ def construct_workforce() -> Workforce:
) )
agent_list = construct_agent_list() agent_list = construct_agent_list()
for agent_dict in agent_list: for agent_dict in agent_list:
workforce.add_single_agent_worker( workforce.add_single_agent_worker(
agent_dict["description"], agent_dict["description"],
@@ -262,14 +264,14 @@ def main():
r"""Main function to run the OWL system with an example question.""" r"""Main function to run the OWL system with an example question."""
# Default research 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." 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 # Override default task if command line argument is provided
task_prompt = sys.argv[1] if len(sys.argv) > 1 else default_task_prompt task_prompt = sys.argv[1] if len(sys.argv) > 1 else default_task_prompt
task = Task( task = Task(
content=task_prompt, content=task_prompt,
) )
workforce = construct_workforce() workforce = construct_workforce()
processed_task = workforce.process_task(task) processed_task = workforce.process_task(task)
@@ -280,4 +282,3 @@ def main():
if __name__ == "__main__": if __name__ == "__main__":
main() main()

View File

@@ -238,10 +238,11 @@ class DocumentProcessingToolkit(BaseToolkit):
return str(data["data"][0]["markdown"]) return str(data["data"][0]["markdown"])
else: 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) return self._extract_webpage_content_with_crawl4ai(url)
def _extract_webpage_content_with_crawl4ai(self, url: str) -> str: def _extract_webpage_content_with_crawl4ai(self, url: str) -> str:
r"""Extract the content of a webpage using crawl4ai.""" r"""Extract the content of a webpage using crawl4ai."""
try: try:
@@ -250,7 +251,7 @@ class DocumentProcessingToolkit(BaseToolkit):
except Exception as e: except Exception as e:
logger.error(f"Error while extracting the content of the webpage: {e}") logger.error(f"Error while extracting the content of the webpage: {e}")
return "Error while extracting the content of the webpage." return "Error while extracting the content of the webpage."
async def _async_extract_webpage_content_with_crawl4ai(self, url: str) -> str: async def _async_extract_webpage_content_with_crawl4ai(self, url: str) -> str:
r"""Async helper method to extract webpage content using crawl4ai.""" r"""Async helper method to extract webpage content using crawl4ai."""
try: try:
@@ -262,10 +263,11 @@ class DocumentProcessingToolkit(BaseToolkit):
logger.warning("No markdown content extracted from the webpage.") logger.warning("No markdown content extracted from the webpage.")
return "No content found on the webpage." return "No content found on the webpage."
except Exception as e: 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." return "Error while extracting the content of the webpage."
def _download_file(self, url: str): def _download_file(self, url: str):
r"""Download a file from a URL and save it to the cache directory.""" r"""Download a file from a URL and save it to the cache directory."""
try: try:

View File

@@ -110,11 +110,11 @@ class OwlRolePlaying(RolePlaying):
if assistant_agent is not None: if assistant_agent is not None:
# Ensure functionality consistent with our configuration # Ensure functionality consistent with our configuration
if ( if (
hasattr(assistant_agent, 'output_language') hasattr(assistant_agent, "output_language")
and output_language is not None and output_language is not None
): ):
assistant_agent.output_language = output_language assistant_agent.output_language = output_language
if hasattr(assistant_agent, 'stop_event'): if hasattr(assistant_agent, "stop_event"):
assistant_agent.stop_event = stop_event assistant_agent.stop_event = stop_event
self.assistant_agent = assistant_agent self.assistant_agent = assistant_agent
# Handle potential None system_message - use provided or fallback # Handle potential None system_message - use provided or fallback
@@ -137,12 +137,9 @@ class OwlRolePlaying(RolePlaying):
if user_agent is not None: if user_agent is not None:
# Ensure functionality consistent with our configuration # Ensure functionality consistent with our configuration
if ( if hasattr(user_agent, "output_language") and output_language is not None:
hasattr(user_agent, 'output_language')
and output_language is not None
):
user_agent.output_language = output_language user_agent.output_language = output_language
if hasattr(user_agent, 'stop_event'): if hasattr(user_agent, "stop_event"):
user_agent.stop_event = stop_event user_agent.stop_event = stop_event
self.user_agent = user_agent self.user_agent = user_agent
# Handle potential None system_message - use provided or fallback # Handle potential None system_message - use provided or fallback

View File

@@ -144,7 +144,9 @@ class GAIABenchmark(BaseBenchmark):
data["file_name"] = path / data["file_name"] data["file_name"] = path / data["file_name"]
self._data[label].append(data) self._data[label].append(data)
else: 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 return self