GoergeMarckus commited on
Commit
d048bd5
·
verified ·
1 Parent(s): 8e86a91

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -10
app.py CHANGED
@@ -39,24 +39,22 @@ st.markdown(
39
  )
40
 
41
  # =========================
42
- # CONFIGURACIÓN GEMINI (API v1)
43
  # =========================
44
 
45
  genai.configure(api_key=st.secrets["GEMINI_API_KEY"])
46
 
47
  INSTRUCCION_SISTEMA = """
48
- Eres AIDEN, una inteligencia artificial latina cálida, humana y profesional.
49
- Siempre respondes en español latino neutro.
50
- Eres empático, claro, útil y directo.
51
  """
52
 
53
- # Este modelo existe en API v1
54
- MODELO = "gemini-1.5-flash"
55
 
56
- modelo = genai.GenerativeModel(MODELO)
57
-
58
- def generar_respuesta(mensaje_usuario: str) -> str:
59
- prompt = f"{INSTRUCCION_SISTEMA}\n\nUsuario: {mensaje_usuario}\nAIDEN:"
60
  respuesta = modelo.generate_content(prompt)
61
  return respuesta.text
62
 
 
39
  )
40
 
41
  # =========================
42
+ # CONFIGURACIÓN DEL MODELO GEMINI
43
  # =========================
44
 
45
  genai.configure(api_key=st.secrets["GEMINI_API_KEY"])
46
 
47
  INSTRUCCION_SISTEMA = """
48
+ Eres AIDEN, una inteligencia artificial latina con voz cálida, humana y profesional.
49
+ Siempre responde en español latino neutro.
50
+ Tus respuestas son claras, útiles, naturales y con empatía auténtica.
51
  """
52
 
53
+ # Cargar modelo (API nueva SIN "models/")
54
+ modelo = genai.GenerativeModel("gemini-1.5-flash")
55
 
56
+ def generar_respuesta(entrada_usuario):
57
+ prompt = f"{INSTRUCCION_SISTEMA}\nUsuario: {entrada_usuario}\nAIDEN:"
 
 
58
  respuesta = modelo.generate_content(prompt)
59
  return respuesta.text
60