Fix: chat upsert
This commit is contained in:
@@ -14,12 +14,12 @@
|
|||||||
- stop stream from the bot; +
|
- stop stream from the bot; +
|
||||||
- sqlitedb instead of chatfiles; +
|
- sqlitedb instead of chatfiles; +
|
||||||
- sqlite for the bot memory;
|
- sqlite for the bot memory;
|
||||||
|
- option to switch between predefined sys prompts;
|
||||||
|
|
||||||
### FIX:
|
### FIX:
|
||||||
- bot responding (or haninging) blocks everything; +
|
- bot responding (or haninging) blocks everything; +
|
||||||
- programm requires history folder, but it is .gitignore; +
|
- programm requires history folder, but it is .gitignore; +
|
||||||
- at first run chat table does not exist; run migrations sql on startup; +
|
- 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) +
|
- 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);
|
- 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));
|
||||||
- EOF from llama, possibly broken json in request;
|
- empty input to continue bot msg gens new msg index and bot icon;
|
||||||
- chat upsert does not work;
|
|
||||||
|
|||||||
1
bot.go
1
bot.go
@@ -238,7 +238,6 @@ func init() {
|
|||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
logger = slog.New(slog.NewTextHandler(file, nil))
|
logger = slog.New(slog.NewTextHandler(file, nil))
|
||||||
logger.Info("test msg")
|
|
||||||
store = storage.NewProviderSQL("test.db", logger)
|
store = storage.NewProviderSQL("test.db", logger)
|
||||||
// https://github.com/coreydaley/ggerganov-llama.cpp/blob/master/examples/server/README.md
|
// https://github.com/coreydaley/ggerganov-llama.cpp/blob/master/examples/server/README.md
|
||||||
// load all chats in memory
|
// load all chats in memory
|
||||||
|
|||||||
@@ -90,6 +90,12 @@ func loadOldChatOrGetNew() []models.MessagesStory {
|
|||||||
chatMap[newChat.Name] = newChat
|
chatMap[newChat.Name] = newChat
|
||||||
return defaultStarter
|
return defaultStarter
|
||||||
}
|
}
|
||||||
|
if chat.Name == "" {
|
||||||
|
logger.Warn("empty chat name", "id", chat.ID)
|
||||||
|
chat.Name = fmt.Sprintf("%d_%v", chat.ID, chat.CreatedAt.Unix())
|
||||||
|
}
|
||||||
|
chatMap[chat.Name] = chat
|
||||||
|
activeChatName = chat.Name
|
||||||
return history
|
return history
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user