From d70c85947313a6226a98a9dc32abbc7d2fa10a53 Mon Sep 17 00:00:00 2001 From: chigkim Date: Thu, 23 May 2024 19:17:56 -0400 Subject: [PATCH] Prompt Manager UI Label Change. --- Model.py | 1 + PromptDialog.py | 11 ++++++----- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/Model.py b/Model.py index 27cc5a9..7ddbe3c 100644 --- a/Model.py +++ b/Model.py @@ -34,6 +34,7 @@ def __init__(self): self.messages = [] self.generate = False self.image = None + self.document = None self.rag = None self.models = [] self.token_counter = TokenCountingHandler(tokenizer=tiktoken.encoding_for_model("gpt-3.5-turbo").encode) diff --git a/PromptDialog.py b/PromptDialog.py index 4bad24f..a7c5bb6 100644 --- a/PromptDialog.py +++ b/PromptDialog.py @@ -19,8 +19,9 @@ def __init__(self, parent, prompt=""): # UI Elements self.act_list = wx.ListBox(self.panel, choices=self.prompt_data['act'].tolist()) self.prompt_text = wx.TextCtrl(self.panel, style=wx.TE_MULTILINE) - self.new_button = wx.Button(self.panel, label="New") - self.save_button = wx.Button(self.panel, label="Save") + self.prompt_text.SetValue(prompt) + self.new_button = wx.Button(self.panel, label="Duplicate") + self.save_button = wx.Button(self.panel, label="Replace") self.delete_button = wx.Button(self.panel, label="Delete") self.update_button = wx.Button(self.panel, label="Download&Update Awesome ChatGPT Prompts") self.set_button = wx.Button(self.panel, label='Set Prompt', id=wx.ID_OK) @@ -52,7 +53,6 @@ def __init__(self, parent, prompt=""): if not result.empty: selection_index = result.index[0] self.act_list.SetSelection(selection_index) - self.prompt_text.SetValue(self.prompt_data.at[selection_index, 'prompt']) def on_act_selected(self, event): selection = self.act_list.GetSelection() @@ -63,11 +63,12 @@ def on_act_selected(self, event): def on_new(self, event): act = wx.GetTextFromUser("Enter new act:", "New Act") if act: - self.prompt_data = self.prompt_data._append({'act': act, 'prompt': ''}, ignore_index=True) + prompt = self.prompt_text.GetValue() + self.prompt_data = self.prompt_data._append({'act': act, 'prompt': prompt}, ignore_index=True) self.prompt_data = self.prompt_data.sort_values(by='act').reset_index(drop=True) self.act_list.Set(self.prompt_data['act'].tolist()) self.act_list.SetSelection(self.prompt_data.index[self.prompt_data['act'] == act].tolist()[0]) - self.prompt_text.SetValue("") + self.prompt_text.SetValue(prompt) def on_save(self, event): selection = self.act_list.GetSelection()