From c2f0e547ee2db3332fdb4408ef8f2c179243735d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E6=A3=92=E6=A3=92?= Date: Mon, 11 Dec 2023 16:03:22 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=E5=B1=9E=E6=80=A7=E6=B3=A8=E9=87=8A?= =?UTF-8?q?=EF=BC=8C=E4=BB=A5=E5=8F=8A=E5=85=A5=E5=8F=82=E7=9A=84=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E7=B1=BB=E5=9E=8B=E5=AE=9A=E4=B9=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- metagpt/actions/make_tools.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/metagpt/actions/make_tools.py b/metagpt/actions/make_tools.py index 9ab7fd922..f7e385138 100644 --- a/metagpt/actions/make_tools.py +++ b/metagpt/actions/make_tools.py @@ -4,6 +4,7 @@ import re from tenacity import retry, stop_after_attempt, wait_fixed +from metagpt.llm import LLM from metagpt.logs import logger from metagpt.schema import Message from metagpt.actions.write_analysis_code import WriteCodeByGenerate @@ -17,10 +18,10 @@ class MakeTools(WriteCodeByGenerate): 4. Write example code by using old varibales in old code, and make sure it could be execute in the user's machine.** """ - def __init__(self, name: str = '', context=None, llm=None, workspace: str = None): + def __init__(self, name: str = '', context: list[Message] = None, llm: LLM = None, workspace: str = None): super().__init__(name, context, llm) self.workspace = workspace or "." - self.file_suffix = '.py' + self.file_suffix: str = '.py' def parse_function_name(self, function_code: str) -> str: # 定义正则表达式模式