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
c6ba67a7
Unverified
Commit
c6ba67a7
authored
May 18, 2023
by
killpanda
Committed by
GitHub
May 18, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add a config to disable provider config validation (#85)
parent
ac2a1bc9
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
0 deletions
+6
-0
config.py
api/config.py
+4
-0
provider_service.py
api/services/provider_service.py
+2
-0
No files found.
api/config.py
View file @
c6ba67a7
...
...
@@ -46,6 +46,7 @@ DEFAULTS = {
'CELERY_BACKEND'
:
'database'
,
'PDF_PREVIEW'
:
'True'
,
'LOG_LEVEL'
:
'INFO'
,
'DISABLE_PROVIDER_CONFIG_VALIDATION'
:
'False'
,
}
...
...
@@ -176,6 +177,9 @@ class Config:
# hosted provider credentials
self
.
OPENAI_API_KEY
=
get_env
(
'OPENAI_API_KEY'
)
# By default it is False
# You could disable it for compatibility with certain OpenAPI providers
self
.
DISABLE_PROVIDER_CONFIG_VALIDATION
=
get_bool_env
(
'DISABLE_PROVIDER_CONFIG_VALIDATION'
)
class
CloudEditionConfig
(
Config
):
...
...
api/services/provider_service.py
View file @
c6ba67a7
...
...
@@ -62,6 +62,8 @@ class ProviderService:
@
staticmethod
def
validate_provider_configs
(
tenant
,
provider_name
:
ProviderName
,
configs
:
Union
[
dict
|
str
]):
if
current_app
.
config
[
'DISABLE_PROVIDER_CONFIG_VALIDATION'
]:
return
llm_provider_service
=
LLMProviderService
(
tenant
.
id
,
provider_name
.
value
)
return
llm_provider_service
.
config_validate
(
configs
)
...
...
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