diff --git a/metagpt/tools/tool_convert.py b/metagpt/tools/tool_convert.py index c2ea33085..fdb69bfb3 100644 --- a/metagpt/tools/tool_convert.py +++ b/metagpt/tools/tool_convert.py @@ -44,7 +44,7 @@ def docstring_to_schema(docstring: str): # variable_pattern = re.compile(r"(\w+)\s*\((.*?)\):\s*(.*)") variable_pattern = re.compile( r"(\w+)\s*\((.*?)\):\s*(.*?)(?=\n\s*\w+\s*\(|\Z)", re.DOTALL - ) # (?=\n\w+\s*\(|\Z) isb to assert that what follows is either the start of the next parameter (indicated by a newline, some word characters, and an opening parenthesis) or the end of the string (\Z). + ) # (?=\n\w+\s*\(|\Z) is to assert that what follows is either the start of the next parameter (indicated by a newline, some word characters, and an opening parenthesis) or the end of the string (\Z). params = variable_pattern.findall(_args) parameter_schema = {"properties": {}, "required": []} diff --git a/metagpt/tools/tool_registry.py b/metagpt/tools/tool_registry.py index c064a19de..d16defa0a 100644 --- a/metagpt/tools/tool_registry.py +++ b/metagpt/tools/tool_registry.py @@ -137,8 +137,7 @@ def make_schema(tool_source_object, include, path): logger.info(f"schema made at {path}") except Exception as e: schema = {} - logger.error("Fail to make schema") - print(e) + logger.error(f"Fail to make schema: {e}") return schema