Commit 18aeb072a6187b09b9451f6a93d0bb342f38ebd3

Authored by cherishsince
1 parent db7315b8

【优化】buildImageOptions 支持千帆

yudao-module-ai/yudao-module-ai-biz/src/main/java/cn/iocoder/yudao/module/ai/service/image/AiImageServiceImpl.java
... ... @@ -31,6 +31,7 @@ import org.springframework.ai.image.ImageOptions;
31 31 import org.springframework.ai.image.ImagePrompt;
32 32 import org.springframework.ai.image.ImageResponse;
33 33 import org.springframework.ai.openai.OpenAiImageOptions;
  34 +import org.springframework.ai.qianfan.QianFanImageOptions;
34 35 import org.springframework.ai.stabilityai.api.StabilityAiImageOptions;
35 36 import org.springframework.scheduling.annotation.Async;
36 37 import org.springframework.stereotype.Service;
... ... @@ -142,6 +143,11 @@ public class AiImageServiceImpl implements AiImageService {
142 143 .withModel(draw.getModel()).withN(1)
143 144 .withHeight(draw.getHeight()).withWidth(draw.getWidth())
144 145 .build();
  146 + } else if (ObjUtil.equal(draw.getPlatform(), AiPlatformEnum.YI_YAN.getPlatform())) {
  147 + return QianFanImageOptions.builder()
  148 + .withModel(draw.getModel()).withN(1)
  149 + .withHeight(draw.getHeight()).withWidth(draw.getWidth())
  150 + .build();
145 151 }
146 152 throw new IllegalArgumentException("不支持的 AI 平台:" + draw.getPlatform());
147 153 }
... ...