summaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
authorGrail Finder <wohilas@gmail.com>2024-11-16 06:41:52 +0300
committerGrail Finder <wohilas@gmail.com>2024-11-16 06:41:52 +0300
commit84b06c0da5854f153aa31b668f60914e4bb74fc5 (patch)
tree8983fe48041f5f3e52c0be72d0c9d8ca07de25e8 /main.go
parent3cbad31a16bc82ff6e29410927578242d158b97a (diff)
Feat: read from chat files
Diffstat (limited to 'main.go')
-rw-r--r--main.go10
1 files changed, 9 insertions, 1 deletions
diff --git a/main.go b/main.go
index 7d3bb56..472945f 100644
--- a/main.go
+++ b/main.go
@@ -2,6 +2,7 @@ package main
import (
"fmt"
+ "strings"
"unicode"
"github.com/gdamore/tcell/v2"
@@ -53,7 +54,14 @@ func main() {
}
textArea.SetMovedFunc(updateStatusLine)
updateStatusLine()
- textView.SetText("<🤖>: Hello! What can I do for you?")
+ history := chatToText()
+ chatHistory := strings.Builder{}
+ for _, m := range history {
+ chatHistory.WriteString(m)
+ // textView.SetText(m)
+ }
+ textView.SetText(chatHistory.String())
+ // textView.SetText("<🤖>: Hello! What can I do for you?")
app.SetInputCapture(func(event *tcell.EventKey) *tcell.EventKey {
if botRespMode {
// do nothing while bot typing