cxeep commited on
Commit
429f146
·
verified ·
1 Parent(s): 2d1366e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -21,7 +21,7 @@ def check_key_gemini_availability(key, ai_model):
21
  # Second, attempt to generate content to further validate the key
22
  ai_model_ = ai_model.strip() or "gemini-1.5-flash"
23
  if ai_model_ not in result['models']:
24
- return False, f"Specified model is not in available 'models'."
25
  url_generateContent = f"https://generativelanguage.googleapis.com/v1beta/models/{ai_model_}:generateContent?key={key}"
26
  # headers = {'Content-Type': 'application/json'}
27
  data = {"contents": [{"parts": [{"text": "Say \"this is a test\""}]}]}
 
21
  # Second, attempt to generate content to further validate the key
22
  ai_model_ = ai_model.strip() or "gemini-1.5-flash"
23
  if ai_model_ not in result['models']:
24
+ return False, f"Specified model {ai_model_} is not in available 'models'."
25
  url_generateContent = f"https://generativelanguage.googleapis.com/v1beta/models/{ai_model_}:generateContent?key={key}"
26
  # headers = {'Content-Type': 'application/json'}
27
  data = {"contents": [{"parts": [{"text": "Say \"this is a test\""}]}]}