refactoring, fixes and laniakea v0.8
This commit is contained in:
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user