【新增】增加open ai image 模型类型

This commit is contained in:
cherishsince 2024-04-28 14:38:07 +08:00
parent ca0024988c
commit 7d3ed1fef3

View File

@ -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);
}
}