Commit bc927235 authored by 林洋洋's avatar 林洋洋

添加文件切片文件支持

parent 85a587a8
......@@ -361,11 +361,14 @@ public class KnowledgeDocumentServiceImpl extends ServiceImpl<KnowledgeDocumentM
List<DocumentSegmentResult> results = new ArrayList<>();
for (SysFile file : request.getFiles()) {
SliceStrategy sliceStrategy = SliceStrategy.CUSTOM;
if("pdf".equals(file.getType())){
sliceStrategy =SliceStrategy.PARAGRAPH;
}
// 读取文档内容 - 使用新的PDF切片函数
List<Document> segments = slicePdfDocument(
file.getBucketName(), file.getFileName(),
SliceStrategy.PARAGRAPH
sliceStrategy
);
if (segments.isEmpty()) {
log.warn("文档解析失败或内容为空: {}", file.getOriginal());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment