Commit 067fc5814784036dda04d04ff30aa5826249a01a
1 parent
2cbb6ac8
【优化】解决调用openai image 生成,user不能为空情况,固定设置UID 客户端
Showing
2 changed files
with
4 additions
and
4 deletions
yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/cn/iocoder/yudao/framework/ai/imageopenai/OpenAiImageOptions.java
| @@ -42,11 +42,11 @@ public class OpenAiImageOptions implements ImageOptions { | @@ -42,11 +42,11 @@ public class OpenAiImageOptions implements ImageOptions { | ||
| 42 | 42 | ||
| 43 | // 可选字段,默认为vivid | 43 | // 可选字段,默认为vivid |
| 44 | // 图像生成的风格。可为vivid(生动)或natural(自然)。vivid会使模型偏向生成超现实和戏剧性的图像,而natural则会让模型产出更自然、不那么超现实的图像。该参数仅对dall-e-3模型有效。 | 44 | // 图像生成的风格。可为vivid(生动)或natural(自然)。vivid会使模型偏向生成超现实和戏剧性的图像,而natural则会让模型产出更自然、不那么超现实的图像。该参数仅对dall-e-3模型有效。 |
| 45 | - private String style = "vivid"; | 45 | + private OpenAiImageStyleEnum style = OpenAiImageStyleEnum.VIVID; |
| 46 | 46 | ||
| 47 | // 可选字段 | 47 | // 可选字段 |
| 48 | // 代表您的终端用户的唯一标识符,有助于OpenAI监控并检测滥用行为。了解更多信息请参考官方文档。 | 48 | // 代表您的终端用户的唯一标识符,有助于OpenAI监控并检测滥用行为。了解更多信息请参考官方文档。 |
| 49 | - private String endUserId; | 49 | + private String endUserId = "UID123456"; |
| 50 | 50 | ||
| 51 | @Getter | 51 | @Getter |
| 52 | public enum ResponseFormatEnum { | 52 | public enum ResponseFormatEnum { |
yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/cn/iocoder/yudao/framework/ai/imageopenai/api/OpenAiImageRequest.java
| @@ -43,7 +43,7 @@ public class OpenAiImageRequest { | @@ -43,7 +43,7 @@ public class OpenAiImageRequest { | ||
| 43 | // 可选字段,默认为1024x1024 | 43 | // 可选字段,默认为1024x1024 |
| 44 | // 生成图像的尺寸大小。对于dall-e-2模型,尺寸可为256x256, 512x512, 或 1024x1024。对于dall-e-3模型,尺寸可为1024x1024, 1792x1024, 或 1024x1792。 | 44 | // 生成图像的尺寸大小。对于dall-e-2模型,尺寸可为256x256, 512x512, 或 1024x1024。对于dall-e-3模型,尺寸可为1024x1024, 1792x1024, 或 1024x1792。 |
| 45 | @JsonProperty("size") | 45 | @JsonProperty("size") |
| 46 | - private String imageSize = "1024x1024"; | 46 | + private String size = "1024x1024"; |
| 47 | 47 | ||
| 48 | // 可选字段,默认为vivid | 48 | // 可选字段,默认为vivid |
| 49 | // 图像生成的风格。可为vivid(生动)或natural(自然)。vivid会使模型偏向生成超现实和戏剧性的图像,而natural则会让模型产出更自然、不那么超现实的图像。该参数仅对dall-e-3模型有效。 | 49 | // 图像生成的风格。可为vivid(生动)或natural(自然)。vivid会使模型偏向生成超现实和戏剧性的图像,而natural则会让模型产出更自然、不那么超现实的图像。该参数仅对dall-e-3模型有效。 |
| @@ -53,6 +53,6 @@ public class OpenAiImageRequest { | @@ -53,6 +53,6 @@ public class OpenAiImageRequest { | ||
| 53 | // 可选字段 | 53 | // 可选字段 |
| 54 | // 代表您的终端用户的唯一标识符,有助于OpenAI监控并检测滥用行为。了解更多信息请参考官方文档。 | 54 | // 代表您的终端用户的唯一标识符,有助于OpenAI监控并检测滥用行为。了解更多信息请参考官方文档。 |
| 55 | @JsonProperty("user") | 55 | @JsonProperty("user") |
| 56 | - private String endUserId; | 56 | + private String endUserId = "UID123123"; |
| 57 | 57 | ||
| 58 | } | 58 | } |