Browse Source

fix:多结果分析,智谱模型分析失败

zhongwei
luyie 2 months ago
parent
commit
51e43f5762
  1. 6
      hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/zhipuai/service/impl/ZhipuAnalysisServiceImpl.java

6
hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/zhipuai/service/impl/ZhipuAnalysisServiceImpl.java

@ -112,6 +112,7 @@ public class ZhipuAnalysisServiceImpl implements ZhipuAnalysisService {
}
public String getBase64FromUrl(String url) {
log.info("get base64 from url ,url : {}", url);
String base64 = null;
try {
base64 = FileUtil.getBase64(FileUtil.getUrlByteByRequest(url));
@ -147,7 +148,8 @@ public class ZhipuAnalysisServiceImpl implements ZhipuAnalysisService {
Assert.isTrue(CollectionUtil.isNotEmpty(request.getCodeList()) || CollectionUtil.isNotEmpty(request.getCheckTypeSonList()), () -> {
throw ErrorCode.EMPTY_ANALYSIS_TYPE.throwException();
});
List<ZhipuAnalysisInfoEntity> infoList = infoService.list(Wrappers.<ZhipuAnalysisInfoEntity>lambdaQuery().in(CollectionUtil.isNotEmpty(request.getCodeList()), ZhipuAnalysisInfoEntity::getCode, request.getCodeList())
List<ZhipuAnalysisInfoEntity> infoList = infoService.list(Wrappers.<ZhipuAnalysisInfoEntity>lambdaQuery()
.in(CollectionUtil.isNotEmpty(request.getCodeList()), ZhipuAnalysisInfoEntity::getCode, request.getCodeList())
.in(CollectionUtil.isNotEmpty(request.getCheckTypeSonList()), ZhipuAnalysisInfoEntity::getCheckTypeSon, request.getCheckTypeSonList()));
Assert.isTrue(CollectionUtil.isNotEmpty(infoList), () -> {
throw ErrorCode.UNKNOWN_ANALYSIS_TYPE.throwException();
@ -211,7 +213,7 @@ public class ZhipuAnalysisServiceImpl implements ZhipuAnalysisService {
formatBuilder.append("{");
for (int index = 1; index <= infoList.size(); index++) {
ZhipuAnalysisInfoEntity infoEntity = infoList.get(index - 1);
stringBuilder.append(StringUtil.format(MULTI_QUESTION_PREFIX, index));
stringBuilder.append(StringUtil.format(MULTI_QUESTION_PREFIX, index)).append(infoEntity.getRequestContent());
titleBuilder.append(StringUtil.format(MULTI_QUESTION_CONSTRAINS_LIST, infoEntity.getResultKey(), index));
formatBuilder.append(infoEntity.getRequestOutputFormat()).append(",");
}

Loading…
Cancel
Save