diff options
-rw-r--r-- | README.md | 9 | ||||
-rw-r--r-- | main.go | 2 | ||||
-rw-r--r-- | tui.go | 34 |
3 files changed, 39 insertions, 6 deletions
@@ -15,20 +15,21 @@ - define tools and sys prompt for them to be used; + - add system prompt without tools (for mistral); + - option to switch between predefined sys prompts; + -- sqlite for the bot memory; +- sqlite for the bot memory; + +- rename current chat; + - fullscreen textarea option (bothersome to implement); - consider adding use /completion of llamacpp, since openai endpoint clearly has template|format issues; - change temp, min-p and other params from tui; - help page with all key bindings; -- rename current chat; +- default config file (api url, path to sysprompts, path to log, limits, etc); ### FIX: - bot responding (or haninging) blocks everything; + - programm requires history folder, but it is .gitignore; + - at first run chat table does not exist; run migrations sql on startup; + - Tab is needed to copy paste text into textarea box, use shift+tab to switch focus; (changed tp pgup) + -- delete last msg: can have unexpected behavior (deletes what appears to be two messages if last bot msg was not generated (should only delete icon in that case)); -- empty input to continue bot msg gens new msg index and bot icon; - sometimes bots put additional info around the tool call, have a regexp to match tool call; + - remove all panics from code; + +- delete last msg: can have unexpected behavior (deletes what appears to be two messages if last bot msg was not generated (should only delete icon in that case)); +- empty input to continue bot msg gens new msg index and bot icon; - new chat replaces old ones in db; @@ -11,7 +11,7 @@ var ( editMode = false botMsg = "no" selectedIndex = int(-1) - indexLine = "Esc: send msg; PgUp/Down: switch focus; F1: manage chats; F2: regen last; F3:delete last msg; F4: edit msg; F5: toggle system; F6: interrupt bot resp; bot resp mode: %v; current chat: %s" + indexLine = "F12 to show keys help; bot resp mode: %v; current chat: %s" focusSwitcher = map[tview.Primitive]tview.Primitive{} ) @@ -17,11 +17,26 @@ var ( editArea *tview.TextArea textView *tview.TextView position *tview.TextView + helpView *tview.TextView flex *tview.Flex chatActModal *tview.Modal sysModal *tview.Modal indexPickWindow *tview.InputField renameWindow *tview.InputField + helpText = ` +[yellow]Esc[white]: send msg +[yellow]PgUp/Down[white]: switch focus +[yellow]F1[white]: manage chats +[yellow]F2[white]: regen last +[yellow]F3[white]: delete last msg +[yellow]F4[white]: edit msg +[yellow]F5[white]: toggle system +[yellow]F6[white]: interrupt bot resp +[yellow]F7[white]: copy msg to clipboard (linux xclip) +[yellow]Ctrl+s[white]: choose/replace system prompt + +Press Enter to go back +` ) func init() { @@ -74,7 +89,7 @@ func init() { chatBody.Messages = defaultStarter textView.SetText(chatToText(showSystemMsgs)) newChat := &models.Chat{ - ID: id, + ID: id + 1, Name: fmt.Sprintf("%v_%v", "new", time.Now().Unix()), Msgs: string(defaultStarterBytes), } @@ -209,6 +224,18 @@ func init() { return event }) // + helpView = tview.NewTextView().SetDynamicColors(true).SetText(helpText).SetDoneFunc(func(key tcell.Key) { + pages.RemovePage("helpView") + return + }) + helpView.SetInputCapture(func(event *tcell.EventKey) *tcell.EventKey { + switch event.Key() { + case tcell.KeyEsc, tcell.KeyEnter: + return event + } + return nil + }) + // textArea.SetMovedFunc(updateStatusLine) updateStatusLine() textView.SetText(chatToText(showSystemMsgs)) @@ -271,6 +298,11 @@ func init() { pages.AddPage("getIndex", indexPickWindow, true, true) return nil } + if event.Key() == tcell.KeyF12 { + // help window cheatsheet + pages.AddPage("helpView", helpView, true, true) + return nil + } if event.Key() == tcell.KeyCtrlE { textArea.SetText("pressed ctrl+e", true) return nil |