From c1a5833bec63810bbede46f9a3ac8da115bd6a74 Mon Sep 17 00:00:00 2001 From: Liuyang <2746366019@qq.com> Date: Fri, 21 Feb 2025 11:20:11 +0800 Subject: [PATCH] =?UTF-8?q?refactor(yudao-module-llm):=20=E6=81=A2?= =?UTF-8?q?=E5=A4=8D=E6=96=87=E6=A1=A3=E5=B5=8C=E5=85=A5=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 重新启用了对上传文件进行嵌入的逻辑 - 根据文件扩展名决定使用不同的嵌入方法 --- .../llm/service/async/AsyncKnowledgeBase.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/yudao-module-llm/yudao-module-llm-biz/src/main/java/cn/iocoder/yudao/module/llm/service/async/AsyncKnowledgeBase.java b/yudao-module-llm/yudao-module-llm-biz/src/main/java/cn/iocoder/yudao/module/llm/service/async/AsyncKnowledgeBase.java index 76b6c289c..464339724 100644 --- a/yudao-module-llm/yudao-module-llm-biz/src/main/java/cn/iocoder/yudao/module/llm/service/async/AsyncKnowledgeBase.java +++ b/yudao-module-llm/yudao-module-llm-biz/src/main/java/cn/iocoder/yudao/module/llm/service/async/AsyncKnowledgeBase.java @@ -62,13 +62,13 @@ public class AsyncKnowledgeBase { int lastIndex = knowledge.getDocumentName().lastIndexOf("."); if (lastIndex != -1) { - ragHttpService.embedUploadFile(regUploadReqVO); -// String extension = knowledge.getDocumentName().substring(lastIndex + 1).toLowerCase(); -// if ("txt".equals(extension)) { -// ragHttpService.embedUploadFile(regUploadReqVO); -// } else { -// knowledgeEmbed(knowledge, knowledge.getKnowledgeBaseId()); -// } + + String extension = knowledge.getDocumentName().substring(lastIndex + 1).toLowerCase(); + if ("txt".equals(extension)) { + ragHttpService.embedUploadFile(regUploadReqVO); + } else { + knowledgeEmbed(knowledge, knowledge.getKnowledgeBaseId()); + } } } catch (Exception e) { log.error("the creation of the knowledge base error {}", e.getMessage());