mirror of
https://git.mirrors.martin98.com/https://github.com/langgenius/dify.git
synced 2025-08-12 05:48:58 +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
|
||||
if custom_provider_record:
|
||||
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:
|
||||
provider_credentials = {}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user