Update app.py
Browse files
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\""}]}]}
|