refactor(yudao-module-llm): 修复知识文档匹配率查询逻辑

- 将 rightPushIfPresent 方法替换为 rightPush 方法,确保段落匹配率信息总是被添加到 Redis 列表中
- 优化了知识文档匹配率的查询流程,提高了数据的准确性和可靠性
This commit is contained in:
Liuyang 2025-03-05 17:43:20 +08:00
parent 1138058d74
commit 768c67f898

View File

@ -523,7 +523,7 @@ public class ConversationServiceImpl implements ConversationService {
// 请求结果添加到 Redis查询段落命中率
String redisKey = String.format("%s:%s", KNOWLEDGE_DOCUMENTS_REDIS_KEY, chatReqVO.getUuid());
stringRedisTemplate.opsForList().rightPushIfPresent(redisKey, JSON.toJSONString(paragraphHitRateListVO));
stringRedisTemplate.opsForList().rightPush(redisKey, JSON.toJSONString(paragraphHitRateListVO));
List<String> paragraphHitRateList = stringRedisTemplate.opsForList().range(redisKey, 0, -1);
if (paragraphHitRateList != null && !paragraphHitRateList.isEmpty()) {