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:
@@ -31,14 +31,7 @@ class CustomTool(BaseTool):
|
|||||||
self.base_url = config.get("base_url", "")
|
self.base_url = config.get("base_url", "")
|
||||||
self.timeout = config.get("timeout", 30)
|
self.timeout = config.get("timeout", 30)
|
||||||
|
|
||||||
# 解析 schema
|
# 解析schema
|
||||||
schema = self.schema_content
|
|
||||||
if isinstance(schema, str):
|
|
||||||
try:
|
|
||||||
schema = json.loads(schema)
|
|
||||||
self.schema_content = schema
|
|
||||||
except json.JSONDecodeError:
|
|
||||||
schema = {}
|
|
||||||
self._parsed_operations = self._parse_openapi_schema()
|
self._parsed_operations = self._parse_openapi_schema()
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
|||||||
Reference in New Issue
Block a user