TASK:LLM;

This commit is contained in:
shahaibo
2025-05-20 16:59:07 +08:00
parent 8c597db8a9
commit 9614985690
2 changed files with 4 additions and 4 deletions

View File

@@ -4393,8 +4393,8 @@ public class PythonService {
MediaType mediaType = MediaType.parse("application/json");
Map<String, Object> content = Maps.newHashMap();
content.put("prompt", prompt);
content.put("image_list", !CollectionUtils.isEmpty(imageUrlList) ? imageUrlList : null);
content.put("file_list", !StringUtils.isEmpty(fileUrl) ? Collections.singletonList(fileUrl) : null);
content.put("image_list", !CollectionUtils.isEmpty(imageUrlList) ? imageUrlList : new ArrayList<>());
content.put("file_list", !StringUtils.isEmpty(fileUrl) ? Collections.singletonList(fileUrl) : new ArrayList<>());
RequestBody body = RequestBody.create(mediaType, JSON.toJSONString(content));
log.info("getProjectParam 请求地址: {}", accessPythonIp + ":" + accessPythonPort + "/api/extraction_project_info");

View File

@@ -87,9 +87,9 @@ public class LLMServiceImpl implements LLMService {
JSONObject jsonBodyObject = new JSONObject();
jsonBodyObject.put("project_id", projectId.toString());
jsonBodyObject.put("role", "user");
jsonBodyObject.put("image", !CollectionUtils.isEmpty(imageUrlList) ? imageUrlList : null); // 可扩展
jsonBodyObject.put("image", !CollectionUtils.isEmpty(imageUrlList) ? imageUrlList : new ArrayList<>()); // 可扩展
// jsonBodyObject.put("image", ""); // 可扩展
jsonBodyObject.put("file", !StringUtils.isEmpty(fileUrl) ? Collections.singletonList(fileUrl) : null);
jsonBodyObject.put("file", !StringUtils.isEmpty(fileUrl) ? Collections.singletonList(fileUrl) : new ArrayList<>());
jsonBodyObject.put("message", prompt);
jsonBodyObject.put("enable_thinking", enableThinking);