提交 c2dffbfa 作者: 洪东保

Merge branch 'hongdongbao'

......@@ -176,8 +176,8 @@ public class RecordTemplateController {
@PostMapping("/testGenerate")
public R testGenerate(@RequestParam(value = "file",required = false) MultipartFile file,
@RequestParam(value = "meetingInstId",required = false) Integer meetingInstId,
@RequestParam("id") Integer id) {
return R.ok(recordTemplatePermissionService.testGenerate(file,meetingInstId,id));
@RequestParam("content") String content) {
return R.ok(recordTemplatePermissionService.testGenerate(file, meetingInstId, content));
}
/**
......
......@@ -13,7 +13,7 @@ public interface RecordTemplatePermissionService extends IService<RecordTemplate
List<RecordTemplateVO.PermissionItem> authList(RecordTemplateVO.TemplateAuthVO vo);
String testGenerate(MultipartFile file,Integer meetingInstId,Integer templateId);
String testGenerate(MultipartFile file,Integer meetingInstId,String content);
void testMinutesExport(String recordJson,Integer meetingInstId, Integer id, HttpServletResponse response);
}
......@@ -64,6 +64,8 @@ public class RecordTemplatePermissionServiceImpl extends ServiceImpl<RecordTempl
private MinioUtils minioUtils;
@Value(value = "${llm.api-addr}")
private String llmApiAddr;
@Value(value = "${llm.api-token}")
private String llmApiToken;
/**
* 授权
......@@ -145,28 +147,17 @@ public class RecordTemplatePermissionServiceImpl extends ServiceImpl<RecordTempl
* 模板测试效果
* @param file 用户自主上传的转录文件
* @param meetingInstId 历史会议主键id
* @param templateId 模板id
* @return
*/
@Override
public String testGenerate(MultipartFile file, Integer meetingInstId, Integer templateId) {
public String testGenerate(MultipartFile file, Integer meetingInstId, String prompt) {
if((file == null || file.isEmpty() || file.getSize() == 0) && meetingInstId == null){
throw new RobotBaseException("请提供转录文件");
}
if(templateId == null){
throw new RobotBaseException("请指定用于生成纪要的模板");
}
MeetingRecordTemplate template = recordTemplateService.getById(templateId);
if(template == null){
throw new RobotBaseException("纪要模板不存在!");
}
String prompt = template.getPrompt();
//纪要模板
String templateIndex = template.getTemplate();
String textContent;
String meetingDate = null;
String participantNames = null;
String host = null;
if(meetingInstId != null){
MeetingInfo meetingInfo = meetingInfoService.getById(meetingInstId);
if(meetingInfo == null) throw new RobotBaseException("历史会议不存在!");
......@@ -179,7 +170,6 @@ public class RecordTemplatePermissionServiceImpl extends ServiceImpl<RecordTempl
}
meetingDate = meetingInfo.getStartTime().toLocalDate().format(DateTimeFormatter.ofPattern("yyyy-MM-dd"));
participantNames = meetingInfo.getParticipantUsers();
host = meetingInfo.getHost();
}else{
try{
byte[] bytes = file.getBytes();
......@@ -192,9 +182,9 @@ public class RecordTemplatePermissionServiceImpl extends ServiceImpl<RecordTempl
String model = "arn:aws:bedrock:us-east-1:491822380689:inference-profile/us.anthropic.claude-3-7-sonnet-20250219-v1:0";
LLMConfig baseLLM = new LLMConfig(model,
llmApiAddr + "/llm/sse-invoke",
"Bearer AKIAXFAXF62IWJXGLVEE.LnKInaahcMZG9zLsGMH3nTLOw3S3lK5Vcu0+ifnO",
"Bearer " + llmApiToken,
20000);
LLMResult llmResult = MeetingProcess.processMeeting(prompt, textContent,meetingDate,participantNames, baseLLM, new ArrayList<>());
LLMResult llmResult = MeetingProcess.processMeeting(prompt, textContent, meetingDate, participantNames, baseLLM, new ArrayList<>());
DebugOutputTool.println(llmResult.respond);
//去除内容中除了xml内容以外其他的信息,格式化xml
......
......@@ -14,6 +14,7 @@ REDIS_DATABASE: 3
############################################################## llm
# local
LLM_API_ADDR: https://bedrock.chatbot.cn
LLM_API_TOKEN: AKIAXFAXF62IWJXGLVEE.LnKInaahcMZG9zLsGMH3nTLOw3S3lK5Vcu0+ifnO
# prod
TENCENT_APPID: 210468336
......@@ -115,6 +116,7 @@ email:
llm:
api-addr: ${LLM_API_ADDR}
api-token: ${LLM_API_TOKEN}
#解密key
aec:
......@@ -150,10 +152,4 @@ permission:
tenantId: ${PERMISSION_TENANT_ID}
admin-white_users: ${PERMISSION_ADMIN_WHITE_USERS}
#logging:
# level:
# com.cmeeting.mapper.primary: INFO
# com.cmeeting.mapper.secondary: INFO
# root: INFO
isDev: true
\ No newline at end of file
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论