update camel version, add together ai example

This commit is contained in:
Wendong
2025-04-11 10:16:47 +08:00
parent eb17ed3865
commit 7181dd25cc
11 changed files with 357 additions and 2688 deletions

View File

@@ -83,22 +83,6 @@ Our vision is to revolutionize how AI agents collaborate to solve real-world tas
# 🔥 News
<div align="center" style="background-color: #fffacd; padding: 15px; border-radius: 10px; border: 2px solid #ffd700; margin: 20px 0;">
<h3 style="color: #d81b60; margin: 0; font-size: 1.3em;">
🌟🌟🌟 <b>COMMUNITY CALL FOR USE CASES!</b> 🌟🌟🌟
</h3>
<p style="font-size: 1.1em; margin: 10px 0;">
We're inviting the community to contribute innovative use cases for OWL! <br>
The <b>top ten submissions</b> will receive special community gifts and recognition.
</p>
<p>
<a href="https://github.com/camel-ai/owl/tree/main/community_usecase/COMMUNITY_CALL_FOR_USE_CASES.md" style="background-color: #d81b60; color: white; padding: 8px 15px; text-decoration: none; border-radius: 5px; font-weight: bold;">Learn More & Submit</a>
</p>
<p style="margin: 5px 0;">
Submission deadline: <b>March 31, 2025</b>
</p>
</div>
<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;">
🧩 <b>NEW: COMMUNITY AGENT CHALLENGES!</b> 🧩

View File

@@ -81,22 +81,6 @@
# 🔥 ニュース
<div align="center" style="background-color: #fffacd; padding: 15px; border-radius: 10px; border: 2px solid #ffd700; margin: 20px 0;">
<h3 style="color: #d81b60; margin: 0; font-size: 1.3em;">
🌟🌟🌟 <b>コミュニティ用ケースの募集!</b> 🌟🌟🌟
</h3>
<p style="font-size: 1.1em; margin: 10px 0;">
コミュニティにOWLの革新的なユースケースを提供してもらうための招待です <br>
<b>トップ10の提出物</b>には特別なコミュニティギフトと認識が与えられます。
</p>
<p>
<a href="https://github.com/camel-ai/owl/tree/main/community_usecase/COMMUNITY_CALL_FOR_USE_CASES.md" style="background-color: #d81b60; color: white; padding: 8px 15px; text-decoration: none; border-radius: 5px; font-weight: bold;">詳細と提出</a>
</p>
<p style="margin: 5px 0;">
提出期限:<b>2025年3月31日</b>
</p>
</div>
<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;">
🧩 <b>新機能:コミュニティエージェントチャレンジ!</b> 🧩

View File

@@ -83,22 +83,6 @@
# 🔥 新闻
<div align="center" style="background-color: #fffacd; padding: 15px; border-radius: 10px; border: 2px solid #ffd700; margin: 20px 0;">
<h3 style="color: #d81b60; margin: 0; font-size: 1.3em;">
🌟🌟🌟 <b>OWL社区用例征集令</b> 🌟🌟🌟
</h3>
<p style="font-size: 1.1em; margin: 10px 0;">
我们请社区成员贡献创新的OWL用例<br>
<b>前十名提交</b>将获得特别社区礼物和认可。
</p>
<p>
<a href="https://github.com/camel-ai/owl/tree/main/community_usecase/COMMUNITY_CALL_FOR_USE_CASES.md" style="background-color: #d81b60; color: white; padding: 8px 15px; text-decoration: none; border-radius: 5px; font-weight: bold;">了解更多并提交</a>
</p>
<p style="margin: 5px 0;">
提交截止日期:<b>2025年3月31日</b>
</p>
</div>
<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;">
🧩 <b>新增:社区智能体挑战!</b> 🧩

138
examples/run_together_ai.py Normal file
View File

