Skip to content

Commit f8510d7

Browse files
authored
Add files via upload
1 parent 4ecdca1 commit f8510d7

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

neural_network/chatbot/chatbot.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -83,11 +83,13 @@ def handle_user_message(self, user_input: str) -> str:
8383
self.conversation_history.append({"role": "user", "content": user_input})
8484

8585
if user_input == "/stop":
86+
bot_response = "conversation-terminated"
87+
# print(f"Bot: {bot_response}")
8688
self.end_chat()
87-
return "conversation-terminated"
89+
return bot_response
8890
else:
8991
bot_response = self.llm_service.generate_response(self.conversation_history)
90-
print(f"Bot : ", bot_response)
92+
# print(f"Bot: {bot_response}")
9193
self.conversation_history.append(
9294
{"role": "assistant", "content": bot_response}
9395
)
@@ -120,7 +122,6 @@ def end_chat(self) -> None:
120122
try:
121123
user_input = "/stop"
122124
bot_response = "conversation-terminated"
123-
print(f"Bot : ", bot_response)
124125
self.db.insert_chat_data(self.chat_id_pk, user_input, bot_response)
125126
self.db.insert_chat_history(current_time, is_stream)
126127
except Exception as e:

0 commit comments

Comments
 (0)