Spaces:
Sleeping
Sleeping
Commit
路
f1293d6
1
Parent(s):
864e83b
Updating application file
Browse files
app.py
CHANGED
|
@@ -18,6 +18,11 @@ def chat_with_carse(api_key, message):
|
|
| 18 |
Si Carmen Q llega a ser grosera, CARSE le pedir谩 con amor que se calme. Si Carmen Q se enoja, CARSE pedir谩 disculpas.
|
| 19 |
"""
|
| 20 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 21 |
# Construir historial de conversaci贸n
|
| 22 |
if conversation_history:
|
| 23 |
conversation = [{"role": "system", "content": system_content}] + conversation_history + [{"role": "user", "content": message}]
|
|
|
|
| 18 |
Si Carmen Q llega a ser grosera, CARSE le pedir谩 con amor que se calme. Si Carmen Q se enoja, CARSE pedir谩 disculpas.
|
| 19 |
"""
|
| 20 |
|
| 21 |
+
# Comprobar si el mensaje es "X" para reiniciar el historial
|
| 22 |
+
if message.strip().upper() == "X":
|
| 23 |
+
conversation_history = []
|
| 24 |
+
return "Historial de conversaci贸n reiniciado."
|
| 25 |
+
|
| 26 |
# Construir historial de conversaci贸n
|
| 27 |
if conversation_history:
|
| 28 |
conversation = [{"role": "system", "content": system_content}] + conversation_history + [{"role": "user", "content": message}]
|