Skip to content

Commit 297ad5e

Browse files
committed
Fixed code bugs
1 parent 79a929a commit 297ad5e

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/main/java/org/devlive/sdk/openai/entity/ImageEntity.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
import org.devlive.sdk.openai.model.ImageFormatModel;
1515
import org.devlive.sdk.openai.model.ImageSizeModel;
1616

17+
import java.util.Arrays;
18+
1719
@Data
1820
@Builder
1921
@ToString
@@ -108,7 +110,7 @@ public ImageEntityBuilder size(ImageSizeModel size)
108110
{
109111
Object instance = EnumUtils.getEnum(ImageSizeModel.class, size.name());
110112
if (ObjectUtils.isEmpty(instance)) {
111-
throw new ParamException(String.format("Invalid size: %s , Must be one of %s", size, ImageSizeModel.values()));
113+
throw new ParamException(String.format("Invalid size: %s , Must be one of %s", size, Arrays.toString(ImageSizeModel.values())));
112114
}
113115
this.size = size.getName();
114116
return this;
@@ -118,7 +120,7 @@ public ImageEntityBuilder format(ImageFormatModel format)
118120
{
119121
Object instance = EnumUtils.getEnum(ImageFormatModel.class, format.name());
120122
if (ObjectUtils.isEmpty(instance)) {
121-
throw new ParamException(String.format("Invalid format: %s , Must be one of %s", format, ImageFormatModel.values()));
123+
throw new ParamException(String.format("Invalid format: %s , Must be one of %s", format, Arrays.toString(ImageFormatModel.values())));
122124
}
123125
this.format = format.name();
124126
return this;

src/main/java/org/devlive/sdk/openai/utils/MultipartBodyUtils.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
public class MultipartBodyUtils
1010
{
11-
public final static MediaType TYPE = MediaType.parse("multipart/form-data");
11+
public static final MediaType TYPE = MediaType.parse("multipart/form-data");
1212

1313
private MultipartBodyUtils()
1414
{

0 commit comments

Comments
 (0)