提交 ff305cbb 作者: 洪东保

代码优化 pom更新

父级 d05bc8a0
...@@ -351,7 +351,7 @@ ...@@ -351,7 +351,7 @@
<dependency> <dependency>
<groupId>cn.chatbot</groupId> <groupId>cn.chatbot</groupId>
<artifactId>meetingLLM</artifactId> <artifactId>meetingLLM</artifactId>
<version>1.0.0</version> <version>1.0.6</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.util</groupId> <groupId>com.util</groupId>
......
...@@ -2,6 +2,7 @@ package com.cmeeting.job; ...@@ -2,6 +2,7 @@ package com.cmeeting.job;
import cn.hutool.core.collection.CollUtil; import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.thread.ThreadUtil; import cn.hutool.core.thread.ThreadUtil;
import cn.hutool.core.util.StrUtil;
import com.azure.core.credential.AccessToken; import com.azure.core.credential.AccessToken;
import com.azure.core.credential.TokenRequestContext; import com.azure.core.credential.TokenRequestContext;
import com.azure.identity.ClientSecretCredential; import com.azure.identity.ClientSecretCredential;
...@@ -338,10 +339,12 @@ public class CmeetingJob { ...@@ -338,10 +339,12 @@ public class CmeetingJob {
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd"); SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
SimpleDateFormat simpleDateFormat1 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); SimpleDateFormat simpleDateFormat1 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
List<SysUserSyncCategory> tree = sysUserSyncService.getTreeList();
Map<String, String> treeCollect = tree.stream().collect(Collectors.toMap(SysUserSyncCategory::getDeptId, SysUserSyncCategory::getPath));
try { try {
boolean b = meetingInfoService.statisticsEmail(subject, simpleDateFormat1.parse(simpleDateFormat.format(date) + " 00:00:00"), boolean b = meetingInfoService.statisticsEmail(subject, simpleDateFormat1.parse(simpleDateFormat.format(date) + " 00:00:00"),
simpleDateFormat1.parse(simpleDateFormat.format(date) + " 23:59:59"), new FileOutputStream(file), DeptCollect.DEPT_MAP); simpleDateFormat1.parse(simpleDateFormat.format(date) + " 23:59:59"), new FileOutputStream(file), treeCollect);
if (b) { if (b) {
content = "<p data-olk-copy-source=\\\"MessageBody\\\">Dear all:<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;附件为今天Cmeeting会议纪要生成和发送情况,烦请查收。</p>"; content = "<p data-olk-copy-source=\\\"MessageBody\\\">Dear all:<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;附件为今天Cmeeting会议纪要生成和发送情况,烦请查收。</p>";
StatisticsEmailPush.Attachment attachment = new StatisticsEmailPush.Attachment(); StatisticsEmailPush.Attachment attachment = new StatisticsEmailPush.Attachment();
......
...@@ -82,6 +82,7 @@ public class FileProcessTask { ...@@ -82,6 +82,7 @@ public class FileProcessTask {
private String llmApiAddr; private String llmApiAddr;
private String llmModel; private String llmModel;
private String llmBackModel;
private String llmToken; private String llmToken;
private Integer llmMaxTokens; private Integer llmMaxTokens;
private Boolean finalRetry; //表示是兜底重试机制 private Boolean finalRetry; //表示是兜底重试机制
...@@ -178,12 +179,16 @@ public class FileProcessTask { ...@@ -178,12 +179,16 @@ public class FileProcessTask {
String processedResult = null; String processedResult = null;
//暂时让所有模板共用一个提示词,两个模板输出同样的结果 //暂时让所有模板共用一个提示词,两个模板输出同样的结果
LLMResult llmResult = processWithClaude(recordTextBuffer.toString(), meetingDate, participantNames, template.getPrompt()); LLMResult llmResult = processWithClaude(recordTextBuffer.toString(), meetingDate, participantNames, template.getPrompt());
log.info("模型生成纪要结果:"+llmResult.success);
if (llmResult.success) { if (llmResult.success) {
processedResult = llmResult.respond; processedResult = llmResult.respond;
} else if (llmResult.reason.equals("会议记录 过短,退出")) { } else if (llmResult.reason.equals("会议记录 过短,退出")) {
status = MeetingState.EMPTY.getCode(); status = MeetingState.EMPTY.getCode();
throw new RuntimeException("会议记录 过短,退出"); throw new RuntimeException("会议记录 过短,退出");
} }
if (processedResult == null) {
throw new RuntimeException("会议记录生成失败");
}
log.info("meetingRecordId: {},结果长度:{}", meetingRecordId, processedResult.length()); log.info("meetingRecordId: {},结果长度:{}", meetingRecordId, processedResult.length());
String minutesPath = saveResult(processedResult, recordTextBuffer.toString(), meetingInfo, toUserCode, template); String minutesPath = saveResult(processedResult, recordTextBuffer.toString(), meetingInfo, toUserCode, template);
...@@ -316,9 +321,10 @@ public class FileProcessTask { ...@@ -316,9 +321,10 @@ public class FileProcessTask {
// //将文件传送给大模型处理 // //将文件传送给大模型处理
LLMConfig baseLLM = new LLMConfig(llmModel, LLMConfig baseLLM = new LLMConfig(llmModel,
llmApiAddr, llmApiAddr,
"Bearer " + llmToken, llmToken,
llmMaxTokens); llmMaxTokens);
LLMResult llmResult = MeetingProcess.processMeeting(prompt, textContent,meetingDate,participantNames, baseLLM, new ArrayList<>()); LLMConfig backLLM = new LLMConfig(llmBackModel, llmApiAddr, llmToken, llmMaxTokens);
LLMResult llmResult = MeetingProcess.processMeeting(prompt, textContent,meetingDate,participantNames, baseLLM, Collections.singletonList(backLLM));
return llmResult; return llmResult;
// if (llmResult.success) { // if (llmResult.success) {
// return llmResult.respond; // return llmResult.respond;
...@@ -563,7 +569,7 @@ public class FileProcessTask { ...@@ -563,7 +569,7 @@ public class FileProcessTask {
public FileProcessTask(List<String> recordFileIdList, String meetingRecordId, String meetingId, String subMeetingId, String savePath, Map<String, Object> metadata, public FileProcessTask(List<String> recordFileIdList, String meetingRecordId, String meetingId, String subMeetingId, String savePath, Map<String, Object> metadata,
MeetingInfoMapper meetingInfoMapper, MinioUtils minioUtils, RedisUtils redisUtils, EmailSender emailSender, MeetingInfoMapper meetingInfoMapper, MinioUtils minioUtils, RedisUtils redisUtils, EmailSender emailSender,
MeetingRecordTemplateMapper meetingRecordTemplateMapper, MeetingRecordTemplateService meetingRecordTemplateService, MeetTypeService meetTypeService, UserIdMapper userIdMapper, MeetingRecordTemplateMapper meetingRecordTemplateMapper, MeetingRecordTemplateService meetingRecordTemplateService, MeetTypeService meetTypeService, UserIdMapper userIdMapper,
String llmApiAddr, String llmModel, String llmToken, Integer llmMaxTokens, Boolean finalRetry, ProcessLogService processLogService, List<UserDTO.TemplateAuthorizedUserDTO> authorizedUsers, Map<String, String> tidWidRelations, String llmApiAddr, String llmModel, String llmBackModel, String llmToken, Integer llmMaxTokens, Boolean finalRetry, ProcessLogService processLogService, List<UserDTO.TemplateAuthorizedUserDTO> authorizedUsers, Map<String, String> tidWidRelations,
UserAdminConfig userAdminConfig, String applicationId, String fileDownloadPath, String permTenantId, UserAdminConfig userAdminConfig, String applicationId, String fileDownloadPath, String permTenantId,
String aesKey) { String aesKey) {
this.recordFileIdList = recordFileIdList; this.recordFileIdList = recordFileIdList;
...@@ -582,6 +588,7 @@ public class FileProcessTask { ...@@ -582,6 +588,7 @@ public class FileProcessTask {
this.userIdMapper = userIdMapper; this.userIdMapper = userIdMapper;
this.llmApiAddr = llmApiAddr; this.llmApiAddr = llmApiAddr;
this.llmModel = llmModel; this.llmModel = llmModel;
this.llmBackModel = llmBackModel;
this.llmToken = llmToken; this.llmToken = llmToken;
this.llmMaxTokens = llmMaxTokens; this.llmMaxTokens = llmMaxTokens;
this.finalRetry = finalRetry; this.finalRetry = finalRetry;
......
...@@ -42,6 +42,9 @@ public class FileProcessProducer { ...@@ -42,6 +42,9 @@ public class FileProcessProducer {
private String llmApiAddr; private String llmApiAddr;
@Value(value = "${llm.api-model}") @Value(value = "${llm.api-model}")
private String llmModel; private String llmModel;
@Value(value = "${llm.api-back-model}")
private String llmBackModel;
@Value(value = "${llm.api-token}") @Value(value = "${llm.api-token}")
private String llmToken; private String llmToken;
@Value(value = "${llm.api-max-tokens}") @Value(value = "${llm.api-max-tokens}")
...@@ -107,6 +110,7 @@ public class FileProcessProducer { ...@@ -107,6 +110,7 @@ public class FileProcessProducer {
userIdMapper, userIdMapper,
llmApiAddr, llmApiAddr,
llmModel, llmModel,
llmBackModel,
llmToken, llmToken,
llmMaxTokens, llmMaxTokens,
finalRetry, finalRetry,
......
...@@ -14,7 +14,8 @@ REDIS_DATABASE: 3 ...@@ -14,7 +14,8 @@ REDIS_DATABASE: 3
############################################################## llm ############################################################## llm
# local # local
LLM_API_ADDR: https://dashscope.aliyuncs.com/compatible-mode/v1/chat/completions LLM_API_ADDR: https://dashscope.aliyuncs.com/compatible-mode/v1/chat/completions
LLM_API_MODEL: qwen-plus LLM_API_MODEL: qwen3.5-plus
LLM_BACK_API_MODEL: qwen3-max
LLM_API_TOKEN: sk-58046ac63cae4317b65fb151965169d1 LLM_API_TOKEN: sk-58046ac63cae4317b65fb151965169d1
LLM_API_MAX_TOKENS: 16000 LLM_API_MAX_TOKENS: 16000
...@@ -117,6 +118,7 @@ email: ...@@ -117,6 +118,7 @@ email:
llm: llm:
api-addr: ${LLM_API_ADDR} api-addr: ${LLM_API_ADDR}
api-model: ${LLM_API_MODEL} api-model: ${LLM_API_MODEL}
api-back-model: ${LLM_BACK_API_MODEL}
api-token: ${LLM_API_TOKEN} api-token: ${LLM_API_TOKEN}
api-max-tokens: ${LLM_API_MAX_TOKENS} api-max-tokens: ${LLM_API_MAX_TOKENS}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论