From f8510d702eea331a94663769e84bd6959d25537b Mon Sep 17 00:00:00 2001 From: Pritam Das <69068731+Pritam3355@users.noreply.github.com> Date: Sat, 19 Oct 2024 10:31:17 +0530 Subject: [PATCH] Add files via upload --- neural_network/chatbot/chatbot.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/neural_network/chatbot/chatbot.py b/neural_network/chatbot/chatbot.py index 2456ced5e..9de733c94 100644 --- a/neural_network/chatbot/chatbot.py +++ b/neural_network/chatbot/chatbot.py @@ -83,11 +83,13 @@ class Chatbot: self.conversation_history.append({"role": "user", "content": user_input}) if user_input == "/stop": + bot_response = "conversation-terminated" + # print(f"Bot: {bot_response}") self.end_chat() - return "conversation-terminated" + return bot_response else: bot_response = self.llm_service.generate_response(self.conversation_history) - print(f"Bot : ", bot_response) + # print(f"Bot: {bot_response}") self.conversation_history.append( {"role": "assistant", "content": bot_response} ) @@ -120,7 +122,6 @@ class Chatbot: try: user_input = "/stop" bot_response = "conversation-terminated" - print(f"Bot : ", bot_response) self.db.insert_chat_data(self.chat_id_pk, user_input, bot_response) self.db.insert_chat_history(current_time, is_stream) except Exception as e: