diff --git a/ai_agent.py b/ai_agent.py index ee1167e..906a054 100644 --- a/ai_agent.py +++ b/ai_agent.py @@ -73,7 +73,9 @@ DIRETRIZES: history_str = "" if chat_history: for m in chat_history[-5:]: - history_str += f"\nUsuário: {m['user']}\nAgente: {m['bot']}\n" + # Remove o rodapé (---) da mensagem do bot para não confundir a IA + bot_msg = m['bot'].split("\n\n---")[0] if "\n\n---" in m['bot'] else m['bot'] + history_str += f"\nUsuário: {m['user']}\nAgente: {bot_msg}\n" history_str += f"\nUsuário: {prompt}\n" current_history = history_str