fix: 调整excel文件分段策略
This commit is contained in:
parent
60cb1eef62
commit
fe51278f14
|
|
@ -13,6 +13,7 @@ import org.springframework.web.multipart.MultipartFile;
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@Service
|
@Service
|
||||||
|
|
@ -30,7 +31,7 @@ public class WorkFlowServiceImpl implements WorkFlowService {
|
||||||
//1.上传文件
|
//1.上传文件
|
||||||
FileUploadRequest fileUploadRequest = new FileUploadRequest();
|
FileUploadRequest fileUploadRequest = new FileUploadRequest();
|
||||||
fileUploadRequest.setFile(file);
|
fileUploadRequest.setFile(file);
|
||||||
fileUploadRequest.setUserId(userId);
|
fileUploadRequest.setUserId(UUID.randomUUID().toString());
|
||||||
fileUploadRequest.setApiKey(apiKey);
|
fileUploadRequest.setApiKey(apiKey);
|
||||||
|
|
||||||
FileUploadResponse fileUploadResponse = difyChatService.fileUpload(fileUploadRequest);
|
FileUploadResponse fileUploadResponse = difyChatService.fileUpload(fileUploadRequest);
|
||||||
|
|
@ -49,6 +50,8 @@ public class WorkFlowServiceImpl implements WorkFlowService {
|
||||||
inputMap.put("files",filesMap);
|
inputMap.put("files",filesMap);
|
||||||
workflowRunRequest.setInputs(inputMap);
|
workflowRunRequest.setInputs(inputMap);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
WorkflowRunResponse workflowRunResponse = workflow.runWorkflow(workflowRunRequest);
|
WorkflowRunResponse workflowRunResponse = workflow.runWorkflow(workflowRunRequest);
|
||||||
log.info("一事一流程工作流运行成功,工作流id:{}",workflowRunResponse.getData());
|
log.info("一事一流程工作流运行成功,工作流id:{}",workflowRunResponse.getData());
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -17,10 +17,10 @@ public class ExcelDocumentStrategy implements IDocumentStrategy {
|
||||||
public void execute(DocUploadReq request, MultipartFile file) {
|
public void execute(DocUploadReq request, MultipartFile file) {
|
||||||
// Excel文件的特殊处理逻辑
|
// Excel文件的特殊处理逻辑
|
||||||
request.getDocAnalysisStrategy().setParentSegmentMode("paragraph");
|
request.getDocAnalysisStrategy().setParentSegmentMode("paragraph");
|
||||||
|
request.getDocAnalysisStrategy().setDocForm("text_model");
|
||||||
|
request.getDocAnalysisStrategy().setSegmentationMode("custom");
|
||||||
request.getDocAnalysisStrategy().setSegmentSeparator("$$");
|
request.getDocAnalysisStrategy().setSegmentSeparator("$$");
|
||||||
request.getDocAnalysisStrategy().setMaxLength(4000);
|
request.getDocAnalysisStrategy().setMaxLength(4000);
|
||||||
request.getDocAnalysisStrategy().setChildSegmentSeparator("/n");
|
|
||||||
request.getDocAnalysisStrategy().setChildMaxLength(512);
|
|
||||||
log.info("Excel文件处理完成,设置特定参数");
|
log.info("Excel文件处理完成,设置特定参数");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue