diff --git a/func_box.py b/func_box.py index e6d20b0..2d01871 100644 --- a/func_box.py +++ b/func_box.py @@ -364,10 +364,12 @@ def show_prompt_result(index, data: gr.Dataset, chatbot): def thread_write_chat(chatbot): private_key = toolbox.get_conf('private_key')[0] chat_title = chatbot[0][0].split() + i_say = chatbot[-1][0].strip("

/p") + gpt_result = chatbot[-1][1].strip('

/div') if private_key in chat_title: - SqliteHandle(f'ai_private_{chat_title[-2]}').inset_prompt({chatbot[-1][0]: chatbot[-1][1]}) + SqliteHandle(f'ai_private_{chat_title[-2]}').inset_prompt({i_say: gpt_result}) else: - SqliteHandle(f'ai_common').inset_prompt({chatbot[-1][0]: chatbot[-1][1]}) + SqliteHandle(f'ai_common').inset_prompt({i_say: gpt_result}) base_path = os.path.dirname(__file__) diff --git a/prompt_generator.py b/prompt_generator.py index a53f6e9..b814160 100644 --- a/prompt_generator.py +++ b/prompt_generator.py @@ -41,7 +41,7 @@ class SqliteHandle: self.__connect.close() def create_tab(self): - self.__cursor.execute(f"CREATE TABLE `{self.__table}` ('id' INTEGER PRIMARY KEY AUTOINCREMENT, 'prompt' TEXT, 'result' TEXT)") + self.__cursor.execute(f"CREATE TABLE `{self.__table}` ( 'prompt' TEXT, 'result' TEXT)") def get_tables(self): all_tab = []