redis缓存替换+pgvector向量替换
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user