summaryrefslogtreecommitdiff
path: root/session.go
diff options
context:
space:
mode:
authorGrail Finder <wohilas@gmail.com>2024-12-02 19:58:03 +0300
committerGrail Finder <wohilas@gmail.com>2024-12-02 19:58:03 +0300
commita5ab816c9434022159548ac0d1872160b3c8908d (patch)
treea4e68c334f2a514f02afd65a1bb70eff415fb8cd /session.go
parent8d3997baff25f28c23441699be7692f853cf1f0f (diff)
Feat: add character card support
Diffstat (limited to 'session.go')
-rw-r--r--session.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/session.go b/session.go
index ee448cc..88b370c 100644
--- a/session.go
+++ b/session.go
@@ -14,7 +14,7 @@ var (
chatMap = make(map[string]*models.Chat)
)
-func historyToSJSON(msgs []models.MessagesStory) (string, error) {
+func historyToSJSON(msgs []models.RoleMsg) (string, error) {
data, err := json.Marshal(msgs)
if err != nil {
return "", err
@@ -25,7 +25,7 @@ func historyToSJSON(msgs []models.MessagesStory) (string, error) {
return string(data), nil
}
-func updateStorageChat(name string, msgs []models.MessagesStory) error {
+func updateStorageChat(name string, msgs []models.RoleMsg) error {
var err error
chat, ok := chatMap[name]
if !ok {
@@ -59,7 +59,7 @@ func loadHistoryChats() ([]string, error) {
return resp, nil
}
-func loadHistoryChat(chatName string) ([]models.MessagesStory, error) {
+func loadHistoryChat(chatName string) ([]models.RoleMsg, error) {
chat, ok := chatMap[chatName]
if !ok {
err := errors.New("failed to read chat")
@@ -70,7 +70,7 @@ func loadHistoryChat(chatName string) ([]models.MessagesStory, error) {
return chat.ToHistory()
}
-func loadOldChatOrGetNew() []models.MessagesStory {
+func loadOldChatOrGetNew() []models.RoleMsg {
newChat := &models.Chat{
ID: 0,
CreatedAt: time.Now(),