mirror of
https://github.com/camel-ai/owl.git
synced 2025-12-26 10:07:51 +08:00
Merge branch 'main' into mcp_feature
This commit is contained in:
commit
af090cdcc3
10
README.md
10
README.md
@ -122,7 +122,7 @@ https://private-user-images.githubusercontent.com/55657767/420212194-e813fc05-13
|
||||
- **Browser Automation**: Utilize the Playwright framework for simulating browser interactions, including scrolling, clicking, input handling, downloading, navigation, and more.
|
||||
- **Document Parsing**: Extract content from Word, Excel, PDF, and PowerPoint files, converting them into text or Markdown format.
|
||||
- **Code Execution**: Write and execute Python code using interpreter.
|
||||
- **Built-in Toolkits**: Access to a comprehensive set of built-in toolkits including ArxivToolkit, AudioAnalysisToolkit, CodeExecutionToolkit, DalleToolkit, DataCommonsToolkit, ExcelToolkit, GitHubToolkit, GoogleMapsToolkit, GoogleScholarToolkit, ImageAnalysisToolkit, MathToolkit, NetworkXToolkit, NotionToolkit, OpenAPIToolkit, RedditToolkit, SearchToolkit, SemanticScholarToolkit, SymPyToolkit, VideoAnalysisToolkit, WeatherToolkit, WebToolkit, and many more for specialized tasks.
|
||||
- **Built-in Toolkits**: Access to a comprehensive set of built-in toolkits including ArxivToolkit, AudioAnalysisToolkit, CodeExecutionToolkit, DalleToolkit, DataCommonsToolkit, ExcelToolkit, GitHubToolkit, GoogleMapsToolkit, GoogleScholarToolkit, ImageAnalysisToolkit, MathToolkit, NetworkXToolkit, NotionToolkit, OpenAPIToolkit, RedditToolkit, SearchToolkit, SemanticScholarToolkit, SymPyToolkit, VideoAnalysisToolkit, WeatherToolkit, BrowserToolkit, and many more for specialized tasks.
|
||||
|
||||
# 🛠️ Installation
|
||||
|
||||
@ -362,7 +362,7 @@ OWL supports various toolkits that can be customized by modifying the `tools` li
|
||||
```python
|
||||
# Configure toolkits
|
||||
tools = [
|
||||
*WebToolkit(headless=False).get_tools(), # Browser automation
|
||||
*BrowserToolkit(headless=False).get_tools(), # Browser automation
|
||||
*VideoAnalysisToolkit(model=models["video"]).get_tools(),
|
||||
*AudioAnalysisToolkit().get_tools(), # Requires OpenAI Key
|
||||
*CodeExecutionToolkit(sandbox="subprocess").get_tools(),
|
||||
@ -381,7 +381,7 @@ tools = [
|
||||
Key toolkits include:
|
||||
|
||||
### Multimodal Toolkits (Require multimodal model capabilities)
|
||||
- **WebToolkit**: Browser automation for web interaction and navigation
|
||||
- **BrowserToolkit**: Browser automation for web interaction and navigation
|
||||
- **VideoAnalysisToolkit**: Video processing and content analysis
|
||||
- **ImageAnalysisToolkit**: Image analysis and interpretation
|
||||
|
||||
@ -399,11 +399,11 @@ To customize available tools:
|
||||
|
||||
```python
|
||||
# 1. Import toolkits
|
||||
from camel.toolkits import WebToolkit, SearchToolkit, CodeExecutionToolkit
|
||||
from camel.toolkits import BrowserToolkit, SearchToolkit, CodeExecutionToolkit
|
||||
|
||||
# 2. Configure tools list
|
||||
tools = [
|
||||
*WebToolkit(headless=True).get_tools(),
|
||||
*BrowserToolkit(headless=True).get_tools(),
|
||||
SearchToolkit().search_wiki,
|
||||
*CodeExecutionToolkit(sandbox="subprocess").get_tools(),
|
||||
]
|
||||
|
||||
10
README_zh.md
10
README_zh.md
@ -123,7 +123,7 @@ https://private-user-images.githubusercontent.com/55657767/420212194-e813fc05-13
|
||||
- **浏览器操作**:借助Playwright框架开发浏览器模拟交互,支持页面滚动、点击、输入、下载、历史回退等功能
|
||||
- **文件解析**:word、excel、PDF、PowerPoint信息提取,内容转文本/Markdown
|
||||
- **代码执行**:编写python代码,并使用解释器运行
|
||||
- **丰富工具包**:提供丰富的工具包,包括ArxivToolkit(学术论文检索)、AudioAnalysisToolkit(音频分析)、CodeExecutionToolkit(代码执行)、DalleToolkit(图像生成)、DataCommonsToolkit(数据共享)、ExcelToolkit(Excel处理)、GitHubToolkit(GitHub交互)、GoogleMapsToolkit(地图服务)、GoogleScholarToolkit(学术搜索)、ImageAnalysisToolkit(图像分析)、MathToolkit(数学计算)、NetworkXToolkit(图形分析)、NotionToolkit(Notion交互)、OpenAPIToolkit(API操作)、RedditToolkit(Reddit交互)、SearchToolkit(搜索服务)、SemanticScholarToolkit(语义学术搜索)、SymPyToolkit(符号计算)、VideoAnalysisToolkit(视频分析)、WeatherToolkit(天气查询)、WebToolkit(网页交互)等多种专业工具,满足各类特定任务需求。
|
||||
- **丰富工具包**:提供丰富的工具包,包括ArxivToolkit(学术论文检索)、AudioAnalysisToolkit(音频分析)、CodeExecutionToolkit(代码执行)、DalleToolkit(图像生成)、DataCommonsToolkit(数据共享)、ExcelToolkit(Excel处理)、GitHubToolkit(GitHub交互)、GoogleMapsToolkit(地图服务)、GoogleScholarToolkit(学术搜索)、ImageAnalysisToolkit(图像分析)、MathToolkit(数学计算)、NetworkXToolkit(图形分析)、NotionToolkit(Notion交互)、OpenAPIToolkit(API操作)、RedditToolkit(Reddit交互)、SearchToolkit(搜索服务)、SemanticScholarToolkit(语义学术搜索)、SymPyToolkit(符号计算)、VideoAnalysisToolkit(视频分析)、WeatherToolkit(天气查询)、BrowserToolkit(网页交互)等多种专业工具,满足各类特定任务需求。
|
||||
|
||||
# 🛠️ 安装
|
||||
|
||||
@ -356,7 +356,7 @@ OWL支持多种工具包,可通过修改脚本中的`tools`列表进行自定
|
||||
```python
|
||||
# 配置工具包
|
||||
tools = [
|
||||
*WebToolkit(headless=False).get_tools(), # 浏览器自动化
|
||||
*BrowserToolkit(headless=False).get_tools(), # 浏览器自动化
|
||||
*VideoAnalysisToolkit(model=models["video"]).get_tools(),
|
||||
*AudioAnalysisToolkit().get_tools(), # 需要OpenAI API密钥
|
||||
*CodeExecutionToolkit(sandbox="subprocess").get_tools(),
|
||||
@ -375,7 +375,7 @@ tools = [
|
||||
关键工具包包括:
|
||||
|
||||
### 多模态工具包(需要模型具备多模态能力)
|
||||
- **WebToolkit**:浏览器自动化,用于网页交互和导航
|
||||
- **BrowserToolkit**:浏览器自动化,用于网页交互和导航
|
||||
- **VideoAnalysisToolkit**:视频处理和内容分析
|
||||
- **ImageAnalysisToolkit**:图像分析和解释
|
||||
|
||||
@ -393,11 +393,11 @@ tools = [
|
||||
|
||||
```python
|
||||
# 1. 导入工具包
|
||||
from camel.toolkits import WebToolkit, SearchToolkit, CodeExecutionToolkit
|
||||
from camel.toolkits import BrowserToolkit, SearchToolkit, CodeExecutionToolkit
|
||||
|
||||
# 2. 配置工具列表
|
||||
tools = [
|
||||
*WebToolkit(headless=True).get_tools(),
|
||||
*BrowserToolkit(headless=True).get_tools(),
|
||||
SearchToolkit().search_wiki,
|
||||
*CodeExecutionToolkit(sandbox="subprocess").get_tools(),
|
||||
]
|
||||
|
||||
@ -20,7 +20,7 @@ from camel.toolkits import (
|
||||
ImageAnalysisToolkit,
|
||||
SearchToolkit,
|
||||
VideoAnalysisToolkit,
|
||||
WebToolkit,
|
||||
BrowserToolkit,
|
||||
FileWriteToolkit,
|
||||
)
|
||||
from camel.types import ModelPlatformType, ModelType
|
||||
@ -84,7 +84,7 @@ def construct_society(question: str) -> OwlRolePlaying:
|
||||
|
||||
# Configure toolkits
|
||||
tools = [
|
||||
*WebToolkit(
|
||||
*BrowserToolkit(
|
||||
headless=False, # Set to True for headless mode (e.g., on remote servers)
|
||||
web_agent_model=models["web"],
|
||||
planning_agent_model=models["planning"],
|
||||
|
||||
@ -26,7 +26,7 @@ from camel.toolkits import (
|
||||
ImageAnalysisToolkit,
|
||||
SearchToolkit,
|
||||
VideoAnalysisToolkit,
|
||||
WebToolkit,
|
||||
BrowserToolkit,
|
||||
FileWriteToolkit,
|
||||
)
|
||||
from camel.types import ModelPlatformType, ModelType
|
||||
@ -91,7 +91,7 @@ def main():
|
||||
|
||||
# Configure toolkits
|
||||
tools = [
|
||||
*WebToolkit(
|
||||
*BrowserToolkit(
|
||||
headless=False, # Set to True for headless mode (e.g., on remote servers)
|
||||
web_agent_model=models["web"],
|
||||
planning_agent_model=models["planning"],
|
||||
|
||||
@ -16,7 +16,7 @@ from dotenv import load_dotenv
|
||||
from camel.models import ModelFactory
|
||||
from camel.toolkits import (
|
||||
SearchToolkit,
|
||||
WebToolkit,
|
||||
BrowserToolkit,
|
||||
FileWriteToolkit,
|
||||
)
|
||||
from camel.types import ModelPlatformType, ModelType
|
||||
@ -65,7 +65,7 @@ def construct_society(question: str) -> OwlRolePlaying:
|
||||
|
||||
# Configure toolkits
|
||||
tools = [
|
||||
*WebToolkit(
|
||||
*BrowserToolkit(
|
||||
headless=False, # Set to True for headless mode (e.g., on remote servers)
|
||||
web_agent_model=models["web"],
|
||||
planning_agent_model=models["planning"],
|
||||
|
||||
@ -20,7 +20,7 @@ from camel.toolkits import (
|
||||
ExcelToolkit,
|
||||
ImageAnalysisToolkit,
|
||||
SearchToolkit,
|
||||
WebToolkit,
|
||||
BrowserToolkit,
|
||||
FileWriteToolkit,
|
||||
)
|
||||
from camel.types import ModelPlatformType
|
||||
@ -80,7 +80,7 @@ def construct_society(question: str) -> OwlRolePlaying:
|
||||
|
||||
# Configure toolkits
|
||||
tools = [
|
||||
*WebToolkit(
|
||||
*BrowserToolkit(
|
||||
headless=False, # Set to True for headless mode (e.g., on remote servers)
|
||||
web_agent_model=models["web"],
|
||||
planning_agent_model=models["planning"],
|
||||
|
||||
@ -20,7 +20,7 @@ from camel.toolkits import (
|
||||
ExcelToolkit,
|
||||
ImageAnalysisToolkit,
|
||||
SearchToolkit,
|
||||
WebToolkit,
|
||||
BrowserToolkit,
|
||||
FileWriteToolkit,
|
||||
)
|
||||
from camel.types import ModelPlatformType
|
||||
@ -85,7 +85,7 @@ def construct_society(question: str) -> OwlRolePlaying:
|
||||
|
||||
# Configure toolkits
|
||||
tools = [
|
||||
*WebToolkit(
|
||||
*BrowserToolkit(
|
||||
headless=False, # Set to True for headless mode (e.g., on remote servers)
|
||||
web_agent_model=models["web"],
|
||||
planning_agent_model=models["planning"],
|
||||
|
||||
@ -19,7 +19,7 @@
|
||||
from dotenv import load_dotenv
|
||||
|
||||
from camel.models import ModelFactory
|
||||
from camel.toolkits import WebToolkit, SearchToolkit, FileWriteToolkit
|
||||
from camel.toolkits import BrowserToolkit, SearchToolkit, FileWriteToolkit
|
||||
from camel.types import ModelPlatformType, ModelType
|
||||
|
||||
from utils import OwlRolePlaying, run_society
|
||||
@ -62,7 +62,7 @@ def construct_society(question: str) -> OwlRolePlaying:
|
||||
)
|
||||
|
||||
tools_list = [
|
||||
*WebToolkit(
|
||||
*BrowserToolkit(
|
||||
headless=False,
|
||||
web_agent_model=web_model,
|
||||
planning_agent_model=planning_model,
|
||||
|
||||
@ -24,7 +24,7 @@ from camel.toolkits import (
|
||||
ImageAnalysisToolkit,
|
||||
SearchToolkit,
|
||||
VideoAnalysisToolkit,
|
||||
WebToolkit,
|
||||
BrowserToolkit,
|
||||
FileWriteToolkit,
|
||||
)
|
||||
from camel.types import ModelPlatformType, ModelType
|
||||
@ -90,7 +90,7 @@ def construct_society(question: str) -> OwlRolePlaying:
|
||||
|
||||
# Configure toolkits
|
||||
tools = [
|
||||
*WebToolkit(
|
||||
*BrowserToolkit(
|
||||
headless=False, # Set to True for headless mode (e.g., on remote servers)
|
||||
web_agent_model=models["web"],
|
||||
planning_agent_model=models["planning"],
|
||||
|
||||
@ -16,7 +16,7 @@ import os
|
||||
from camel.models import ModelFactory
|
||||
from camel.toolkits import (
|
||||
SearchToolkit,
|
||||
WebToolkit,
|
||||
BrowserToolkit,
|
||||
FileWriteToolkit,
|
||||
TerminalToolkit
|
||||
)
|
||||
@ -67,7 +67,7 @@ def construct_society(question: str) -> OwlRolePlaying:
|
||||
|
||||
# Configure toolkits
|
||||
tools = [
|
||||
*WebToolkit(
|
||||
*BrowserToolkit(
|
||||
headless=False, # Set to True for headless mode (e.g., on remote servers)
|
||||
web_agent_model=models["web"],
|
||||
planning_agent_model=models["planning"],
|
||||
|
||||
@ -16,7 +16,7 @@ from dotenv import load_dotenv
|
||||
from camel.models import ModelFactory
|
||||
from camel.toolkits import (
|
||||
SearchToolkit,
|
||||
WebToolkit,
|
||||
BrowserToolkit,
|
||||
FileWriteToolkit,
|
||||
TerminalToolkit
|
||||
)
|
||||
@ -68,7 +68,7 @@ def construct_society(question: str) -> OwlRolePlaying:
|
||||
|
||||
# Configure toolkits
|
||||
tools = [
|
||||
*WebToolkit(
|
||||
*BrowserToolkit(
|
||||
headless=False, # Set to True for headless mode (e.g., on remote servers)
|
||||
web_agent_model=models["web"],
|
||||
planning_agent_model=models["planning"],
|
||||
|
||||
@ -144,12 +144,11 @@ class DocumentProcessingToolkit(BaseToolkit):
|
||||
return True, extracted_text
|
||||
try:
|
||||
result = asyncio.run(self._extract_content_with_chunkr(document_path))
|
||||
raise ValueError("Chunkr is not available.")
|
||||
return True, result
|
||||
|
||||
except Exception as e:
|
||||
logger.warning(
|
||||
f"Error occurred while using chunkr to process document: {e}"
|
||||
f"Error occurred while using Chunkr to process document: {e}"
|
||||
)
|
||||
if document_path.endswith(".pdf"):
|
||||
# try using pypdf to extract text from pdf
|
||||
@ -226,7 +225,7 @@ class DocumentProcessingToolkit(BaseToolkit):
|
||||
|
||||
if result.status == "Failed":
|
||||
logger.error(
|
||||
f"Error while processing document {document_path}: {result.message}"
|
||||
f"Error while processing document {document_path}: {result.message} using Chunkr."
|
||||
)
|
||||
return f"Error while processing document: {result.message}"
|
||||
|
||||
|
||||
@ -191,15 +191,10 @@ class GAIABenchmark(BaseBenchmark):
|
||||
except Exception as e:
|
||||
logger.warning(e)
|
||||
# raise FileNotFoundError(f"{self.save_to} does not exist.")
|
||||
|
||||
datas = [data for data in datas if not self._check_task_completed(data["task_id"])]
|
||||
logger.info(f"Number of tasks to be processed: {len(datas)}")
|
||||
# Process tasks
|
||||
for task in tqdm(datas, desc="Running"):
|
||||
if self._check_task_completed(task["task_id"]):
|
||||
logger.info(
|
||||
f"The following task is already completed:\n task id: {task['task_id']}, question: {task['Question']}"
|
||||
)
|
||||
continue
|
||||
|
||||
if_prepared_task, info = self._prepare_task(task)
|
||||
if not if_prepared_task:
|
||||
_result_info = {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user