From 768c67f898418817eab3a087977abe04ee8040ac Mon Sep 17 00:00:00 2001 From: Liuyang <2746366019@qq.com> Date: Wed, 5 Mar 2025 17:43:20 +0800 Subject: [PATCH] =?UTF-8?q?refactor(yudao-module-llm):=20=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D=E7=9F=A5=E8=AF=86=E6=96=87=E6=A1=A3=E5=8C=B9=E9=85=8D?= =?UTF-8?q?=E7=8E=87=E6=9F=A5=E8=AF=A2=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 将 rightPushIfPresent 方法替换为 rightPush 方法,确保段落匹配率信息总是被添加到 Redis 列表中 - 优化了知识文档匹配率的查询流程,提高了数据的准确性和可靠性 --- .../llm/service/conversation/ConversationServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/yudao-module-llm/yudao-module-llm-biz/src/main/java/cn/iocoder/yudao/module/llm/service/conversation/ConversationServiceImpl.java b/yudao-module-llm/yudao-module-llm-biz/src/main/java/cn/iocoder/yudao/module/llm/service/conversation/ConversationServiceImpl.java index 57b019556..0332c1a52 100644 --- a/yudao-module-llm/yudao-module-llm-biz/src/main/java/cn/iocoder/yudao/module/llm/service/conversation/ConversationServiceImpl.java +++ b/yudao-module-llm/yudao-module-llm-biz/src/main/java/cn/iocoder/yudao/module/llm/service/conversation/ConversationServiceImpl.java @@ -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 paragraphHitRateList = stringRedisTemplate.opsForList().range(redisKey, 0, -1); if (paragraphHitRateList != null && !paragraphHitRateList.isEmpty()) {