From c32dcca293e2431cecd147e670951a8bb2a8c13d Mon Sep 17 00:00:00 2001 From: yzlin Date: Thu, 18 Jan 2024 21:17:34 +0800 Subject: [PATCH] fix schema reading bug --- metagpt/tools/tool_registry.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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