|
|
@@ -202,12 +202,29 @@ public class ALiYunServiceImpl implements ALiYunService {
|
|
|
.messages(Arrays.asList(systemMessage, userMessage))
|
|
|
.build();
|
|
|
MultiModalConversationResult result = conv.call(param);
|
|
|
- return JSONUtil.toList(String.valueOf(result.getOutput().getChoices().get(0).getMessage().getContent().get(0).get("text")), WxDoctorClinicRoomThumbnailVO.class);
|
|
|
+ String jsonResponse =String.valueOf(result.getOutput().getChoices().get(0).getMessage().getContent().get(0).get("text"));
|
|
|
+ String cleanedJson = cleanMarkdownJson(jsonResponse);
|
|
|
+ ObjectMapper objectMapper = new ObjectMapper();
|
|
|
+ if (cleanedJson.trim().startsWith("[")) {
|
|
|
+ List<Map<String, Object>> patientList = objectMapper.readValue(
|
|
|
+ cleanedJson,
|
|
|
+ new TypeReference<List<Map<String, Object>>>() {}
|
|
|
+ );
|
|
|
+ if(CollectionUtil.isNotEmpty(patientList)){
|
|
|
+ return patientList.stream()
|
|
|
+ .map(info ->
|
|
|
+ JSONUtil.toBean(JSONUtil.toJsonStr(info), WxDoctorClinicRoomThumbnailVO.class)
|
|
|
+ )
|
|
|
+ .filter(info-> StrUtil.isNotEmpty(info.getPatientCode()))
|
|
|
+ .collect(Collectors.toList());
|
|
|
+ }
|
|
|
+ }
|
|
|
}finally {
|
|
|
if (ObjectUtil.isNotNull(uploadResult)) {
|
|
|
fileService.remove(Arrays.asList(uploadResult.getId()));
|
|
|
}
|
|
|
}
|
|
|
+ return null;
|
|
|
}
|
|
|
|
|
|
/**
|