mirror of
https://git.mirrors.martin98.com/https://github.com/langgenius/dify.git
synced 2025-08-12 18:59:07 +08:00
fix: openai origin credential not start with { (#1874)
This commit is contained in:
parent
b43f1441a9
commit
ae975b10e9
@ -446,7 +446,14 @@ class ProviderManager:
|
|||||||
custom_provider_configuration = None
|
custom_provider_configuration = None
|
||||||
if custom_provider_record:
|
if custom_provider_record:
|
||||||
try:
|
try:
|
||||||
provider_credentials = json.loads(custom_provider_record.encrypted_config)
|
# fix origin data
|
||||||
|
if (custom_provider_record.encrypted_config
|
||||||
|
and not custom_provider_record.encrypted_config.startswith("{")):
|
||||||
|
provider_credentials = {
|
||||||
|
"openai_api_key": custom_provider_record.encrypted_config
|
||||||
|
}
|
||||||
|
else:
|
||||||
|
provider_credentials = json.loads(custom_provider_record.encrypted_config)
|
||||||
except JSONDecodeError:
|
except JSONDecodeError:
|
||||||
provider_credentials = {}
|
provider_credentials = {}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user