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
b4225bed
Unverified
Commit
b4225bed
authored
Jan 04, 2024
by
takatost
Committed by
GitHub
Jan 04, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: app create raise error when no available model providers (#1921)
parent
a82b4d31
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
10 deletions
+7
-10
app.py
api/controllers/console/app/app.py
+2
-8
provider_manager.py
api/core/provider_manager.py
+5
-2
No files found.
api/controllers/console/app/app.py
View file @
b4225bed
...
...
@@ -141,15 +141,9 @@ class AppListApi(Resource):
model_type
=
ModelType
.
LLM
)
except
ProviderTokenNotInitError
:
raise
ProviderNotInitializeError
(
f
"No Default System Reasoning Model available. Please configure "
f
"in the Settings -> Model Provider."
)
model_instance
=
None
if
not
model_instance
:
raise
ProviderNotInitializeError
(
f
"No Default System Reasoning Model available. Please configure "
f
"in the Settings -> Model Provider."
)
else
:
if
model_instance
:
model_dict
=
app_model_config
.
model_dict
model_dict
[
'provider'
]
=
model_instance
.
provider
model_dict
[
'name'
]
=
model_instance
.
model
...
...
api/core/provider_manager.py
View file @
b4225bed
...
...
@@ -401,10 +401,13 @@ class ProviderManager:
Provider
.
tenant_id
==
tenant_id
,
Provider
.
provider_name
==
provider_name
,
Provider
.
provider_type
==
ProviderType
.
SYSTEM
.
value
,
Provider
.
quota_type
==
ProviderQuotaType
.
TRIAL
.
value
,
Provider
.
is_valid
==
True
Provider
.
quota_type
==
ProviderQuotaType
.
TRIAL
.
value
)
.
first
()
if
provider_record
and
not
provider_record
.
is_valid
:
provider_record
.
is_valid
=
True
db
.
session
.
commit
()
provider_name_to_provider_records_dict
[
provider_name
]
.
append
(
provider_record
)
return
provider_name_to_provider_records_dict
...
...
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