Update app.py
Browse files
app.py
CHANGED
|
@@ -34,6 +34,13 @@ def predict(message, history):
|
|
| 34 |
"""
|
| 35 |
global THREAD_ID
|
| 36 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 37 |
# 1) Decide if we are creating a new thread or continuing the old one
|
| 38 |
if THREAD_ID is None:
|
| 39 |
# No thread_id yet -> this is the first user message
|
|
|
|
| 34 |
"""
|
| 35 |
global THREAD_ID
|
| 36 |
|
| 37 |
+
# Imprimir el historial en la consola para depuraci贸n
|
| 38 |
+
print("Historial actual:", history)
|
| 39 |
+
|
| 40 |
+
# Si la historia est谩 vac铆a, resetear THREAD_ID para iniciar un nuevo hilo
|
| 41 |
+
if not history:
|
| 42 |
+
THREAD_ID = None
|
| 43 |
+
|
| 44 |
# 1) Decide if we are creating a new thread or continuing the old one
|
| 45 |
if THREAD_ID is None:
|
| 46 |
# No thread_id yet -> this is the first user message
|