Skip to content
Binary file added OWL之Excel文件处理.mp4
Binary file not shown.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,8 @@ https://github.com/user-attachments/assets/2a2a825d-39ea-45c5-9ba1-f9d58efbc372

https://private-user-images.githubusercontent.com/55657767/420212194-e813fc05-136a-485f-8df3-f10d9b4e63ec.mp4

https://github.com/camel-ai/owl/blob/43984bfc968d62e7174b0c1e6283fefe08c44b45/OWL之Excel文件处理.mp4
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rename the file with english


# ✨️ Core Features

- **Online Search**: Support for multiple search engines (including Wikipedia, Google, DuckDuckGo, Baidu, Bocha, etc.) for real-time information retrieval and knowledge acquisition.
Expand Down
4 changes: 3 additions & 1 deletion README_zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,8 @@ https://private-user-images.githubusercontent.com/55657767/420211368-f29f477d-7e

https://private-user-images.githubusercontent.com/55657767/420212194-e813fc05-136a-485f-8df3-f10d9b4e63ec.mp4

https://github.com/camel-ai/owl/blob/43984bfc968d62e7174b0c1e6283fefe08c44b45/OWL之Excel文件处理.mp4
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rename the file with english


# ✨️ 核心功能

- **在线搜索**:支持多种搜索引擎(包括维基百科、Google、DuckDuckGo、百度、博查等),实现实时信息检索与知识获取
Expand Down Expand Up @@ -327,7 +329,7 @@ npx -y @wonderwhy-er/desktop-commander setup --force-file-protocol
# 🚀 快速开始

## 基本用法

运行以下示例:

```bash
Expand Down
9 changes: 7 additions & 2 deletions examples/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

from owl.utils import run_society, DocumentProcessingToolkit

import pathlib
import pathlib, sys

base_dir = pathlib.Path(__file__).parent.parent
env_path = base_dir / "owl" / ".env"
Expand Down Expand Up @@ -131,7 +131,12 @@ def construct_society(question: str) -> RolePlaying:
def main():
r"""Main function to run the OWL system with an example question."""
# Example research question
question = "Navigate to Amazon.com and identify one product that is attractive to coders. Please provide me with the product name and price. No need to verify your answer."
if len(sys.argv) > 1:
question = str(sys.argv[1])

else:
# Example research question
question = "Navigate to Amazon.com and identify one product that is attractive to coders. Please provide me with the product name and price. No need to verify your answer."

# Construct and run the society
society = construct_society(question)
Expand Down
159 changes: 159 additions & 0 deletions examples/run_SiliconFlow.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,159 @@
# ========= Copyright 2023-2024 @ CAMEL-AI.org. All Rights Reserved. =========
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

file name should in lowercase.

# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ========= Copyright 2023-2024 @ CAMEL-AI.org. All Rights Reserved. =========

# To run this file, you need to configure the Qwen API key
# You can obtain your API key from Bailian platform: bailian.console.aliyun.com
# Set it as QWEN_API_KEY="your-api-key" in your .env file or add it to your environment variables

from dotenv import load_dotenv
from camel.models import ModelFactory
from camel.configs import SiliconFlowConfig
from camel.toolkits import (
CodeExecutionToolkit,
ExcelToolkit,
ImageAnalysisToolkit,
SearchToolkit,
VideoAnalysisToolkit,
BrowserToolkit,
FileWriteToolkit,
)
from camel.types import ModelPlatformType, ModelType
from camel.societies import RolePlaying

from owl.utils import run_society, DocumentProcessingToolkit

from camel.logger import set_log_level


import pathlib, sys

base_dir = pathlib.Path(__file__).parent.parent
env_path = base_dir / "owl" / ".env"
load_dotenv(dotenv_path=str(env_path))

set_log_level(level="DEBUG")


def construct_society(question: str) -> RolePlaying:
"""
Construct a society of agents based on the given question.

Args:
question (str): The task or question to be addressed by the society.

Returns:
RolePlaying: A configured society of agents ready to address the question.
"""

# Create models for different components
models = {
"user": ModelFactory.create(
model_platform=ModelPlatformType.SILICONFLOW,
model_type="Qwen/QwQ-32B",
model_config_dict=SiliconFlowConfig(temperature=0.2).as_dict(),
),
"assistant": ModelFactory.create(
model_platform=ModelPlatformType.SILICONFLOW,
model_type="Qwen/QwQ-32B",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for the assistant it's better not using qwq since it's reasoning model, may not suitable for our case, same for the user agent, some other models have great tool calling capability would be suggested

model_config_dict=SiliconFlowConfig(temperature=0.2).as_dict(),
),
"web": ModelFactory.create(
model_platform=ModelPlatformType.SILICONFLOW,
model_type="Qwen/Qwen2-VL-72B-Instruct",
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how about Qwen2.5-VL-72-Instruct, the price is the same.

model_config_dict=SiliconFlowConfig(temperature=0.2).as_dict(),
),
"planning": ModelFactory.create(
model_platform=ModelPlatformType.SILICONFLOW,
model_type="Qwen/QwQ-32B",
model_config_dict=SiliconFlowConfig(temperature=0.2).as_dict(),
),
"video": ModelFactory.create(
model_platform=ModelPlatformType.SILICONFLOW,
model_type="Qwen/Qwen2-VL-72B-Instruct",
model_config_dict=SiliconFlowConfig(temperature=0.2).as_dict(),
),
"image": ModelFactory.create(
model_platform=ModelPlatformType.SILICONFLOW,
model_type="Qwen/Qwen2-VL-72B-Instruct",
model_config_dict=SiliconFlowConfig(temperature=0.2).as_dict(),
),
"document": ModelFactory.create(
model_platform=ModelPlatformType.SILICONFLOW,
model_type="Qwen/Qwen2-VL-72B-Instruct",
model_config_dict=SiliconFlowConfig(temperature=0.2).as_dict(),
),
}

# Configure toolkits
tools = [
*BrowserToolkit(
headless=False, # Set to True for headless mode (e.g., on remote servers)
web_agent_model=models["web"],
planning_agent_model=models["planning"],
output_language="Chinese",
).get_tools(),
*VideoAnalysisToolkit(model=models["video"]).get_tools(),
*CodeExecutionToolkit(sandbox="subprocess", verbose=True).get_tools(),
*ImageAnalysisToolkit(model=models["image"]).get_tools(),
SearchToolkit().search_duckduckgo,
SearchToolkit().search_google, # Comment this out if you don't have google search
SearchToolkit().search_wiki,
SearchToolkit().search_baidu,
*ExcelToolkit().get_tools(),
*DocumentProcessingToolkit(model=models["document"]).get_tools(),
*FileWriteToolkit(output_dir="./").get_tools(),
]

# Configure agent roles and parameters
user_agent_kwargs = {"model": models["user"]}
assistant_agent_kwargs = {"model": models["assistant"], "tools": tools}

# Configure task parameters
task_kwargs = {
"task_prompt": question,
"with_task_specify": False,
}

# Create and return the society
society = RolePlaying(
**task_kwargs,
user_role_name="user",
user_agent_kwargs=user_agent_kwargs,
assistant_role_name="assistant",
assistant_agent_kwargs=assistant_agent_kwargs,
output_language="Chinese",
)

return society


def main():
r"""Main function to run the OWL system with an example question."""
# Example research question
if len(sys.argv) > 1:
question = str(sys.argv[1])

else:
question = "浏览百度告诉我未来一周北京天气!并帮我制定北京的旅游计划!"
# Construct and run the society
society = construct_society(question)
answer, chat_history, token_count = run_society(society)

# Output the result
print(f"\033[94mAnswer: {answer}\033[0m")



if __name__ == "__main__":
main()
9 changes: 7 additions & 2 deletions examples/run_azure_openai.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

from camel.logger import set_log_level

import pathlib
import pathlib, sys

base_dir = pathlib.Path(__file__).parent.parent
env_path = base_dir / "owl" / ".env"
Expand Down Expand Up @@ -104,7 +104,12 @@ def construct_society(question: str) -> OwlRolePlaying:
def main():
r"""Main function to run the OWL system with Azure OpenAI."""
# Example question
question = "Navigate to Amazon.com and identify one product that is attractive to coders. Please provide me with the product name and price. No need to verify your answer."
if len(sys.argv) > 1:
question = str(sys.argv[1])

else:
# Example research question
question = "Navigate to Amazon.com and identify one product that is attractive to coders. Please provide me with the product name and price. No need to verify your answer."

# Construct and run the society
society = construct_society(question)
Expand Down
9 changes: 7 additions & 2 deletions examples/run_deepseek_zh.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@

from owl.utils import run_society

import pathlib
import pathlib, sys

set_log_level(level="DEBUG")

Expand Down Expand Up @@ -102,7 +102,12 @@ def construct_society(question: str) -> RolePlaying:
def main():
r"""Main function to run the OWL system with an example question."""
# Example research question
question = "搜索OWL项目最近的新闻并生成一篇报告,最后保存到本地。"
if len(sys.argv) > 1:
question = str(sys.argv[1])

else:
# Example research question
question = "搜索OWL项目最近的新闻并生成一篇报告,最后保存到本地。"

# Construct and run the society
society = construct_society(question)
Expand Down
9 changes: 8 additions & 1 deletion examples/run_groq.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@

from owl.utils import OwlRolePlaying, run_society, DocumentProcessingToolkit

import sys

load_dotenv()

set_log_level(level="DEBUG")
Expand Down Expand Up @@ -141,7 +143,12 @@ def construct_society(question: str) -> OwlRolePlaying:
def main():
r"""Main function to run the OWL system with an example question."""
# Example research question
question = "Navigate to Amazon.com and identify one product that is attractive to coders. Please provide me with the product name and price. No need to verify your answer."
if len(sys.argv) > 1:
question = str(sys.argv[1])

else:
# Example research question
question = "Navigate to Amazon.com and identify one product that is attractive to coders. Please provide me with the product name and price. No need to verify your answer."

# Construct and run the society
# Note: This configuration uses GROQ_LLAMA_3_3_70B for tool-intensive roles (assistant, web, planning, video, image)
Expand Down
9 changes: 7 additions & 2 deletions examples/run_mini.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

from camel.societies import RolePlaying

import pathlib
import pathlib, sys

base_dir = pathlib.Path(__file__).parent.parent
env_path = base_dir / "owl" / ".env"
Expand Down Expand Up @@ -107,7 +107,12 @@ def construct_society(question: str) -> RolePlaying:
def main():
r"""Main function to run the OWL system with an example question."""
# Example research question
question = "Navigate to Amazon.com and identify one product that is attractive to coders. Please provide me with the product name and price. No need to verify your answer."
if len(sys.argv) > 1:
question = str(sys.argv[1])

else:
# Example research question
question = "Navigate to Amazon.com and identify one product that is attractive to coders. Please provide me with the product name and price. No need to verify your answer."

# Construct and run the society
society = construct_society(question)
Expand Down
9 changes: 7 additions & 2 deletions examples/run_ollama.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

from camel.logger import set_log_level

import pathlib
import pathlib, sys

base_dir = pathlib.Path(__file__).parent.parent
env_path = base_dir / "owl" / ".env"
Expand Down Expand Up @@ -125,7 +125,12 @@ def construct_society(question: str) -> RolePlaying:
def main():
r"""Main function to run the OWL system with an example question."""
# Example research question
question = "Navigate to Amazon.com and identify one product that is attractive to coders. Please provide me with the product name and price. No need to verify your answer."
if len(sys.argv) > 1:
question = str(sys.argv[1])

else:
# Example research question
question = "Navigate to Amazon.com and identify one product that is attractive to coders. Please provide me with the product name and price. No need to verify your answer."

# Construct and run the society
society = construct_society(question)
Expand Down
9 changes: 7 additions & 2 deletions examples/run_openai_compatiable_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
from camel.societies import RolePlaying
from camel.logger import set_log_level

import pathlib
import pathlib, sys

base_dir = pathlib.Path(__file__).parent.parent
env_path = base_dir / "owl" / ".env"
Expand Down Expand Up @@ -128,7 +128,12 @@ def construct_society(question: str) -> RolePlaying:
def main():
r"""Main function to run the OWL system with an example question."""
# Example research question
question = "Navigate to Amazon.com and identify one product that is attractive to coders. Please provide me with the product name and price. No need to verify your answer."
if len(sys.argv) > 1:
question = str(sys.argv[1])

else:
# Example research question
question = "Navigate to Amazon.com and identify one product that is attractive to coders. Please provide me with the product name and price. No need to verify your answer."

# Construct and run the society
society = construct_society(question)
Expand Down
9 changes: 7 additions & 2 deletions examples/run_qwen_zh.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
from camel.logger import set_log_level


import pathlib
import pathlib, sys

base_dir = pathlib.Path(__file__).parent.parent
env_path = base_dir / "owl" / ".env"
Expand Down Expand Up @@ -140,7 +140,12 @@ def construct_society(question: str) -> RolePlaying:
def main():
r"""Main function to run the OWL system with an example question."""
# Example research question
question = "浏览亚马逊并找出一款对程序员有吸引力的产品。请提供产品名称和价格"
if len(sys.argv) > 1:
question = str(sys.argv[1])

else:
# Example research question
question = "浏览亚马逊并找出一款对程序员有吸引力的产品。请提供产品名称和价格"

# Construct and run the society
society = construct_society(question)
Expand Down
9 changes: 7 additions & 2 deletions examples/run_terminal.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
from owl.utils import run_society
from camel.societies import RolePlaying

import pathlib
import pathlib, sys

base_dir = pathlib.Path(__file__).parent.parent
env_path = base_dir / "owl" / ".env"
Expand Down Expand Up @@ -108,7 +108,12 @@ def construct_society(question: str) -> RolePlaying:
def main():
r"""Main function to run the OWL system with an example question."""
# Example research question
question = f"""Open Google Search, summarize the number of GitHub stars, forks, etc., of the camel framework of camel-ai,
if len(sys.argv) > 1:
question = str(sys.argv[1])

else:
# Example research question
question = f"""Open Google Search, summarize the number of GitHub stars, forks, etc., of the camel framework of camel-ai,
and write the numbers into a Python file using the plot package,
save it to "+{os.path.join(base_dir, 'final_output')}+",
and execute the Python file with the local terminal to display the graph for me."""
Expand Down
Loading