Fix: rag panics

This commit is contained in:
Grail Finder
2025-12-10 15:07:06 +03:00
parent 8af2a59a9a
commit ad36d1c3e0
3 changed files with 70 additions and 23 deletions

2
bot.go
View File

@@ -429,13 +429,11 @@ func chatRagUse(qText string) (string, error) {
logger.Error("failed to get embs", "error", err, "index", i, "question", q)
continue
}
// Create EmbeddingResp struct for the search
embeddingResp := &models.EmbeddingResp{
Embedding: emb,
Index: 0, // Not used in search but required for the struct
}
vecs, err := ragger.SearchEmb(embeddingResp)
if err != nil {
logger.Error("failed to query embs", "error", err, "index", i, "question", q)