Benedict King commited on
Commit
a3a84d2
·
1 Parent(s): 00ec216

fix: create ThreadSafeCircularList with correct api list

Browse files
Files changed (1) hide show
  1. utils.py +6 -1
utils.py CHANGED
@@ -70,7 +70,12 @@ def update_config(config_data):
70
  if provider.get('cf_account_id'):
71
  provider['base_url'] = 'https://api.cloudflare.com/'
72
 
73
- provider_api_circular_list[provider['provider']] = ThreadSafeCircularList([provider.get('api', None)])
 
 
 
 
 
74
 
75
  if not provider.get("model"):
76
  provider["model"] = update_initial_model(provider['base_url'], provider['api'])
 
70
  if provider.get('cf_account_id'):
71
  provider['base_url'] = 'https://api.cloudflare.com/'
72
 
73
+ provider_api = provider.get('api', None)
74
+ if provider_api:
75
+ if isinstance(provider_api, str):
76
+ provider_api_circular_list[provider['provider']] = ThreadSafeCircularList([provider_api])
77
+ if isinstance(provider_api, list):
78
+ provider_api_circular_list[provider['provider']] = ThreadSafeCircularList(provider_api)
79
 
80
  if not provider.get("model"):
81
  provider["model"] = update_initial_model(provider['base_url'], provider['api'])