fix: knowledge base embedding

This commit is contained in:
moyangzhan 2024-03-22 00:18:34 +08:00
parent 219132961d
commit 92c339c222
1 changed files with 5 additions and 0 deletions

View File

@ -116,6 +116,11 @@ public class KnowledgeBaseItemService extends ServiceImpl<KnowledgeBaseItemMappe
metadata.add("kb_item_uuid", kbItem.getUuid()); metadata.add("kb_item_uuid", kbItem.getUuid());
Document document = new Document(kbItem.getRemark(), metadata); Document document = new Document(kbItem.getRemark(), metadata);
ragService.ingest(document); ragService.ingest(document);
ChainWrappers.lambdaUpdateChain(baseMapper)
.eq(KnowledgeBaseItem::getId, kbItem.getId())
.set(KnowledgeBaseItem::getIsEmbedded, true)
.update();
return true; return true;
} }