Update app.py
Browse files
app.py
CHANGED
|
@@ -65,7 +65,9 @@ def verificar_api_gemini(api_key):
|
|
| 65 |
# Función general para verificar una lista de API keys
|
| 66 |
def verificar_apis(api_keys_text, api_type):
|
| 67 |
api_keys = api_keys_text.strip().split("\n")
|
| 68 |
-
|
|
|
|
|
|
|
| 69 |
for api_key in api_keys:
|
| 70 |
api_key = api_key.strip()
|
| 71 |
if not api_key:
|
|
@@ -78,8 +80,16 @@ def verificar_apis(api_keys_text, api_type):
|
|
| 78 |
resultado = verificar_api_gemini(api_key)
|
| 79 |
else:
|
| 80 |
resultado = "⛔ Tipo de API no soportada."
|
| 81 |
-
|
| 82 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 83 |
|
| 84 |
# Interfaz de Gradio
|
| 85 |
iface = gr.Interface(
|
|
|
|
| 65 |
# Función general para verificar una lista de API keys
|
| 66 |
def verificar_apis(api_keys_text, api_type):
|
| 67 |
api_keys = api_keys_text.strip().split("\n")
|
| 68 |
+
apis_correctas = []
|
| 69 |
+
apis_con_error = []
|
| 70 |
+
|
| 71 |
for api_key in api_keys:
|
| 72 |
api_key = api_key.strip()
|
| 73 |
if not api_key:
|
|
|
|
| 80 |
resultado = verificar_api_gemini(api_key)
|
| 81 |
else:
|
| 82 |
resultado = "⛔ Tipo de API no soportada."
|
| 83 |
+
|
| 84 |
+
# Clasificar el resultado en APIs correctas o con error
|
| 85 |
+
if "✅" in resultado:
|
| 86 |
+
apis_correctas.append(f"API Key: {api_key} -> {resultado}")
|
| 87 |
+
else:
|
| 88 |
+
apis_con_error.append(f"API Key: {api_key} -> {resultado}")
|
| 89 |
+
|
| 90 |
+
# Formatear el resultado final con las secciones separadas
|
| 91 |
+
resultado_final = "APIs correctas:\n" + "\n".join(apis_correctas) + "\n\nAPIs con error:\n" + "\n".join(apis_con_error)
|
| 92 |
+
return resultado_final
|
| 93 |
|
| 94 |
# Interfaz de Gradio
|
| 95 |
iface = gr.Interface(
|