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
48bacd01
Unverified
Commit
48bacd01
authored
Feb 20, 2024
by
Yeuoly
Committed by
GitHub
Feb 20, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: incorrect tool name (#2489)
parent
297d0f1f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
1 deletion
+6
-1
parser.py
api/core/tools/utils/parser.py
+6
-1
No files found.
api/core/tools/utils/parser.py
View file @
48bacd01
...
...
@@ -115,7 +115,12 @@ class ApiBasedToolSchemaParser:
# check if there is a operation id, use $path_$method as operation id if not
if
'operationId'
not
in
interface
[
'operation'
]:
interface
[
'operation'
][
'operationId'
]
=
f
'{interface["path"]}_{interface["method"]}'
# remove special characters like / to ensure the operation id is valid ^[a-zA-Z0-9_-]{1,64}$
path
=
interface
[
'path'
]
if
interface
[
'path'
]
.
startswith
(
'/'
):
path
=
interface
[
'path'
][
1
:]
path
=
path
.
replace
(
'/'
,
'_'
)
interface
[
'operation'
][
'operationId'
]
=
f
'{path}_{interface["method"]}'
bundles
.
append
(
ApiBasedToolBundle
(
server_url
=
server_url
+
interface
[
'path'
],
...
...
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