@@ -0,0 +1,138 @@
# ========= Copyright 2023-2024 @ CAMEL-AI.org. All Rights Reserved. =========
# 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. =========
import sys
import pathlib
from dotenv import load_dotenv
from camel.models import ModelFactory
from camel.toolkits import (
AudioAnalysisToolkit,
CodeExecutionToolkit,
ExcelToolkit,
ImageAnalysisToolkit,
SearchToolkit,
VideoAnalysisToolkit,
BrowserToolkit,
FileWriteToolkit,
)
from camel.types import ModelPlatformType, ModelType
from camel.logger import set_log_level
from camel.societies import RolePlaying
from owl.utils import run_society, DocumentProcessingToolkit
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:
r"""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.TOGETHER,
model_type=ModelType.TOGETHER_LLAMA_4_MAVERICK,
model_config_dict={"temperature": 0},
),
"assistant": ModelFactory.create(
model_platform=ModelPlatformType.TOGETHER,
model_type=ModelType.TOGETHER_LLAMA_4_MAVERICK,
model_config_dict={"temperature": 0},
),
"browsing": ModelFactory.create(
model_platform=ModelPlatformType.TOGETHER,
model_type=ModelType.TOGETHER_LLAMA_4_MAVERICK,
model_config_dict={"temperature": 0},
),
"planning": ModelFactory.create(
model_platform=ModelPlatformType.TOGETHER,
model_type=ModelType.TOGETHER_LLAMA_4_MAVERICK,
model_config_dict={"temperature": 0},
),
"image": ModelFactory.create(
model_platform=ModelPlatformType.TOGETHER,
model_type=ModelType.TOGETHER_LLAMA_4_MAVERICK,
model_config_dict={"temperature": 0},
),
"document": ModelFactory.create(
model_platform=ModelPlatformType.TOGETHER,
model_type=ModelType.TOGETHER_LLAMA_4_MAVERICK,
model_config_dict={"temperature": 0},
),
}
# Configure toolkits
tools = [
*BrowserToolkit(
headless=False, # Set to True for headless mode (e.g., on remote servers)
web_agent_model=models["browsing"],
planning_agent_model=models["planning"],
).get_tools(),
*CodeExecutionToolkit(sandbox="subprocess", verbose=True).get_tools(),
*ImageAnalysisToolkit(model=models["image"]).get_tools(),
*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,
)
return society
def main():
r"""Main function to run the OWL system with an example question."""
# Default research question
default_task = "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."
# Override default task if command line argument is provided
task = sys.argv[1] if len(sys.argv) > 1 else default_task
# Construct and run the society
society = construct_society(task)
answer, chat_history, token_count = run_society(society)
# Output the result
print(f"\033[94mAnswer: {answer}\033[0m")
if __name__ == "__main__":
main()

BIN
owl/assets/owl-favicon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

View File

@@ -254,6 +254,7 @@ MODULE_DESCRIPTIONS = {
"run_azure_openai": "Using azure openai model to process tasks",
"run_groq": "Using groq model to process tasks",
"run_ppio": "Using ppio model to process tasks",
"run_together_ai": "Using together ai model to process tasks",
}
@@ -1142,7 +1143,7 @@ def create_ui():
with gr.Tabs(): # Set conversation record as the default selected tab
with gr.TabItem("Conversation Record"):
# Add conversation record display area
with gr.Box():
with gr.Group():
log_display2 = gr.Markdown(
value="No conversation records yet.",
elem_classes="log-display",
@@ -1158,7 +1159,7 @@ def create_ui():
)
with gr.TabItem("Environment Variable Management", id="env-settings"):
with gr.Box(elem_classes="env-manager-container"):
with gr.Group(elem_classes="env-manager-container"):
gr.Markdown("""
## Environment Variable Management
@@ -1169,7 +1170,7 @@ def create_ui():
with gr.Row():
# Left column: Environment variable management controls
with gr.Column(scale=3):
with gr.Box(elem_classes="env-controls"):
with gr.Group(elem_classes="env-controls"):
# Environment variable table - set to interactive for direct editing
gr.Markdown("""
<div style="background-color: #e7f3fe; border-left: 6px solid #2196F3; padding: 10px; margin: 15px 0; border-radius: 4px;">
@@ -1299,7 +1300,7 @@ def main():
app = create_ui()
app.queue()
app.launch(share=False, favicon_path="../assets/owl-favicon.ico")
app.launch(share=False, favicon_path=os.path.join(os.path.dirname(__file__), "assets", "owl-favicon.ico"))
except Exception as e:
logging.error(f"Error occurred while starting the application: {str(e)}")
print(f"Error occurred while starting the application: {str(e)}")

View File

@@ -252,6 +252,7 @@ MODULE_DESCRIPTIONS = {
"run_qwen_zh": "qwenモデルを使用して中国語タスクを処理します",
"run_azure_openai": "Azure OpenAIモデルを使用してタスクを処理します",
"run_groq": "groqモデルを使用してタスクを処理します",
"run_together_ai": "together aiモデルを使用してタスクを処理します"
}
@@ -1138,7 +1139,7 @@ def create_ui():
with gr.Tabs(): # Set conversation record as the default selected tab
with gr.TabItem("会話記録"):
# Add conversation record display area
with gr.Box():
with gr.Group():
log_display2 = gr.Markdown(
value="まだ会話記録はありません。",
elem_classes="log-display",
@@ -1154,7 +1155,7 @@ def create_ui():
)
with gr.TabItem("環境変数管理", id="env-settings"):
with gr.Box(elem_classes="env-manager-container"):
with gr.Group(elem_classes="env-manager-container"):
gr.Markdown("""
## 環境変数管理
@@ -1165,7 +1166,7 @@ def create_ui():
with gr.Row():
# Left column: Environment variable management controls
with gr.Column(scale=3):
with gr.Box(elem_classes="env-controls"):
with gr.Group(elem_classes="env-controls"):
# Environment variable table - set to interactive for direct editing
gr.Markdown("""
<div style="background-color: #e7f3fe; border-left: 6px solid #2196F3; padding: 10px; margin: 15px 0; border-radius: 4px;">
@@ -1295,7 +1296,7 @@ def main():
app = create_ui()
app.queue()
app.launch(share=False, favicon_path="../assets/owl-favicon.ico")
app.launch(share=False, favicon_path=os.path.join(os.path.dirname(__file__), "assets", "owl-favicon.ico"))
except Exception as e:
logging.error(f"アプリケーションの起動中にエラーが発生しました: {str(e)}")
print(f"アプリケーションの起動中にエラーが発生しました: {str(e)}")

View File

@@ -245,7 +245,7 @@ MODULE_DESCRIPTIONS = {
"run": "默认模式使用OpenAI模型的默认的智能体协作模式适合大多数任务。",
"run_mini": "使用使用OpenAI模型最小化配置处理任务",
"run_gemini": "使用 Gemini模型处理任务",
"run_deepseek_zh": "使用deepseek模型处理中文任务",
"run_deepseek_zh": "使用eepseek模型处理中文任务",
"run_openai_compatible_model": "使用openai兼容模型处理任务",
"run_ollama": "使用本地ollama模型处理任务",
"run_qwen_mini_zh": "使用qwen模型最小化配置处理任务",
@@ -253,6 +253,7 @@ MODULE_DESCRIPTIONS = {
"run_azure_openai": "使用azure openai模型处理任务",
"run_groq": "使用groq模型处理任务",
"run_ppio": "使用ppio模型处理任务",
"run_together_ai": "使用together ai模型处理任务",
}
@@ -1117,7 +1118,7 @@ def create_ui():
with gr.Tabs(): # 设置对话记录为默认选中的标签页
with gr.TabItem("对话记录"):
# 添加对话记录显示区域
with gr.Box():
with gr.Group():
log_display2 = gr.Markdown(
value="暂无对话记录。",
elem_classes="log-display",
@@ -1131,7 +1132,7 @@ def create_ui():
clear_logs_button2 = gr.Button("清空记录", variant="secondary")
with gr.TabItem("环境变量管理", id="env-settings"):
with gr.Box(elem_classes="env-manager-container"):
with gr.Group(elem_classes="env-manager-container"):
gr.Markdown("""
## 环境变量管理
@@ -1142,7 +1143,7 @@ def create_ui():
with gr.Row():
# 左侧列:环境变量管理控件
with gr.Column(scale=3):
with gr.Box(elem_classes="env-controls"):
with gr.Group(elem_classes="env-controls"):
# 环境变量表格 - 设置为可交互以直接编辑
gr.Markdown("""
<div style="background-color: #e7f3fe; border-left: 6px solid #2196F3; padding: 10px; margin: 15px 0; border-radius: 4px;">

View File

@@ -21,7 +21,7 @@ keywords = [
"learning-systems"
]
dependencies = [
"camel-ai[all]==0.2.37",
"camel-ai[owl]==0.2.44",
"chunkr-ai>=0.0.41",
"docx2markdown>=0.1.1",
"gradio>=3.50.2",

View File

@@ -1,4 +1,6 @@
camel-ai[all]==0.2.37
camel-ai[owl]==0.2.44
chunkr-ai>=0.0.41
docx2markdown>=0.1.1
gradio>=3.50.2
mcp-simple-arxiv==0.2.2
mcp-server-fetch==2025.1.17

2826
uv.lock generated

File diff suppressed because it is too large Load Diff