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
6a2eb5f4
Unverified
Commit
6a2eb5f4
authored
Jan 04, 2024
by
takatost
Committed by
GitHub
Jan 04, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: customize model schema fetch failed raise error (#1900)
parent
0c5892bc
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
6 deletions
+13
-6
provider_configuration.py
api/core/entities/provider_configuration.py
+13
-6
No files found.
api/core/entities/provider_configuration.py
View file @
6a2eb5f4
import
datetime
import
json
import
logging
import
time
from
json
import
JSONDecodeError
from
typing
import
Optional
,
List
,
Dict
,
Tuple
,
Iterator
...
...
@@ -18,6 +19,8 @@ from core.model_runtime.utils import encoders
from
extensions.ext_database
import
db
from
models.provider
import
ProviderType
,
Provider
,
ProviderModel
,
TenantPreferredModelProvider
logger
=
logging
.
getLogger
(
__name__
)
class
ProviderConfiguration
(
BaseModel
):
"""
...
...
@@ -544,13 +547,17 @@ class ProviderConfiguration(BaseModel):
if
model_configuration
.
model_type
not
in
model_types
:
continue
custom_model_schema
=
(
provider_instance
.
get_model_instance
(
model_configuration
.
model_type
)
.
get_customizable_model_schema_from_credentials
(
model_configuration
.
model
,
model_configuration
.
credentials
try
:
custom_model_schema
=
(
provider_instance
.
get_model_instance
(
model_configuration
.
model_type
)
.
get_customizable_model_schema_from_credentials
(
model_configuration
.
model
,
model_configuration
.
credentials
)
)
)
except
Exception
as
ex
:
logger
.
warning
(
f
'get custom model schema failed, {ex}'
)
continue
if
not
custom_model_schema
:
continue
...
...
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