diff --git a/owl/run_terminal.py b/owl/run_terminal.py index a8acb19..94a0b26 100644 --- a/owl/run_terminal.py +++ b/owl/run_terminal.py @@ -12,7 +12,7 @@ # limitations under the License. # ========= Copyright 2023-2024 @ CAMEL-AI.org. All Rights Reserved. ========= from dotenv import load_dotenv - +import os from camel.models import ModelFactory from camel.toolkits import ( SearchToolkit, @@ -27,7 +27,8 @@ from utils import OwlRolePlaying, run_society load_dotenv() set_log_level(level="DEBUG") - +# Get current script directory +base_dir = os.path.dirname(os.path.abspath(__file__)) def construct_society(question: str) -> OwlRolePlaying: r"""Construct a society of agents based on the given question. @@ -102,7 +103,10 @@ def construct_society(question: str) -> OwlRolePlaying: def main(): r"""Main function to run the OWL system with an example question.""" # Example research question - question = "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 locally, and execute the Python file with the local terminal to display the graph for me." + 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.""" # Construct and run the society society = construct_society(question) diff --git a/owl/run_terminal_zh.py b/owl/run_terminal_zh.py index 2e218cb..507c514 100644 --- a/owl/run_terminal_zh.py +++ b/owl/run_terminal_zh.py @@ -27,7 +27,9 @@ from utils import OwlRolePlaying, run_society load_dotenv() set_log_level(level="DEBUG") - +import os +# Get current script directory +base_dir = os.path.dirname(os.path.abspath(__file__)) def construct_society(question: str) -> OwlRolePlaying: r"""Construct a society of agents based on the given question. @@ -102,8 +104,11 @@ def construct_society(question: str) -> OwlRolePlaying: def main(): r"""Main function to run the OWL system with an example question.""" # Example research question - question = "打开谷歌搜索,总结一下camel-ai的camel框架的github star、fork数目等,并把数字用plot包写成python文件保存到本地,用本地终端执行python文件显示图出来给我" - + question = f"""打开百度搜索,总结一下camel-ai的camel框架的github star、fork数目等,并把数字用plot包写成python文件保存到"+{os.path.join +(base_dir, 'final_output')}+",用本地终端执行python文件显示图出来给我""" +# question=f"""Create 'app.log' in the logs directory at '{os.path.join +# (base_dir, 'logs')}' with content: 'INFO: Application started successfully at +# 2024-03-10'""" # Construct and run the society society = construct_society(question) answer, chat_history, token_count = run_society(society)