-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathimages.go
52 lines (42 loc) · 1.14 KB
/
images.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
package openai
import "os"
const (
Dalle2 = "dall-e-2"
Dalle3 = "dall-e-3"
Size1024x1024 = "1024x1024"
Size1792x1024 = "1792x1024"
Size1024x1792 = "1024x1792"
VividStyle = "vivid"
NaturalStyle = "natural"
)
const (
imageGenUrl = "/v1/images/generations"
imageEditUrl = "/v1/images/edit"
imageVariationsUrl = "/v1/images/variations"
audioSpeechUrl = "/v1/audio/speech"
)
type ImageGenRequest struct {
Model string `json:"model"`
Prompt string `json:"prompt"`
Size string `json:"size"`
Amount int64 `json:"n,omitempty"`
Style string `json:"style,omitempty"`
//ResponseFormat string `json:"response_format,omitempty"`
}
type ImageGenResponse struct {
CreatedAt int64 `json:"created"`
Data []*ImageGenDataItem `json:"data"`
}
type ImageGenDataItem struct {
Url string `json:"url"`
RevisedPrompt string `json:"revised_prompt"`
B64Json string `json:"b64_json"`
}
type ImageEditRequest struct {
Image os.File `json:"image"`
Mask os.File `json:"mask"`
Model string `json:"model"`
Prompt string `json:"prompt"`
Amount int64 `json:"n"`
}
type ImageVariationRequest struct{}