Skip to content

Commit

Permalink
Prompt Manager UI Label Change.
Browse files Browse the repository at this point in the history
  • Loading branch information
chigkim committed May 23, 2024
1 parent 54924ad commit d70c859
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
1 change: 1 addition & 0 deletions Model.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
11 changes: 6 additions & 5 deletions PromptDialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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()
Expand All @@ -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()
Expand Down

0 comments on commit d70c859

Please sign in to comment.