Commit daf78dda authored by 陈立彬's avatar 陈立彬

fix答案重复

parent c8b7e1de
......@@ -1579,7 +1579,7 @@ public class AppExamineService {
param.put("conversation_id", "");
param.put("user", userId);
final StringBuffer answerBuffer = new StringBuffer();
final String[] standardAnswer = new String[1];
final StringBuffer replyBuffer = new StringBuffer();
final String[] score = new String[1];
return webClient.post().uri("/chat-messages").accept(MediaType.TEXT_EVENT_STREAM).bodyValue(param.toJSONString()).exchangeToFlux(r -> r.bodyToFlux(String.class))
......@@ -1598,14 +1598,14 @@ public class AppExamineService {
Pattern answerPattern = Pattern.compile("\"answer\":\"([^\"]*)");
Matcher answerMatcher = answerPattern.matcher(replyBuffer.toString());
if (answerMatcher.find()) {
answerBuffer.append(answerMatcher.group(1));
standardAnswer[0] = answerMatcher.group(1);
}
}
SubmitAnswerStreamResultDto result = new SubmitAnswerStreamResultDto();
if(StringUtils.isNotEmpty(score[0])) {
result.setScore(Float.valueOf(score[0]));
}
result.setAnswer(answerBuffer.toString());
result.setAnswer(standardAnswer[0]);
return result;
}).doOnComplete(
() -> {
......
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