mirror of
https://github.com/FoundationAgents/MetaGPT.git
synced 2026-06-02 14:45:17 +02:00
Merge branch 'feature-tool' into 'mgx_ops'
rm tool schema storage See merge request pub/MetaGPT!278
This commit is contained in:
commit
5f86247c0d
1 changed files with 0 additions and 4 deletions
|
|
@ -12,7 +12,6 @@ import os
|
|||
from collections import defaultdict
|
||||
from pathlib import Path
|
||||
|
||||
import yaml
|
||||
from pydantic import BaseModel
|
||||
|
||||
from metagpt.const import TOOL_SCHEMA_PATH
|
||||
|
|
@ -117,11 +116,8 @@ def register_tool(tags: list[str] = None, schema_path: str = "", **kwargs):
|
|||
|
||||
|
||||
def make_schema(tool_source_object, include, path):
|
||||
os.makedirs(os.path.dirname(path), exist_ok=True) # Create the necessary directories
|
||||
try:
|
||||
schema = convert_code_to_tool_schema(tool_source_object, include=include)
|
||||
with open(path, "w", encoding="utf-8") as f:
|
||||
yaml.dump(schema, f, sort_keys=False)
|
||||
except Exception as e:
|
||||
schema = {}
|
||||
logger.error(f"Fail to make schema: {e}")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue