redis缓存替换+pgvector向量替换

This commit is contained in:
1iaan
2026-04-04 22:39:16 +08:00
parent e993eb6c5c
commit 9d7c416737
124 changed files with 5460 additions and 141 deletions

View File

@@ -62,7 +62,7 @@ func (s *chatService) ChatCompletion(ctx context.Context, in *proto.ChatCompleti
idStr, score, err := s.vectorData.QueryData(context.Background(), map[string][]string{"keywords": {strings.Join(keywords, ",")}})
if err != nil {
s.log.Error(err)
} else if score > 0.99 {
} else if score > s.config.Vector.Threshold {
id, err := strconv.ParseInt(idStr, 10, 64)
if err != nil {
s.log.Error(err)
@@ -200,7 +200,7 @@ func (s *chatService) ChatCompletionStream(in *proto.ChatCompletionRequest, stre
idStr, score, err := s.vectorData.QueryData(context.Background(), map[string][]string{"keywords": {strings.Join(keywords, ",")}})
if err != nil {
s.log.Error(err)
} else if score > 0.99 {
} else if score > s.config.Vector.Threshold {
id, err := strconv.ParseInt(idStr, 10, 64)
if err != nil {
s.log.Error(err)