mirror of
https://git.mirrors.martin98.com/https://github.com/langgenius/dify.git
synced 2025-08-12 17:39:06 +08:00
fix: missing description (#2643)
This commit is contained in:
parent
fa8ab2134f
commit
b07084711c
@ -146,7 +146,8 @@ class ApiBasedToolSchemaParser:
|
|||||||
bundles.append(ApiBasedToolBundle(
|
bundles.append(ApiBasedToolBundle(
|
||||||
server_url=server_url + interface['path'],
|
server_url=server_url + interface['path'],
|
||||||
method=interface['method'],
|
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'],
|
operation_id=interface['operation']['operationId'],
|
||||||
parameters=parameters,
|
parameters=parameters,
|
||||||
author='',
|
author='',
|
||||||
@ -249,11 +250,9 @@ class ApiBasedToolSchemaParser:
|
|||||||
if 'operationId' not in operation:
|
if 'operationId' not in operation:
|
||||||
raise ToolApiSchemaError(f'No operationId found in operation {method} {path}.')
|
raise ToolApiSchemaError(f'No operationId found in operation {method} {path}.')
|
||||||
|
|
||||||
if 'summary' not in operation or len(operation['summary']) == 0:
|
if ('summary' not in operation or len(operation['summary']) == 0) and \
|
||||||
warning['missing_summary'] = f'No summary found in operation {method} {path}.'
|
('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] = {
|
openapi['paths'][path][method] = {
|
||||||
'operationId': operation['operationId'],
|
'operationId': operation['operationId'],
|
||||||
|
Loading…
x
Reference in New Issue
Block a user