Skip to content

armgit / dify

Public Imported from GitHub
0

Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.

fix: missing description (#2643)

Yeuolyb07084711c3f
diff --git a/api/core/tools/utils/parser.py b/api/core/tools/utils/parser.py
index 889316c2352..de4ecc87081 100644
--- a/api/core/tools/utils/parser.py
+++ b/api/core/tools/utils/parser.py
@@ -146,7 +146,8 @@ class ApiBasedToolSchemaParser:
bundles.append(ApiBasedToolBundle(
server_url=server_url + interface['path'],
method=interface['method'],
- summary=interface['operation']['summary'] if 'summary' in interface['operation'] else None,
+ summary=interface['operation']['description'] if 'description' in interface['operation'] else
+ interface['operation']['summary'] if 'summary' in interface['operation'] else None,
operation_id=interface['operation']['operationId'],
parameters=parameters,
author='',
@@ -249,12 +250,10 @@ class ApiBasedToolSchemaParser:
if 'operationId' not in operation:
raise ToolApiSchemaError(f'No operationId found in operation {method} {path}.')
- if 'summary' not in operation or len(operation['summary']) == 0:
- warning['missing_summary'] = f'No summary found in operation {method} {path}.'
+ if ('summary' not in operation or len(operation['summary']) == 0) and \
+ ('description' not in operation or len(operation['description']) == 0):
+ warning['missing_summary'] = f'No summary or description found in operation {method} {path}.'
- if 'description' not in operation or len(operation['description']) == 0:
- warning['missing_description'] = f'No description found in operation {method} {path}.'
-
openapi['paths'][path][method] = {
'operationId': operation['operationId'],
'summary': operation.get('summary', ''),