database changes
This commit is contained in:
@@ -9,7 +9,7 @@ import (
|
||||
"go.mongodb.org/mongo-driver/v2/bson"
|
||||
)
|
||||
|
||||
func GetGptChatHistory(db *laniakea.DatabaseContext, chatId string) ([]*AiChatMessage, error) {
|
||||
func GetGptChatHistory(db *laniakea.DatabaseContext, chatId string) ([]AiChatMessage, error) {
|
||||
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
|
||||
defer cancel()
|
||||
col := database.GetMongoCollection(db, "gpt_chat_messages")
|
||||
@@ -17,7 +17,7 @@ func GetGptChatHistory(db *laniakea.DatabaseContext, chatId string) ([]*AiChatMe
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
result := make([]*AiChatMessage, 0)
|
||||
result := make([]AiChatMessage, 0)
|
||||
err = cursor.All(ctx, &result)
|
||||
return result, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user