diff --git a/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/cn/iocoder/yudao/framework/ai/imageopenai/OpenAiImageModelEnum.java b/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/cn/iocoder/yudao/framework/ai/imageopenai/OpenAiImageModelEnum.java new file mode 100644 index 000000000..919dd11d6 --- /dev/null +++ b/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/cn/iocoder/yudao/framework/ai/imageopenai/OpenAiImageModelEnum.java @@ -0,0 +1,35 @@ +package cn.iocoder.yudao.framework.ai.imageopenai; + +import lombok.AllArgsConstructor; +import lombok.Getter; + +/** + * open ai + * + * @author fansili + * @time 2024/4/28 14:21 + * @since 1.0 + */ +@AllArgsConstructor +@Getter +public enum OpenAiImageModelEnum { + + DALL_E_2("dall-e-2", "dall-e-2"), + + DALL_E_3("dall-e-3", "dall-e-3") + + ; + + private String model; + + private String name; + + public static OpenAiImageModelEnum valueOfModel(String model) { + for (OpenAiImageModelEnum itemEnum : OpenAiImageModelEnum.values()) { + if (itemEnum.getModel().equals(model)) { + return itemEnum; + } + } + throw new IllegalArgumentException("Invalid MessageType value: " + model); + } +}