mirror of
https://github.com/FoundationAgents/MetaGPT.git
synced 2026-05-15 11:02:36 +02:00
support load tools from file or file list
This commit is contained in:
parent
a93173df65
commit
263595b980
1 changed files with 7 additions and 1 deletions
|
|
@ -118,7 +118,13 @@ class WriteCodeWithTools(BaseWriteAnalysisCode):
|
|||
schema_module = schema_module or 'udf'
|
||||
self.available_tools.update({schema_module: schema_path})
|
||||
else:
|
||||
yml_files = schema_path.glob("*.yml")
|
||||
if isinstance(schema_path, list):
|
||||
yml_files = schema_path
|
||||
elif isinstance(schema_path, Path) and schema_path.is_file():
|
||||
yml_files = [schema_path]
|
||||
else:
|
||||
yml_files = schema_path.glob("*.yml")
|
||||
|
||||
for yml_file in yml_files:
|
||||
module = yml_file.stem
|
||||
with open(yml_file, "r", encoding="utf-8") as f:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue