mirror of
https://github.com/FoundationAgents/MetaGPT.git
synced 2026-04-27 17:56:23 +02:00
update globals with function tools.
This commit is contained in:
parent
6895e74d3e
commit
52b8ba84d3
1 changed files with 2 additions and 0 deletions
|
|
@ -29,6 +29,8 @@ def extract_function_signatures(file_path):
|
|||
# 导入函数
|
||||
module_name = Path(file_path).parts[-1][:-len(Path(file_path).suffix)]
|
||||
module = importlib.import_module(f"metagpt.tools.functions.libs.udf.{module_name}")
|
||||
# 将函数导入到当前命名空间
|
||||
globals().update({function_name: getattr(module, function_name)})
|
||||
# 获取函数注释和函数路径
|
||||
function_schema = {'udf_name': function_signature,
|
||||
'udf_path': f'from metagpt.tools.functions.libs.udf.{module_name} import {function_name}',
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue