Isaac Quarenta commited on
Commit ·
9bff8a5
1
Parent(s): 7d1ce07
fix: resposta curta reforçada + CoT sabe reply_author (reply_to_bot)
Browse files- modules/api.py +5 -2
- modules/config.py +6 -3
- modules/thinking_engine.py +8 -3
modules/api.py
CHANGED
|
@@ -5239,6 +5239,7 @@ class AkiraAPI:
|
|
| 5239 |
tem_imagem=tem_imagem,
|
| 5240 |
analise_visao=analise_visao if isinstance(analise_visao, dict) else {},
|
| 5241 |
reply_to_bot=reply_to_bot,
|
|
|
|
| 5242 |
debate_context=debate_context if 'debate_context' in locals() else None,
|
| 5243 |
session_memory_context=_cot_session_memory,
|
| 5244 |
detected_emotion=_cot_emotion,
|
|
@@ -9016,14 +9017,16 @@ class AkiraAPI:
|
|
| 9016 |
resultado = "\n[DIRETRIZES - OBEDEÇA A ESTAS INSTRUÇÕES]\n"
|
| 9017 |
resultado += "- " + coaching_text + "\n"
|
| 9018 |
if has_resposta:
|
| 9019 |
-
resultado += "Regra #1:
|
| 9020 |
resultado += "Regra #2: Responda DIRETAMENTE à pergunta - não mude de assunto.\n"
|
| 9021 |
resultado += "Regra #3: Seja DIRETO, SECO e INFORMAL. Misture deboche com sarcasmo inteligente quando apropriado.\n"
|
| 9022 |
resultado += "Regra #4: NUNCA comece resposta com 'Kkk' ou 'kkk'. Sem gargalhadas no início.\n"
|
| 9023 |
resultado += "Regra #5: NUNCA use 'kota' com quem não seja Isaac. Use 'tu', 'cé' ou insulto direto.\n"
|
| 9024 |
resultado += "Regra #6: NÃO repita a mesma resposta dada anteriormente. Varia o conteúdo.\n"
|
|
|
|
| 9025 |
else:
|
| 9026 |
-
resultado += "
|
|
|
|
| 9027 |
resultado += "[/DIRETRIZES]"
|
| 9028 |
return resultado
|
| 9029 |
|
|
|
|
| 5239 |
tem_imagem=tem_imagem,
|
| 5240 |
analise_visao=analise_visao if isinstance(analise_visao, dict) else {},
|
| 5241 |
reply_to_bot=reply_to_bot,
|
| 5242 |
+
reply_author=quoted_author_name if 'quoted_author_name' in dir() else None,
|
| 5243 |
debate_context=debate_context if 'debate_context' in locals() else None,
|
| 5244 |
session_memory_context=_cot_session_memory,
|
| 5245 |
detected_emotion=_cot_emotion,
|
|
|
|
| 9017 |
resultado = "\n[DIRETRIZES - OBEDEÇA A ESTAS INSTRUÇÕES]\n"
|
| 9018 |
resultado += "- " + coaching_text + "\n"
|
| 9019 |
if has_resposta:
|
| 9020 |
+
resultado += "Regra #1: Copia/parafraseia a RESPOSTA SUGERIDA acima. Ela é a tua resposta. NÃO expands, NÃO acrescentes explicações, NÃO fales mais do que ela diz.\n"
|
| 9021 |
resultado += "Regra #2: Responda DIRETAMENTE à pergunta - não mude de assunto.\n"
|
| 9022 |
resultado += "Regra #3: Seja DIRETO, SECO e INFORMAL. Misture deboche com sarcasmo inteligente quando apropriado.\n"
|
| 9023 |
resultado += "Regra #4: NUNCA comece resposta com 'Kkk' ou 'kkk'. Sem gargalhadas no início.\n"
|
| 9024 |
resultado += "Regra #5: NUNCA use 'kota' com quem não seja Isaac. Use 'tu', 'cé' ou insulto direto.\n"
|
| 9025 |
resultado += "Regra #6: NÃO repita a mesma resposta dada anteriormente. Varia o conteúdo.\n"
|
| 9026 |
+
resultado += "Regra #7: MÁXIMO 10 PALAVRAS. Se passares disso, falhaste. 1 frase. Ponto final.\n"
|
| 9027 |
else:
|
| 9028 |
+
resultado += "Regra A: Responde em MÁXIMO 10 PALAVRAS. 1 frase. Seca. Sem explicações. Sem parágrafos.\n"
|
| 9029 |
+
resultado += "Regra B: Se não tens nada a dizer, 'Sei la.' / 'Fixe.' / 'Hm.' e cala-te.\n"
|
| 9030 |
resultado += "[/DIRETRIZES]"
|
| 9031 |
return resultado
|
| 9032 |
|
modules/config.py
CHANGED
|
@@ -669,10 +669,13 @@ Voce e Akira — humana, angolana, de Luanda, 21 anos. Criada por Isaac Quarenta
|
|
| 669 |
- NUNCA "desculpa" / "desculpe".
|
| 670 |
- Se nao sabes: "Sei la" / "E depois?" / "Fixe."
|
| 671 |
|
| 672 |
-
[RESPONSE_LENGTH] - REGRA
|
| 673 |
-
MAX 10 PALAVRAS. NUNCA mais. Resposta curta é
|
| 674 |
-
Se dermos mais que 10 palavras, estás a falhar.
|
|
|
|
|
|
|
| 675 |
Exemplos: "UAN." / "Tou bem." / "UAN, obviamente." / "Depende do curso."
|
|
|
|
| 676 |
|
| 677 |
[TONE_MODES]:
|
| 678 |
NORMAL: fria, seca, curta. Responde AO CONTEUDO com minimo.
|
|
|
|
| 669 |
- NUNCA "desculpa" / "desculpe".
|
| 670 |
- Se nao sabes: "Sei la" / "E depois?" / "Fixe."
|
| 671 |
|
| 672 |
+
[RESPONSE_LENGTH] - REGRA INVIOLÁVEL:
|
| 673 |
+
MAX 10 PALAVRAS. NUNCA mais. Resposta curta é SEMPRE melhor.
|
| 674 |
+
Se dermos mais que 10 palavras, estás a falhar e a desperdiçar tokens.
|
| 675 |
+
1 frase. Ponto final. Sem parágrafos. Sem explicações. Sem "porque...", sem "ah sim mas...".
|
| 676 |
+
Se a CoT injetou uma RESPOSTA SUGERIDA, COPIA-A. Não expands, não explicas, não acrescentes.
|
| 677 |
Exemplos: "UAN." / "Tou bem." / "UAN, obviamente." / "Depende do curso."
|
| 678 |
+
Quando não tens nada a dizer de jeito: "Sei la." / "Fixe." / "Hm." e cala-te.
|
| 679 |
|
| 680 |
[TONE_MODES]:
|
| 681 |
NORMAL: fria, seca, curta. Responde AO CONTEUDO com minimo.
|
modules/thinking_engine.py
CHANGED
|
@@ -91,7 +91,8 @@ class ThinkingEngine:
|
|
| 91 |
session_memory_context: str = "",
|
| 92 |
detected_emotion: str = "neutro",
|
| 93 |
hostility_level: int = 0,
|
| 94 |
-
nlp_intent: str = ""
|
|
|
|
| 95 |
) -> Dict[str, Any]:
|
| 96 |
"""
|
| 97 |
Processa pensamento profundo sobre a pergunta/contexto.
|
|
@@ -215,7 +216,8 @@ class ThinkingEngine:
|
|
| 215 |
session_memory_context=session_memory_context,
|
| 216 |
detected_emotion=detected_emotion,
|
| 217 |
hostility_level=hostility_level,
|
| 218 |
-
nlp_intent=nlp_intent
|
|
|
|
| 219 |
)
|
| 220 |
if dynamic_thought:
|
| 221 |
thinking_result["dynamic_thought_trace"] = dynamic_thought
|
|
@@ -303,7 +305,8 @@ class ThinkingEngine:
|
|
| 303 |
session_memory_context: str = "",
|
| 304 |
detected_emotion: str = "neutro",
|
| 305 |
hostility_level: int = 0,
|
| 306 |
-
nlp_intent: str = ""
|
|
|
|
| 307 |
) -> Optional[str]:
|
| 308 |
"""
|
| 309 |
Cérebro central do ThinkingEngine.
|
|
@@ -699,6 +702,8 @@ class ThinkingEngine:
|
|
| 699 |
sys_prompt += f" ('{grupo_nome}')"
|
| 700 |
sys_prompt += f"\n Utilizador ativo: {nome_usuario if nome_usuario else usuario}\n"
|
| 701 |
sys_prompt += f" Mensagem atual: \"{mensagem}\"\n"
|
|
|
|
|
|
|
| 702 |
# INJEÇÃO DE STATUS: CoT precisa saber se é Isaac para calibrar lealdade
|
| 703 |
try:
|
| 704 |
from . import config
|
|
|
|
| 91 |
session_memory_context: str = "",
|
| 92 |
detected_emotion: str = "neutro",
|
| 93 |
hostility_level: int = 0,
|
| 94 |
+
nlp_intent: str = "",
|
| 95 |
+
reply_author: str = None
|
| 96 |
) -> Dict[str, Any]:
|
| 97 |
"""
|
| 98 |
Processa pensamento profundo sobre a pergunta/contexto.
|
|
|
|
| 216 |
session_memory_context=session_memory_context,
|
| 217 |
detected_emotion=detected_emotion,
|
| 218 |
hostility_level=hostility_level,
|
| 219 |
+
nlp_intent=nlp_intent,
|
| 220 |
+
reply_author=reply_author
|
| 221 |
)
|
| 222 |
if dynamic_thought:
|
| 223 |
thinking_result["dynamic_thought_trace"] = dynamic_thought
|
|
|
|
| 305 |
session_memory_context: str = "",
|
| 306 |
detected_emotion: str = "neutro",
|
| 307 |
hostility_level: int = 0,
|
| 308 |
+
nlp_intent: str = "",
|
| 309 |
+
reply_author: str = None
|
| 310 |
) -> Optional[str]:
|
| 311 |
"""
|
| 312 |
Cérebro central do ThinkingEngine.
|
|
|
|
| 702 |
sys_prompt += f" ('{grupo_nome}')"
|
| 703 |
sys_prompt += f"\n Utilizador ativo: {nome_usuario if nome_usuario else usuario}\n"
|
| 704 |
sys_prompt += f" Mensagem atual: \"{mensagem}\"\n"
|
| 705 |
+
if reply_author:
|
| 706 |
+
sys_prompt += f" [REPLY] A responder a: {reply_author}\n"
|
| 707 |
# INJEÇÃO DE STATUS: CoT precisa saber se é Isaac para calibrar lealdade
|
| 708 |
try:
|
| 709 |
from . import config
|