Skip to content

Commit 09f6920

Browse files
HongminHanHanHongmin
and
HanHongmin
authored
fixed #594 (#609)
APITypeAzure dall-e3 model url Co-authored-by: HanHongmin <[email protected]>
1 parent e01a2d7 commit 09f6920

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

image.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ type ImageEditRequest struct {
8282
Image *os.File `json:"image,omitempty"`
8383
Mask *os.File `json:"mask,omitempty"`
8484
Prompt string `json:"prompt,omitempty"`
85+
Model string `json:"model,omitempty"`
8586
N int `json:"n,omitempty"`
8687
Size string `json:"size,omitempty"`
8788
ResponseFormat string `json:"response_format,omitempty"`
@@ -131,7 +132,7 @@ func (c *Client) CreateEditImage(ctx context.Context, request ImageEditRequest)
131132
return
132133
}
133134

134-
req, err := c.newRequest(ctx, http.MethodPost, c.fullURL("/images/edits"),
135+
req, err := c.newRequest(ctx, http.MethodPost, c.fullURL("/images/edits", request.Model),
135136
withBody(body), withContentType(builder.FormDataContentType()))
136137
if err != nil {
137138
return
@@ -144,6 +145,7 @@ func (c *Client) CreateEditImage(ctx context.Context, request ImageEditRequest)
144145
// ImageVariRequest represents the request structure for the image API.
145146
type ImageVariRequest struct {
146147
Image *os.File `json:"image,omitempty"`
148+
Model string `json:"model,omitempty"`
147149
N int `json:"n,omitempty"`
148150
Size string `json:"size,omitempty"`
149151
ResponseFormat string `json:"response_format,omitempty"`
@@ -181,7 +183,7 @@ func (c *Client) CreateVariImage(ctx context.Context, request ImageVariRequest)
181183
return
182184
}
183185

184-
req, err := c.newRequest(ctx, http.MethodPost, c.fullURL("/images/variations"),
186+
req, err := c.newRequest(ctx, http.MethodPost, c.fullURL("/images/variations", request.Model),
185187
withBody(body), withContentType(builder.FormDataContentType()))
186188
if err != nil {
187189
return

0 commit comments

Comments
 (0)