mirror of
https://gitee.com/hhyykk/ipms-sjy.git
synced 2025-07-13 10:35:07 +08:00
【增加】image 对接 Chatglm 模型
This commit is contained in:
@ -28,6 +28,7 @@ public enum AiPlatformEnum {
|
||||
STABLE_DIFFUSION("StableDiffusion", "StableDiffusion"), // Stability AI
|
||||
MIDJOURNEY("Midjourney", "Midjourney"), // Midjourney
|
||||
SUNO("Suno", "Suno"), // Suno AI
|
||||
CHATGLM("ChatGlm", "ChatGlm"), // Suno AI
|
||||
|
||||
;
|
||||
|
||||
|
@ -9,6 +9,7 @@ import cn.hutool.extra.spring.SpringUtil;
|
||||
import cn.iocoder.yudao.framework.ai.config.YudaoAiAutoConfiguration;
|
||||
import cn.iocoder.yudao.framework.ai.config.YudaoAiProperties;
|
||||
import cn.iocoder.yudao.framework.ai.core.enums.AiPlatformEnum;
|
||||
import cn.iocoder.yudao.framework.ai.core.model.chatglm.ChatGlmImageModel;
|
||||
import cn.iocoder.yudao.framework.ai.core.model.deepseek.DeepSeekChatModel;
|
||||
import cn.iocoder.yudao.framework.ai.core.model.midjourney.api.MidjourneyApi;
|
||||
import cn.iocoder.yudao.framework.ai.core.model.suno.api.SunoApi;
|
||||
@ -139,6 +140,8 @@ public class AiModelFactoryImpl implements AiModelFactory {
|
||||
return buildOpenAiImageModel(apiKey, url);
|
||||
case STABLE_DIFFUSION:
|
||||
return buildStabilityAiImageModel(apiKey, url);
|
||||
case CHATGLM:
|
||||
return buildChatGlmModel(apiKey);
|
||||
default:
|
||||
throw new IllegalArgumentException(StrUtil.format("未知平台({})", platform));
|
||||
}
|
||||
@ -273,4 +276,7 @@ public class AiModelFactoryImpl implements AiModelFactory {
|
||||
return new StabilityAiImageModel(stabilityAiApi);
|
||||
}
|
||||
|
||||
private ChatGlmImageModel buildChatGlmModel(String apiKey) {
|
||||
return new ChatGlmImageModel(apiKey);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user