diff --git a/neural_network/chatbot/README.md b/neural_network/chatbot/README.md index f7c216561..5e8f86b0c 100644 --- a/neural_network/chatbot/README.md +++ b/neural_network/chatbot/README.md @@ -30,10 +30,10 @@ This project is a simple chatbot application built using Python, integrating a d ``` # Together API key TOGETHER_API_KEY="YOUR_API_KEY" - + # Groq API key GROQ_API_KEY = "YOUR_API_KEY" - + # MySQL connectionDB (if you're running locally) DB_USER = "" DB_PASSWORD = "" diff --git a/neural_network/chatbot/chatbot.py b/neural_network/chatbot/chatbot.py index 38488349f..2456ced5e 100644 --- a/neural_network/chatbot/chatbot.py +++ b/neural_network/chatbot/chatbot.py @@ -87,7 +87,7 @@ class Chatbot: return "conversation-terminated" 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 +120,7 @@ class Chatbot: try: user_input = "/stop" bot_response = "conversation-terminated" - print(f"Bot : ",bot_response) + 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: diff --git a/neural_network/chatbot/db.py b/neural_network/chatbot/db.py index 92ef6909c..3572a699e 100644 --- a/neural_network/chatbot/db.py +++ b/neural_network/chatbot/db.py @@ -156,7 +156,7 @@ class ChatDatabase: cursor = conn.cursor() cursor.execute( """ - SELECT chat_id FROM ChatDB.Chat_history WHERE + SELECT chat_id FROM ChatDB.Chat_history WHERE chat_id=(SELECT MAX(chat_id) FROM ChatDB.Chat_history) """ )