summaryrefslogtreecommitdiff
path: root/bot.go
diff options
context:
space:
mode:
authorGrail Finder <wohilas@gmail.com>2024-11-21 20:22:13 +0300
committerGrail Finder <wohilas@gmail.com>2024-11-21 20:22:13 +0300
commit692e0ada4b6115078485a9bc867c99d2c85d8dd9 (patch)
tree05234ce84ee88bc8ef4628be50fac05a221317d6 /bot.go
parentcc84c037ece2a89424d490d9ee819f06cf4bb347 (diff)
Fix: marshal default chat start in the init funcHEADmaster
Diffstat (limited to 'bot.go')
-rw-r--r--bot.go9
1 files changed, 7 insertions, 2 deletions
diff --git a/bot.go b/bot.go
index b71ed90..6b15a3e 100644
--- a/bot.go
+++ b/bot.go
@@ -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