File tree 1 file changed +4
-3
lines changed
1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -83,11 +83,13 @@ def handle_user_message(self, user_input: str) -> str:
83
83
self .conversation_history .append ({"role" : "user" , "content" : user_input })
84
84
85
85
if user_input == "/stop" :
86
+ bot_response = "conversation-terminated"
87
+ # print(f"Bot: {bot_response}")
86
88
self .end_chat ()
87
- return "conversation-terminated"
89
+ return bot_response
88
90
else :
89
91
bot_response = self .llm_service .generate_response (self .conversation_history )
90
- print (f"Bot : " , bot_response )
92
+ # print(f"Bot: { bot_response}" )
91
93
self .conversation_history .append (
92
94
{"role" : "assistant" , "content" : bot_response }
93
95
)
@@ -120,7 +122,6 @@ def end_chat(self) -> None:
120
122
try :
121
123
user_input = "/stop"
122
124
bot_response = "conversation-terminated"
123
- print (f"Bot : " , bot_response )
124
125
self .db .insert_chat_data (self .chat_id_pk , user_input , bot_response )
125
126
self .db .insert_chat_history (current_time , is_stream )
126
127
except Exception as e :
You can’t perform that action at this time.
0 commit comments