mirror of
http://112.124.100.131/huang.ze/ebiz-dify-ai.git
synced 2025-12-12 12:26:54 +08:00
fix: openai origin credential not start with { (#1874)
This commit is contained in:
@@ -446,6 +446,13 @@ class ProviderManager:
|
||||
custom_provider_configuration = None
|
||||
if custom_provider_record:
|
||||
try:
|
||||
# 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 = {}
|
||||
|
||||
Reference in New Issue
Block a user