diff --git a/README.md b/README.md index 687f03f..13640ab 100644 --- a/README.md +++ b/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(), ] diff --git a/README_zh.md b/README_zh.md index ac40fed..b7fd579 100644 --- a/README_zh.md +++ b/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(), ] diff --git a/owl/run.py b/owl/run.py index 823dc08..2d562ea 100644 --- a/owl/run.py +++ b/owl/run.py @@ -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"], diff --git a/owl/run_gaia_roleplaying.py b/owl/run_gaia_roleplaying.py index d375c4c..ff4b90b 100644 --- a/owl/run_gaia_roleplaying.py +++ b/owl/run_gaia_roleplaying.py @@ -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"], diff --git a/owl/run_mini.py b/owl/run_mini.py index 82fa2b7..a20849e 100644 --- a/owl/run_mini.py +++ b/owl/run_mini.py @@ -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"], diff --git a/owl/run_ollama.py b/owl/run_ollama.py index 5f45090..55f1b8a 100644 --- a/owl/run_ollama.py +++ b/owl/run_ollama.py @@ -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"], diff --git a/owl/run_openai_compatiable_model.py b/owl/run_openai_compatiable_model.py index fa8a08e..fd271ce 100644 --- a/owl/run_openai_compatiable_model.py +++ b/owl/run_openai_compatiable_model.py @@ -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"], diff --git a/owl/run_qwen_mini_zh.py b/owl/run_qwen_mini_zh.py index d48298a..d602315 100644 --- a/owl/run_qwen_mini_zh.py +++ b/owl/run_qwen_mini_zh.py @@ -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, diff --git a/owl/run_qwen_zh.py b/owl/run_qwen_zh.py index fb3106f..dceb851 100644 --- a/owl/run_qwen_zh.py +++ b/owl/run_qwen_zh.py @@ -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"], diff --git a/owl/run_terminal.py b/owl/run_terminal.py index 94a0b26..3741a7e 100644 --- a/owl/run_terminal.py +++ b/owl/run_terminal.py @@ -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"], diff --git a/owl/run_terminal_zh.py b/owl/run_terminal_zh.py index 48fc1ed..2582c24 100644 --- a/owl/run_terminal_zh.py +++ b/owl/run_terminal_zh.py @@ -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"], diff --git a/owl/utils/document_toolkit.py b/owl/utils/document_toolkit.py index 192d1f1..5d81ce4 100644 --- a/owl/utils/document_toolkit.py +++ b/owl/utils/document_toolkit.py @@ -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}" diff --git a/owl/utils/gaia.py b/owl/utils/gaia.py index 07f1827..a133a26 100644 --- a/owl/utils/gaia.py +++ b/owl/utils/gaia.py @@ -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 = {