-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #9 from flashvayne/develop
Develop
- Loading branch information
Showing
13 changed files
with
235 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
src/main/java/io/github/flashvayne/chatgpt/dto/image/ImageData.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package io.github.flashvayne.chatgpt.dto.image; | ||
|
||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
import lombok.Data; | ||
|
||
@Data | ||
public class ImageData { | ||
private String url; | ||
|
||
@JsonProperty("b64_json") | ||
private String b64Json; | ||
} |
17 changes: 17 additions & 0 deletions
17
src/main/java/io/github/flashvayne/chatgpt/dto/image/ImageFormat.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package io.github.flashvayne.chatgpt.dto.image; | ||
|
||
public enum ImageFormat { | ||
|
||
URL("url"),BASE64("b64_json"); | ||
|
||
private final String format; | ||
|
||
ImageFormat(String format){ | ||
this.format = format; | ||
} | ||
|
||
public String getFormat(){ | ||
return format; | ||
} | ||
|
||
} |
28 changes: 28 additions & 0 deletions
28
src/main/java/io/github/flashvayne/chatgpt/dto/image/ImageRequest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package io.github.flashvayne.chatgpt.dto.image; | ||
|
||
import com.fasterxml.jackson.annotation.JsonInclude; | ||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Data; | ||
import lombok.NoArgsConstructor; | ||
|
||
/** | ||
* ImageRequest is used to construct request body. | ||
* For descriptions of all fields, please refer to <a href="https://platform.openai.com/docs/api-reference/images/create">Create image</a> | ||
*/ | ||
@Data | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
@JsonInclude(JsonInclude.Include.NON_NULL) | ||
public class ImageRequest { | ||
|
||
private String prompt; | ||
private Integer n; | ||
private String size; | ||
|
||
@JsonProperty("response_format") | ||
private String responseFormat; | ||
|
||
private String user; | ||
|
||
} |
18 changes: 18 additions & 0 deletions
18
src/main/java/io/github/flashvayne/chatgpt/dto/image/ImageResponse.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package io.github.flashvayne.chatgpt.dto.image; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Data; | ||
import lombok.NoArgsConstructor; | ||
|
||
import java.util.Date; | ||
import java.util.List; | ||
|
||
@Data | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
public class ImageResponse { | ||
private Date created; | ||
|
||
private List<ImageData> data; | ||
|
||
} |
17 changes: 17 additions & 0 deletions
17
src/main/java/io/github/flashvayne/chatgpt/dto/image/ImageSize.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package io.github.flashvayne.chatgpt.dto.image; | ||
|
||
public enum ImageSize { | ||
|
||
SMALL("256x256"), MEDIUM("512x512"), LARGE("1024x1024"); | ||
|
||
private final String size; | ||
|
||
ImageSize(String size) { | ||
this.size = size; | ||
} | ||
|
||
public String getSize() { | ||
return size; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
src/main/java/io/github/flashvayne/chatgpt/property/ImageProperties.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package io.github.flashvayne.chatgpt.property; | ||
|
||
public class ImageProperties { | ||
|
||
private String url = "https://api.openai.com/v1/images/generations"; | ||
|
||
public String getUrl() { | ||
return url; | ||
} | ||
|
||
public void setUrl(String url) { | ||
this.url = url; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.