|
|
|
@ -137,7 +137,9 @@ public class InteractiveServiceImpl implements IInteractiveService {
|
|
|
|
|
Assert.isTrue(response.getStatus() == HttpServletResponse.SC_OK, () -> { |
|
|
|
|
throw new ServiceException("远程调用大模型【获取问题答案】接口失败!"); |
|
|
|
|
}); |
|
|
|
|
JSONArray.parseArray(response.body(),AnswerVO.class).forEach(answerVO -> { |
|
|
|
|
|
|
|
|
|
List<AnswerVO> result = JSONArray.parseArray(response.body(), AnswerVO.class); |
|
|
|
|
result.stream().filter(answerVO -> answerVO.getRunning() == 0).forEach(answerVO -> { |
|
|
|
|
String[] extras = answerVO.getExtra(); |
|
|
|
|
if(ObjectUtil.isEmpty(answerVO.getExtra()) || extras.length == 0){ |
|
|
|
|
return; |
|
|
|
@ -145,7 +147,7 @@ public class InteractiveServiceImpl implements IInteractiveService {
|
|
|
|
|
List<String> extraList = Arrays.stream(extras).map(extraResolveStrategyService::resolve).map(JSON::toJSONString).collect(Collectors.toList()); |
|
|
|
|
answerVO.setExtra(extraList.toArray(new String[extraList.size()])); |
|
|
|
|
}); |
|
|
|
|
return JSONArray.parseArray(response.body(),AnswerVO.class); |
|
|
|
|
return result; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|