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
53cd1257
Unverified
Commit
53cd1257
authored
Mar 11, 2024
by
Yeuoly
Committed by
GitHub
Mar 11, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: deep copy of model-tool label (#2775)
parent
3c91f9b5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
8 deletions
+15
-8
model_tool_provider.py
api/core/tools/provider/model_tool_provider.py
+15
-8
No files found.
api/core/tools/provider/model_tool_provider.py
View file @
53cd1257
from
copy
import
deepcopy
from
typing
import
Any
from
core.entities.model_entities
import
ModelStatus
...
...
@@ -59,10 +60,16 @@ class ModelToolProviderController(ToolProviderController):
# override the configuration
if
model_tool_configuration
.
label
:
if
model_tool_configuration
.
label
.
en_US
:
configuration
.
provider
.
label
.
en_US
=
model_tool_configuration
.
label
.
en_US
if
model_tool_configuration
.
label
.
zh_Hans
:
configuration
.
provider
.
label
.
zh_Hans
=
model_tool_configuration
.
label
.
zh_Hans
label
=
deepcopy
(
model_tool_configuration
.
label
)
if
label
.
en_US
:
label
.
en_US
=
model_tool_configuration
.
label
.
en_US
if
label
.
zh_Hans
:
label
.
zh_Hans
=
model_tool_configuration
.
label
.
zh_Hans
else
:
label
=
I18nObject
(
en_US
=
configuration
.
provider
.
label
.
en_US
,
zh_Hans
=
configuration
.
provider
.
label
.
zh_Hans
)
return
ModelToolProviderController
(
is_active
=
is_active
,
...
...
@@ -70,12 +77,12 @@ class ModelToolProviderController(ToolProviderController):
author
=
'Dify'
,
name
=
configuration
.
provider
.
provider
,
description
=
I18nObject
(
zh_Hans
=
f
'{
configuration.provider.
label.zh_Hans} 模型能力提供商'
,
en_US
=
f
'{
configuration.provider.
label.en_US} model capability provider'
zh_Hans
=
f
'{label.zh_Hans} 模型能力提供商'
,
en_US
=
f
'{label.en_US} model capability provider'
),
label
=
I18nObject
(
zh_Hans
=
configuration
.
provider
.
label
.
zh_Hans
,
en_US
=
configuration
.
provider
.
label
.
en_US
zh_Hans
=
label
.
zh_Hans
,
en_US
=
label
.
en_US
),
icon
=
configuration
.
provider
.
icon_small
.
en_US
,
),
...
...
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