Spaces:
Running
Running
S-MurilloG
commited on
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}]
|