TASK:LLM;

This commit is contained in:
shahaibo
2025-05-20 14:31:05 +08:00
parent f1adbb4da7
commit b030e9c09b

View File

@@ -152,33 +152,33 @@ public class LLMServiceImpl implements LLMService {
responseContentBuilder = new StringBuilder();
}
JSONObject toolsData = json.getJSONObject("tools_data");
ReceiveDesignParam receiveDesignParam = JSONObject.parseObject(JSONObject.toJSONString(toolsData), ReceiveDesignParam.class);
receiveDesignParam.setProjectId(projectId);
designService.receiveDesignParams(receiveDesignParam);
boolean color = true;
for (ReceiveCollectionElement receiveCollectionElement : receiveDesignParam.getReceiveCollectionElementList()) {
if (!StringUtils.isEmpty(receiveCollectionElement.getUrl())) {
color = false;
receiveCollectionElement.setMinioUrl(minioUtil.getPreSignedUrl(receiveCollectionElement.getUrl(), 24 * 60));
if (Objects.nonNull(toolsData)) {
boolean color = true;
ReceiveDesignParam receiveDesignParam = JSONObject.parseObject(JSONObject.toJSONString(toolsData), ReceiveDesignParam.class);
receiveDesignParam.setProjectId(projectId);
designService.receiveDesignParams(receiveDesignParam);
for (ReceiveCollectionElement receiveCollectionElement : receiveDesignParam.getReceiveCollectionElementList()) {
if (!StringUtils.isEmpty(receiveCollectionElement.getUrl())) {
color = false;
receiveCollectionElement.setMinioUrl(minioUtil.getPreSignedUrl(receiveCollectionElement.getUrl(), 24 * 60));
}
}
String jsonString = JSONObject.toJSONString(receiveDesignParam);
json.put("tools_data", jsonString);
ChatMessage systemImage = new ChatMessage();
systemImage.setRole("system");
if (color) {
systemImage.setIsImage(1);
}else {
systemImage.setIsImage(2);
}
systemImage.setProjectId(projectId);
systemImage.setSeq(getNextSeq(projectId));
systemImage.setCreateTime(LocalDateTime.now());
systemImage.setContent(JSONObject.toJSONString(receiveDesignParam.getReceiveCollectionElementList()));
systemImage.setAccountId(accountId);
chatMessageMapper.insert(systemImage);
}
String jsonString = JSONObject.toJSONString(receiveDesignParam);
json.put("tools_data", jsonString);
ChatMessage systemImage = new ChatMessage();
systemImage.setRole("system");
if (color) {
systemImage.setIsImage(1);
}else {
systemImage.setIsImage(2);
}
systemImage.setProjectId(projectId);
systemImage.setSeq(getNextSeq(projectId));
systemImage.setCreateTime(LocalDateTime.now());
systemImage.setContent(JSONObject.toJSONString(receiveDesignParam.getReceiveCollectionElementList()));
systemImage.setAccountId(accountId);
chatMessageMapper.insert(systemImage);
emitter.send(json.toJSONString());
}
}