From 7d3ed1fef37863419d75d33783d3a34717c0786e Mon Sep 17 00:00:00 2001 From: cherishsince Date: Sun, 28 Apr 2024 14:38:07 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E6=96=B0=E5=A2=9E=E3=80=91=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0open=20ai=20image=20=E6=A8=A1=E5=9E=8B=E7=B1=BB?= =?UTF-8?q?=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ai/imageopenai/OpenAiImageModelEnum.java | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/cn/iocoder/yudao/framework/ai/imageopenai/OpenAiImageModelEnum.java 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); + } +}