mirror of
https://github.com/camel-ai/owl.git
synced 2026-03-22 05:57:17 +08:00
pre-commit fix
This commit is contained in:
@@ -25,7 +25,7 @@ import signal
|
||||
import dotenv
|
||||
|
||||
# 设置日志队列
|
||||
log_queue = queue.Queue()
|
||||
log_queue: queue.Queue[str] = queue.Queue()
|
||||
|
||||
# 当前运行的进程
|
||||
current_process = None
|
||||
|
||||
@@ -12,11 +12,12 @@
|
||||
# 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 (
|
||||
AudioAnalysisToolkit,
|
||||
CodeExecutionToolkit,
|
||||
FileWriteToolkit,
|
||||
FileWriteToolkit,
|
||||
ExcelToolkit,
|
||||
ImageAnalysisToolkit,
|
||||
SearchToolkit,
|
||||
@@ -86,7 +87,7 @@ def construct_society(question: str) -> OwlRolePlaying:
|
||||
|
||||
# Initialize the FileWriteToolkit with the output directory
|
||||
file_toolkit = FileWriteToolkit(output_dir=output_dir)
|
||||
|
||||
|
||||
# Configure toolkits
|
||||
tools = [
|
||||
*file_toolkit.get_tools(),
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
|
||||
from dotenv import load_dotenv
|
||||
|
||||
|
||||
import os
|
||||
from camel.models import ModelFactory
|
||||
from camel.toolkits import (
|
||||
CodeExecutionToolkit,
|
||||
@@ -94,7 +94,7 @@ def construct_society(question: str) -> OwlRolePlaying:
|
||||
|
||||
# Initialize the FileWriteToolkit with the output directory
|
||||
file_toolkit = FileWriteToolkit(output_dir=output_dir)
|
||||
|
||||
|
||||
# Configure toolkits
|
||||
tools = [
|
||||
*file_toolkit.get_tools(),
|
||||
|
||||
@@ -12,13 +12,9 @@
|
||||
# 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,
|
||||
WebToolkit,
|
||||
FileWriteToolkit
|
||||
)
|
||||
from camel.toolkits import SearchToolkit, WebToolkit, FileWriteToolkit
|
||||
from camel.types import ModelPlatformType, ModelType
|
||||
from camel.logger import set_log_level
|
||||
|
||||
@@ -68,7 +64,7 @@ def construct_society(question: str) -> OwlRolePlaying:
|
||||
|
||||
# Initialize the FileWriteToolkit with the output directory
|
||||
file_toolkit = FileWriteToolkit(output_dir=output_dir)
|
||||
|
||||
|
||||
# Configure toolkits
|
||||
tools = [
|
||||
*file_toolkit.get_tools(),
|
||||
|
||||
@@ -17,7 +17,7 @@ from dotenv import load_dotenv
|
||||
from camel.models import ModelFactory
|
||||
from camel.toolkits import (
|
||||
CodeExecutionToolkit,
|
||||
FileWriteToolkit,
|
||||
FileWriteToolkit,
|
||||
ExcelToolkit,
|
||||
ImageAnalysisToolkit,
|
||||
SearchToolkit,
|
||||
@@ -89,7 +89,7 @@ def construct_society(question: str) -> OwlRolePlaying:
|
||||
|
||||
# Initialize the FileWriteToolkit with the output directory
|
||||
file_toolkit = FileWriteToolkit(output_dir=output_dir)
|
||||
|
||||
|
||||
# Configure toolkits
|
||||
tools = [
|
||||
*file_toolkit.get_tools(),
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
# 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
|
||||
|
||||
import os
|
||||
from camel.models import ModelFactory
|
||||
from camel.toolkits import WebToolkit, SearchToolkit, FileWriteToolkit
|
||||
from camel.types import ModelPlatformType, ModelType
|
||||
@@ -66,9 +66,9 @@ def construct_society(question: str) -> OwlRolePlaying:
|
||||
|
||||
# Initialize the FileWriteToolkit with the output directory
|
||||
file_toolkit = FileWriteToolkit(output_dir=output_dir)
|
||||
|
||||
|
||||
# Configure toolkits
|
||||
tools = [
|
||||
tools_list = [
|
||||
*file_toolkit.get_tools(),
|
||||
*WebToolkit(
|
||||
headless=False,
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
|
||||
from dotenv import load_dotenv
|
||||
from camel.models import ModelFactory
|
||||
import os
|
||||
from camel.toolkits import (
|
||||
CodeExecutionToolkit,
|
||||
ExcelToolkit,
|
||||
@@ -93,7 +94,7 @@ def construct_society(question: str) -> OwlRolePlaying:
|
||||
|
||||
# Initialize the FileWriteToolkit with the output directory
|
||||
file_toolkit = FileWriteToolkit(output_dir=output_dir)
|
||||
|
||||
|
||||
# Configure toolkits
|
||||
tools = [
|
||||
*file_toolkit.get_tools(),
|
||||
|
||||
@@ -87,7 +87,7 @@ def construct_society(question: str) -> OwlRolePlaying:
|
||||
|
||||
# Initialize the FileWriteToolkit with the output directory
|
||||
file_toolkit = FileWriteToolkit(output_dir=output_dir)
|
||||
|
||||
|
||||
# Configure toolkits
|
||||
tools = [
|
||||
*file_toolkit.get_tools(),
|
||||
@@ -132,7 +132,7 @@ def construct_society(question: str) -> OwlRolePlaying:
|
||||
def main():
|
||||
r"""Main function to run the OWL system with an example question."""
|
||||
# Example research question
|
||||
question ="""请使用文件写入工具生成一个Python脚本,创建一个简单的Flask网络服务器,并将其保存到file_write_outputs目录中的flask_server.py文件。脚本应该包含基本的路由和启动服务器的代码。"""
|
||||
question = """请使用文件写入工具生成一个Python脚本,创建一个简单的Flask网络服务器,并将其保存到file_write_outputs目录中的flask_server.py文件。脚本应该包含基本的路由和启动服务器的代码。"""
|
||||
# Construct and run the society
|
||||
society = construct_society(question)
|
||||
answer, chat_history, token_count = run_society(society)
|
||||
@@ -140,5 +140,6 @@ def main():
|
||||
# Output the result
|
||||
print(f"\033[94mAnswer: {answer}\033[0m")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
|
||||
Reference in New Issue
Block a user