mirror of
https://gitee.com/huangge1199_admin/vue-pro.git
synced 2025-01-19 03:30:06 +08:00
【增加】autoconfig自动配置 增加 style 适配。
This commit is contained in:
parent
7467c241f3
commit
330696fb90
@ -100,6 +100,7 @@ public class YudaoAiAutoConfiguration {
|
|||||||
new OpenAiImageOptions()
|
new OpenAiImageOptions()
|
||||||
.setModel(openAiImageProperties.getModel())
|
.setModel(openAiImageProperties.getModel())
|
||||||
.setResponseFormat(OpenAiImageOptions.ResponseFormatEnum.URL.getValue())
|
.setResponseFormat(OpenAiImageOptions.ResponseFormatEnum.URL.getValue())
|
||||||
|
.setStyle(openAiImageProperties.getStyle())
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -0,0 +1,36 @@
|
|||||||
|
package cn.iocoder.yudao.framework.ai.imageopenai;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Getter;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* open ai image style
|
||||||
|
*
|
||||||
|
* @author fansili
|
||||||
|
* @time 2024/4/28 16:15
|
||||||
|
* @since 1.0
|
||||||
|
*/
|
||||||
|
@AllArgsConstructor
|
||||||
|
@Getter
|
||||||
|
public enum OpenAiImageStyleEnum {
|
||||||
|
|
||||||
|
// 图像生成的风格。可为vivid(生动)或 natural(自然)。vivid会使模型偏向生成超现实和戏剧性的图像,而natural则会让模型产出更自然、不那么超现实的图像。该参数仅对dall-e-3模型有效。
|
||||||
|
|
||||||
|
VIVID("vivid", "生动"),
|
||||||
|
NATURAL("natural", "自然"),
|
||||||
|
|
||||||
|
;
|
||||||
|
|
||||||
|
private String style;
|
||||||
|
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
public static OpenAiImageStyleEnum valueOfStyle(String style) {
|
||||||
|
for (OpenAiImageStyleEnum itemEnum : OpenAiImageStyleEnum.values()) {
|
||||||
|
if (itemEnum.getStyle().equals(style)) {
|
||||||
|
return itemEnum;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
throw new IllegalArgumentException("Invalid MessageType value: " + style);
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user