Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -35,16 +35,16 @@ Este análisis es una herramienta informativa de IA y **NO es un diagnóstico m
|
|
| 35 |
|
| 36 |
# --- CONFIGURACIÓN DE LA NUEVA API (google-genai) ---
|
| 37 |
try:
|
| 38 |
-
if '
|
| 39 |
-
|
| 40 |
else:
|
| 41 |
-
|
| 42 |
-
if not
|
| 43 |
-
st.error("No se encontró la
|
| 44 |
st.stop()
|
| 45 |
|
| 46 |
# NUEVA FORMA DE INICIAR EL CLIENTE
|
| 47 |
-
client = genai.Client(api_key=
|
| 48 |
|
| 49 |
except Exception as e:
|
| 50 |
st.error(f"❌ Error al configurar Gemini API: {e}")
|
|
|
|
| 35 |
|
| 36 |
# --- CONFIGURACIÓN DE LA NUEVA API (google-genai) ---
|
| 37 |
try:
|
| 38 |
+
if 'APIkeydetective' in st.secrets:
|
| 39 |
+
APIkeydetective = st.secrets['APIkeydetective']
|
| 40 |
else:
|
| 41 |
+
APIkeydetective = os.getenv("APIkeydetective")
|
| 42 |
+
if not APIkeydetective:
|
| 43 |
+
st.error("No se encontró la APIkeydetective.")
|
| 44 |
st.stop()
|
| 45 |
|
| 46 |
# NUEVA FORMA DE INICIAR EL CLIENTE
|
| 47 |
+
client = genai.Client(api_key=APIkeydetective)
|
| 48 |
|
| 49 |
except Exception as e:
|
| 50 |
st.error(f"❌ Error al configurar Gemini API: {e}")
|