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
9b15ddc3
Unverified
Commit
9b15ddc3
authored
Jan 31, 2024
by
Yeuoly
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: typo
parent
2f9cb8c4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
8 deletions
+8
-8
model_tool_provider.py
api/core/tools/provider/model_tool_provider.py
+8
-8
No files found.
api/core/tools/provider/model_tool_provider.py
View file @
9b15ddc3
...
...
@@ -4,7 +4,7 @@ from os import path
from
yaml
import
load
,
FullLoader
from
core.tools.entities.tool_entities
import
ToolProviderType
,
\
ToolParamter
,
ToolProviderCredentials
,
ToolDescription
,
ToolProviderIdentity
ToolParam
e
ter
,
ToolProviderCredentials
,
ToolDescription
,
ToolProviderIdentity
from
core.tools.provider.tool_provider
import
ToolProviderController
from
core.tools.errors
import
ToolNotFoundError
from
core.tools.tool.model_tool
import
ModelTool
...
...
@@ -16,7 +16,7 @@ from core.entities.model_entities import ModelStatus
from
core.provider_manager
import
ProviderManager
,
ProviderConfiguration
,
ProviderModelBundle
from
core.model_manager
import
ModelInstance
class
ModelToolProviderCon
if
guration
(
BaseModel
):
class
ModelToolProviderCon
fi
guration
(
BaseModel
):
"""
the configuration of the model tool provider
"""
...
...
@@ -31,9 +31,9 @@ class ModelToolProviderConifguration(BaseModel):
providers
:
List
[
Provider
]
=
None
_model_tool_provider_config
:
ModelToolProviderCon
if
guration
=
None
_model_tool_provider_config
:
ModelToolProviderCon
fi
guration
=
None
with
open
(
path
.
join
(
path
.
dirname
(
__file__
),
'_model_providers.yaml'
),
'r'
)
as
f
:
_model_tool_provider_config
=
ModelToolProviderCon
if
guration
(
**
load
(
f
,
Loader
=
FullLoader
))
_model_tool_provider_config
=
ModelToolProviderCon
fi
guration
(
**
load
(
f
,
Loader
=
FullLoader
))
class
ModelToolProviderController
(
ToolProviderController
):
configuration
:
ProviderConfiguration
=
None
...
...
@@ -151,12 +151,12 @@ class ModelToolProviderController(ToolProviderController):
label
=
I18nObject
(
zh_Hans
=
model
.
label
.
zh_Hans
,
en_US
=
model
.
label
.
en_US
),
),
parameters
=
[
ToolParamter
(
ToolParam
e
ter
(
name
=
'image_id'
,
label
=
I18nObject
(
zh_Hans
=
'图片ID'
,
en_US
=
'Image ID'
),
human_description
=
I18nObject
(
zh_Hans
=
'图片ID'
,
en_US
=
'Image ID'
),
type
=
ToolParamter
.
ToolParameterType
.
STRING
,
form
=
ToolParamter
.
ToolParameterForm
.
LLM
,
type
=
ToolParam
e
ter
.
ToolParameterType
.
STRING
,
form
=
ToolParam
e
ter
.
ToolParameterForm
.
LLM
,
required
=
True
,
default
=
Tool
.
VARIABLE_KEY
.
IMAGE
.
value
)
...
...
@@ -206,7 +206,7 @@ class ModelToolProviderController(ToolProviderController):
raise
ValueError
(
f
'tool {tool_name} not found'
)
def
get_parameters
(
self
,
tool_name
:
str
)
->
List
[
ToolParamter
]:
def
get_parameters
(
self
,
tool_name
:
str
)
->
List
[
ToolParam
e
ter
]:
"""
returns the parameters of the tool
...
...
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