Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
dify
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ai-tech
dify
Commits
b0708471
Unverified
Commit
b0708471
authored
Mar 01, 2024
by
Yeuoly
Committed by
GitHub
Mar 01, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: missing description (#2643)
parent
fa8ab213
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
6 deletions
+5
-6
parser.py
api/core/tools/utils/parser.py
+5
-6
No files found.
api/core/tools/utils/parser.py
View file @
b0708471
...
@@ -146,7 +146,8 @@ class ApiBasedToolSchemaParser:
...
@@ -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:
...
@@ -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'
],
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment