From b875626f18cf0a1482ae23d2d7d8847080f681c1 Mon Sep 17 00:00:00 2001 From: miao <1468212639@qq.com> Date: Thu, 9 Apr 2026 19:33:27 +0800 Subject: [PATCH] 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. --- api/app/core/tools/custom/base.py | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/api/app/core/tools/custom/base.py b/api/app/core/tools/custom/base.py index f6e191ed..c03fe206 100644 --- a/api/app/core/tools/custom/base.py +++ b/api/app/core/tools/custom/base.py @@ -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