From d9c814420b5e31430e7143d4b430404c4ce8f63c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E6=A3=92=E6=A3=92?= Date: Tue, 19 Dec 2023 11:21:51 +0800 Subject: [PATCH] fix: no args error. --- metagpt/tools/functions/libs/udf/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/metagpt/tools/functions/libs/udf/__init__.py b/metagpt/tools/functions/libs/udf/__init__.py index 8c74bbbe3..5596cd37a 100644 --- a/metagpt/tools/functions/libs/udf/__init__.py +++ b/metagpt/tools/functions/libs/udf/__init__.py @@ -77,7 +77,7 @@ def docstring_to_yaml(docstring: str, return_vars: List[str] = None): err_msg = f"No Args found in docstring as following, Please make sure it is google style\ : \n\n{'-'*60}\n{docstring}\n{'-'*60}\n\n." logger.error(err_msg) - raise ValueError(err_msg) + params = (('', '', ''),) # 匹配Returns部分 returns_match = re.search(r'Returns:\s*(.*?)(?:Raises:|$)', docstring, re.DOTALL) returns = returns_match.group(1).strip() if returns_match else ""