优化星尘逻辑

This commit is contained in:
wulin 2023-11-17 09:38:05 +08:00
parent 435c7d8187
commit 26c866695e

View File

@ -87,6 +87,7 @@ public class AliYunXingChen {
response.blockingForEach(m -> { response.blockingForEach(m -> {
String v = m.getChoices().get(0).getMessages().get(0).getContent().replaceAll(recordMessage.getMsg(), ""); String v = m.getChoices().get(0).getMessages().get(0).getContent().replaceAll(recordMessage.getMsg(), "");
onNext.sendMessage(v); onNext.sendMessage(v);
recordMessage.setMsg(m.getChoices().get(0).getMessages().get(0).getContent());
if("stop".equals(m.getChoices().get(0).getStopReason())){ if("stop".equals(m.getChoices().get(0).getStopReason())){
// //
@ -94,6 +95,7 @@ public class AliYunXingChen {
.role(m.getChoices().get(0).getMessages().get(0).getRole()) .role(m.getChoices().get(0).getMessages().get(0).getRole())
.content(m.getChoices().get(0).getMessages().get(0).getContent()) .content(m.getChoices().get(0).getMessages().get(0).getContent())
.build(); .build();
qwenReplyResponse.setResut(message1.getContent());
addMessage(message1); addMessage(message1);
onNext.finish(); onNext.finish();
} }