diff --git a/VOLlama.py b/VOLlama.py index e4fccc8..bbbc51b 100644 --- a/VOLlama.py +++ b/VOLlama.py @@ -1,4 +1,4 @@ -version = 16 +version = 17 import wx import threading import sounddevice as sd @@ -34,9 +34,9 @@ def __init__(self, parent, title): self.Maximize(True) self.Centre() self.Show() - self.historyIndex = 0 self.model = Model() self.model.setSystem(settings.system) + self.historyIndex = len(self.model.messages) self.refreshModels() self.prompt.SetFocus() threading.Thread(target=check_update, args=(version,)).start() @@ -199,6 +199,8 @@ def setSystem(self, event): if dlg.ShowModal() == wx.ID_OK: system = dlg.GetValue() self.model.setSystem(system) + if len(self.model.messages) == 1: + self.historyIndex = 1 settings.system = system dlg.Destroy() @@ -260,6 +262,7 @@ def OnHistoryUp(self, event): self.historyIndex = 0 self.prompt.SetValue(self.model.messages[self.historyIndex].content) self.prompt.SetInsertionPointEnd() + self.sendButton.SetLabel("Edit") def OnHistoryDown(self, event): self.historyIndex += 1 @@ -269,8 +272,10 @@ def OnHistoryDown(self, event): if self.historyIndex < length: self.prompt.SetValue(self.model.messages[self.historyIndex].content) self.prompt.SetInsertionPointEnd() + self.sendButton.SetLabel("Edit") else: self.prompt.SetValue("") + self.sendButton.SetLabel("Send") def FocusOnModelList(self, event): self.modelList.SetFocus() diff --git a/changelog.md b/changelog.md index 23402ae..ffb0515 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,7 @@ # Change log +* Fixed setting history index incorrectly when there's a system message. +* Changed send button to edit when editing history. * Paste last cleared user message into the prompt for editing or simply resending. * Edit history: alt+(or option on mac)+up/down * Embedding with Ollama