1: 添加日志

pull/1/head
xueqingkun 11 months ago
parent dcb2297821
commit 376e29d923

@ -116,6 +116,7 @@ public class AskServiceImpl implements AskService {
TalkVideoTtsResultResVO talkVideoTtsResultResVO = new TalkVideoTtsResultResVO();
// 如果匹配度没有匹配到任何数据,则走大模型
if (ObjectUtil.isEmpty(qaSimilarityQuestionAnswer)) {
log.info("问题:{},未找到匹配的问题,走大模型回答", talkReqVO.getText());
String talk = aiService.talk(talkReqVO.getText(), medicalRec.getMedicalRecordAi());
talkVideoTtsResultResVO.setAnswerMessage(talk);
saveAiRecord(process.getId(), talkReqVO.getText(), talkVideoTtsResultResVO.getAnswerMessage());

@ -1,6 +1,7 @@
package com.supervision.util;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.http.HttpUtil;
import cn.hutool.json.JSONUtil;
import com.fasterxml.jackson.core.type.TypeReference;
@ -9,8 +10,10 @@ import com.supervision.exception.BusinessException;
import com.supervision.pojo.paddlespeech.req.TtsReqDTO;
import com.supervision.pojo.paddlespeech.res.PaddleSpeechResDTO;
import com.supervision.pojo.paddlespeech.res.TtsResultDTO;
import lombok.extern.slf4j.Slf4j;
import org.springframework.core.env.Environment;
@Slf4j
public class TtsUtil {
private static final String TTS_URL = SpringBeanUtil.getBean(Environment.class).getProperty("paddle-speech.tts");
@ -18,6 +21,11 @@ public class TtsUtil {
private static final ObjectMapper objectMapper = new ObjectMapper();
public static String ttsTransform(String str) {
if (StrUtil.isEmpty(str)){
log.info("ttsTransform: str is empty");
return null;
}
// 构建
String post = HttpUtil.post(TTS_URL, JSONUtil.toJsonStr(new TtsReqDTO(str)));
try {

Loading…
Cancel
Save