fix(tools): revert CustomTool __init__ to upstream, remove redundant schema parsing

The _parse_openapi_schema() method already handles string-to-dict conversion internally, so the duplicate json.loads in __init__ was unnecessary.
This commit is contained in:
miao
2026-04-09 19:33:27 +08:00
parent 55b2e05ba8
commit b875626f18

View File

@@ -31,14 +31,7 @@ class CustomTool(BaseTool):
self.base_url = config.get("base_url", "")
self.timeout = config.get("timeout", 30)
# 解析 schema
schema = self.schema_content
if isinstance(schema, str):
try:
schema = json.loads(schema)
self.schema_content = schema
except json.JSONDecodeError:
schema = {}
# 解析schema
self._parsed_operations = self._parse_openapi_schema()
@property