SperanzaMax commited on
Commit
11fbbba
·
verified ·
1 Parent(s): e788e5f

Upload folder using huggingface_hub

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -130,12 +130,13 @@ async def get_history():
130
  conn = sqlite3.connect(DB_PATH)
131
  conn.row_factory = sqlite3.Row
132
  cursor = conn.cursor()
 
133
  cursor.execute("SELECT timestamp, qualia, frustracion, confianza, fatiga FROM snapshots ORDER BY id DESC LIMIT 40")
134
  rows = cursor.fetchall()
135
  conn.close()
136
  return [dict(r) for r in rows][::-1]
137
- except:
138
- return []
139
 
140
  @app.post("/v1/chat/completions")
141
  async def chat_proxy(request: Request):
 
130
  conn = sqlite3.connect(DB_PATH)
131
  conn.row_factory = sqlite3.Row
132
  cursor = conn.cursor()
133
+ # Seleccionamos las columnas de la tabla 'snapshots' tal cual están en MemoriaConsolidada
134
  cursor.execute("SELECT timestamp, qualia, frustracion, confianza, fatiga FROM snapshots ORDER BY id DESC LIMIT 40")
135
  rows = cursor.fetchall()
136
  conn.close()
137
  return [dict(r) for r in rows][::-1]
138
+ except Exception as e:
139
+ return {"error": str(e), "msg": "Error leyendo historial de snapshots"}
140
 
141
  @app.post("/v1/chat/completions")
142
  async def chat_proxy(request: Request):