From 4ecdca19d673d721c5c744a238a437e5b3c72146 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Sat, 19 Oct 2024 04:49:54 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- neural_network/chatbot/README.md | 4 ++-- neural_network/chatbot/chatbot.py | 4 ++-- neural_network/chatbot/db.py | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) 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) """ )