summaryrefslogtreecommitdiff
path: root/bot.go
diff options
context:
space:
mode:
Diffstat (limited to 'bot.go')
-rw-r--r--bot.go11
1 files changed, 8 insertions, 3 deletions
diff --git a/bot.go b/bot.go
index b71ed90..d4c86f0 100644
--- a/bot.go
+++ b/bot.go
@@ -23,13 +23,13 @@ var httpClient = http.Client{
var (
logger *slog.Logger
- APIURL = "http://localhost:8080/v1/chat/completions"
userRole = "user"
assistantRole = "assistant"
toolRole = "tool"
assistantIcon = "<🤖>: "
userIcon = "<user>: "
// TODO: pass as an cli arg or have config
+ APIURL = "http://localhost:8080/v1/chat/completions"
logFileName = "log.txt"
showSystemMsgs bool
chunkLimit = 1000
@@ -43,8 +43,8 @@ var (
{Role: "system", Content: systemMsg},
{Role: assistantRole, Content: defaultFirstMsg},
}
- defaultStarterBytes, _ = json.Marshal(chatBody.Messages)
- interruptResp = false
+ defaultStarterBytes = []byte{}
+ interruptResp = false
)
// ====
@@ -234,6 +234,11 @@ func init() {
logger.Error("failed to open log file", "error", err, "filename", logFileName)
return
}
+ defaultStarterBytes, err = json.Marshal(defaultStarter)
+ if err != nil {
+ logger.Error("failed to marshal defaultStarter", "error", err)
+ return
+ }
logger = slog.New(slog.NewTextHandler(file, nil))
store = storage.NewProviderSQL("test.db", logger)
// https://github.com/coreydaley/ggerganov-llama.cpp/blob/master/examples/server/README.md