refactoring, fixes and laniakea v0.8

This commit is contained in:
2026-02-19 14:02:25 +03:00
parent 0804398b6c
commit c9a5a81643
30 changed files with 219 additions and 190 deletions

View File

@@ -2,14 +2,13 @@ package mdb
import (
"context"
"kurumibot/database"
"time"
"ymgb/database"
"git.nix13.pw/scuroneko/laniakea"
"go.mongodb.org/mongo-driver/v2/bson"
)
func GetGptChatHistory(db *laniakea.DatabaseContext, chatId string) ([]AiChatMessage, error) {
func GetGptChatHistory(db *database.Context, chatId string) ([]AiChatMessage, error) {
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
defer cancel()
col := database.GetMongoCollection(db, "gpt_chat_messages")
@@ -21,7 +20,7 @@ func GetGptChatHistory(db *laniakea.DatabaseContext, chatId string) ([]AiChatMes
err = cursor.All(ctx, &result)
return result, err
}
func UpdateGptChatHistory(db *laniakea.DatabaseContext, chatId, role, message string) error {
func UpdateGptChatHistory(db *database.Context, chatId, role, message string) error {
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
defer cancel()
col := database.GetMongoCollection(db, "gpt_chat_messages")