mirror of
https://github.com/FoundationAgents/MetaGPT.git
synced 2026-06-05 14:55:18 +02:00
fix: path in function_signatures.
This commit is contained in:
parent
db96644a08
commit
10d488c49a
1 changed files with 3 additions and 3 deletions
|
|
@ -22,11 +22,11 @@ def extract_function_signatures(file_path):
|
|||
# 获取函数签名
|
||||
function_signature = f"{function_name}({', '.join(args)})"
|
||||
# 导入函数
|
||||
module = Path(file_path).parts[-1][:-len(Path(file_path).suffix)]
|
||||
module = importlib.import_module(f"metagpt.tools.functions.libs.udf.{module}")
|
||||
module_name = Path(file_path).parts[-1][:-len(Path(file_path).suffix)]
|
||||
module = importlib.import_module(f"metagpt.tools.functions.libs.udf.{module_name}")
|
||||
# 获取函数注释和函数路径
|
||||
function_schema = {'name': function_signature, 'doc': inspect.getdoc(getattr(module, function_name)),
|
||||
'path': f'from metagpt.tools.functions.libs.udf.{module} import function_name'}
|
||||
'path': f'from metagpt.tools.functions.libs.udf.{module_name} import {function_name}'}
|
||||
function_signatures.append(function_schema)
|
||||
|
||||
return function_signatures
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue