Merge pull request #106 from SuanmoSuanyangTechnology/feature/agent-tool_xjn
fix(custome tool)
This commit is contained in:
@@ -10,9 +10,6 @@ from app.core.logging_config import get_business_logger
|
|||||||
|
|
||||||
logger = get_business_logger()
|
logger = get_business_logger()
|
||||||
|
|
||||||
# 为了兼容性,创建别名
|
|
||||||
# SchemaParser = OpenAPISchemaParser = None
|
|
||||||
|
|
||||||
|
|
||||||
class OpenAPISchemaParser:
|
class OpenAPISchemaParser:
|
||||||
"""OpenAPI Schema解析器 - 解析OpenAPI 3.0规范"""
|
"""OpenAPI Schema解析器 - 解析OpenAPI 3.0规范"""
|
||||||
@@ -214,6 +211,8 @@ class OpenAPISchemaParser:
|
|||||||
if not isinstance(operation, dict):
|
if not isinstance(operation, dict):
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
summary = operation.get("summary", "")
|
||||||
|
|
||||||
# 生成操作ID
|
# 生成操作ID
|
||||||
operation_id = operation.get("operationId")
|
operation_id = operation.get("operationId")
|
||||||
if not operation_id:
|
if not operation_id:
|
||||||
@@ -223,7 +222,7 @@ class OpenAPISchemaParser:
|
|||||||
operations[operation_id] = {
|
operations[operation_id] = {
|
||||||
"method": method.upper(),
|
"method": method.upper(),
|
||||||
"path": path,
|
"path": path,
|
||||||
"summary": operation.get("summary", ""),
|
"summary": summary if summary else operation_id,
|
||||||
"description": operation.get("description", ""),
|
"description": operation.get("description", ""),
|
||||||
"parameters": self._extract_parameters(operation),
|
"parameters": self._extract_parameters(operation),
|
||||||
"request_body": self._extract_request_body(operation),
|
"request_body": self._extract_request_body(operation),
|
||||||
|
|||||||
Reference in New Issue
Block a user