提交 ff305cbb 作者: 洪东保

代码优化 pom更新

父级 d05bc8a0
......@@ -351,7 +351,7 @@
<dependency>
<groupId>cn.chatbot</groupId>
<artifactId>meetingLLM</artifactId>
<version>1.0.0</version>
<version>1.0.6</version>
</dependency>
<dependency>
<groupId>com.util</groupId>
......
......@@ -2,6 +2,7 @@ package com.cmeeting.job;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.thread.ThreadUtil;
import cn.hutool.core.util.StrUtil;
import com.azure.core.credential.AccessToken;
import com.azure.core.credential.TokenRequestContext;
import com.azure.identity.ClientSecretCredential;
......@@ -338,10 +339,12 @@ public class CmeetingJob {
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
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 {
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) {
content = "<p data-olk-copy-source=\\\"MessageBody\\\">Dear all:<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;附件为今天Cmeeting会议纪要生成和发送情况,烦请查收。</p>";
StatisticsEmailPush.Attachment attachment = new StatisticsEmailPush.Attachment();
......
......@@ -82,6 +82,7 @@ public class FileProcessTask {
private String llmApiAddr;
private String llmModel;
private String llmBackModel;
private String llmToken;
private Integer llmMaxTokens;
private Boolean finalRetry; //表示是兜底重试机制
......@@ -178,12 +179,16 @@ public class FileProcessTask {
String processedResult = null;
//暂时让所有模板共用一个提示词,两个模板输出同样的结果
LLMResult llmResult = processWithClaude(recordTextBuffer.toString(), meetingDate, participantNames, template.getPrompt());
log.info("模型生成纪要结果:"+llmResult.success);
if (llmResult.success) {
processedResult = llmResult.respond;
} else if (llmResult.reason.equals("会议记录 过短,退出")) {
status = MeetingState.EMPTY.getCode();
throw new RuntimeException("会议记录 过短,退出");
}
if (processedResult == null) {
throw new RuntimeException("会议记录生成失败");
}
log.info("meetingRecordId: {},结果长度:{}", meetingRecordId, processedResult.length());
String minutesPath = saveResult(processedResult, recordTextBuffer.toString(), meetingInfo, toUserCode, template);
......@@ -316,9 +321,10 @@ public class FileProcessTask {
// //将文件传送给大模型处理
LLMConfig baseLLM = new LLMConfig(llmModel,
llmApiAddr,
"Bearer " + llmToken,
llmToken,
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;
// if (llmResult.success) {
// return llmResult.respond;
......@@ -563,7 +569,7 @@ public class FileProcessTask {
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,
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,
String aesKey) {
this.recordFileIdList = recordFileIdList;
......@@ -582,6 +588,7 @@ public class FileProcessTask {
this.userIdMapper = userIdMapper;
this.llmApiAddr = llmApiAddr;
this.llmModel = llmModel;
this.llmBackModel = llmBackModel;
this.llmToken = llmToken;
this.llmMaxTokens = llmMaxTokens;
this.finalRetry = finalRetry;
......
......@@ -42,6 +42,9 @@ public class FileProcessProducer {
private String llmApiAddr;
@Value(value = "${llm.api-model}")
private String llmModel;
@Value(value = "${llm.api-back-model}")
private String llmBackModel;
@Value(value = "${llm.api-token}")
private String llmToken;
@Value(value = "${llm.api-max-tokens}")
......@@ -107,6 +110,7 @@ public class FileProcessProducer {
userIdMapper,
llmApiAddr,
llmModel,
llmBackModel,
llmToken,
llmMaxTokens,
finalRetry,
......
......@@ -14,7 +14,8 @@ REDIS_DATABASE: 3
############################################################## llm
# local
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_MAX_TOKENS: 16000
......@@ -117,6 +118,7 @@ email:
llm:
api-addr: ${LLM_API_ADDR}
api-model: ${LLM_API_MODEL}
api-back-model: ${LLM_BACK_API_MODEL}
api-token: ${LLM_API_TOKEN}
api-max-tokens: ${LLM_API_MAX_TOKENS}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论