diff --git a/backend/src/main/java/ai/basic/x1/adapter/api/job/converter/ModelCocoRequestConverter.java b/backend/src/main/java/ai/basic/x1/adapter/api/job/converter/ModelCocoRequestConverter.java index c0f462cb..b808d8aa 100644 --- a/backend/src/main/java/ai/basic/x1/adapter/api/job/converter/ModelCocoRequestConverter.java +++ b/backend/src/main/java/ai/basic/x1/adapter/api/job/converter/ModelCocoRequestConverter.java @@ -7,6 +7,8 @@ import java.util.List; +import static ai.basic.x1.util.Constants.FILE; + /** * @author zhujh */ @@ -22,7 +24,13 @@ public static ImageDetectionReqDTO convert(ModelMessageBO message) { if (CollUtil.isEmpty(fileNodes)) { throw new IllegalArgumentException("file is not found"); } - String url = fileNodes.get(0).getFile().getInternalUrl(); + var fileNodeBO = fileNodes.get(0); + String url; + if (fileNodeBO.getType().equals(FILE)) { + url = fileNodeBO.getFile().getInternalUrl(); + } else { + url = fileNodeBO.getFiles().get(0).getFile().getInternalUrl(); + } if (StrUtil.isEmpty(url)) { throw new IllegalArgumentException("file url is empty"); }