Skip to content

🌟 The Multi-Agent Framework: First AI Software Company, Towards Natural Language Programming

fix schema reading bug

yzlinc32dcca293e2
diff --git a/metagpt/tools/tool_registry.py b/metagpt/tools/tool_registry.py
index 0544d25ee..52ad25ce4 100644
--- a/metagpt/tools/tool_registry.py
+++ b/metagpt/tools/tool_registry.py
@@ -51,7 +51,7 @@ class ToolRegistry:
with open(schema_path, "r", encoding="utf-8") as f:
schema_dict = yaml.safe_load(f)
- schemas = schema_dict.get(tool_name) or dict(schema_dict.values())
+ schemas = schema_dict.get(tool_name) or list(schema_dict.values())[0]
schemas["tool_path"] = tool_path # corresponding code file path of the tool
try:
ToolSchema(**schemas) # validation