mirror of
https://github.com/FoundationAgents/MetaGPT.git
synced 2026-05-01 03:46:23 +02:00
add unit tests for tool registry
This commit is contained in:
parent
c8da839afe
commit
638dda31cf
2 changed files with 103 additions and 1 deletions
|
|
@ -50,7 +50,8 @@ class ToolRegistry:
|
|||
return
|
||||
|
||||
with open(schema_path, "r", encoding="utf-8") as f:
|
||||
schema = yaml.safe_load(f)[tool_name]
|
||||
schema_dict = yaml.safe_load(f)
|
||||
schema = schema_dict.get(tool_name) or dict(schema_dict.values())
|
||||
schema["tool_path"] = tool_path # corresponding code file path of the tool
|
||||
try:
|
||||
ToolSchema(**schema) # validation
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue