Commit de2b3b52 by 陈健智

AI推荐提问修复2

parent c0251fd5
......@@ -4086,12 +4086,19 @@ public class MarkDataServiceImpl implements MarkDataService {
calculateCost(pair.getRight(), AccessModel.Model.DOUBAO_PRO_32K)), userLogRecordDao.generateCollectionName());
String resultContent = pair.getLeft();
String[] splits = resultContent.split("\\|");
Pattern pattern = Pattern.compile("^\\d+、");
List<String> result = new ArrayList<>(Arrays.asList(splits)).stream().filter(StringUtils::isNoneBlank).map(String::trim)
.map(str -> pattern.matcher(str).replaceFirst(""))
.limit(5).collect(Collectors.toList());
redisUtil.setExpire(key, JSONObject.toJSONString(result));
return result;
List<String> res = new ArrayList<>();
for (int i = 0; i < result.size(); i++) {
if (result.get(i).startsWith(i + 1 + "、") || result.get(i).startsWith(i + 1 + ".")){
String substring = result.get(i).substring(2);
res.add(substring);
}else {
res.add(result.get(i));
}
}
redisUtil.setExpire(key, JSONObject.toJSONString(res));
return res;
}
private List<String> getAIReferenceQuestionTemplate(String projectName){
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment