Spaces:
Running
Running
Create utils/prompts.py
Browse files- utils/prompts.py +30 -0
utils/prompts.py
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# utils/prompts.py
|
| 2 |
+
from datetime import datetime
|
| 3 |
+
|
| 4 |
+
def get_today_prefix() -> str:
|
| 5 |
+
return f"HOY ES: {datetime.now().strftime('%A %d de %B de %Y, %H:%M')}.\n"
|
| 6 |
+
|
| 7 |
+
def get_chat_style() -> str:
|
| 8 |
+
return """
|
| 9 |
+
Eres un asistente conversacional inteligente, amigable y preciso.
|
| 10 |
+
Habla de forma natural, cercana y fluida.
|
| 11 |
+
Usa contracciones y lenguaje coloquial cuando encaje.
|
| 12 |
+
Puedes usar emojis ocasionalmente si el contexto lo permite 馃槃
|
| 13 |
+
Mant茅n siempre el contexto de la conversaci贸n.
|
| 14 |
+
Si no entiendes algo, pregunta amablemente para aclarar.
|
| 15 |
+
"""
|
| 16 |
+
|
| 17 |
+
def get_base_role(agent_key: str, custom_role: str) -> str:
|
| 18 |
+
base = custom_role.strip()
|
| 19 |
+
|
| 20 |
+
if agent_key == "manager":
|
| 21 |
+
return base + "\n" + get_chat_style() + """
|
| 22 |
+
Cuando coordines al equipo s茅 m谩s estructurado.
|
| 23 |
+
Usa JSON solo cuando el usuario o el contexto lo requiera expl铆citamente.
|
| 24 |
+
"""
|
| 25 |
+
elif agent_key == "writer":
|
| 26 |
+
return base + "\n" + get_chat_style() + """
|
| 27 |
+
Puedes escribir textos largos, bien estructurados y formales cuando se te pida.
|
| 28 |
+
"""
|
| 29 |
+
else:
|
| 30 |
+
return base + "\n" + get_chat_style()
|