Skip to content

Commit

Permalink
fixed #594 (#609)
Browse files Browse the repository at this point in the history
APITypeAzure dall-e3 model url

Co-authored-by: HanHongmin <[email protected]>
  • Loading branch information
HongminHan and HanHongmin authored Jan 15, 2024
1 parent e01a2d7 commit 09f6920
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions image.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ type ImageEditRequest struct {
Image *os.File `json:"image,omitempty"`
Mask *os.File `json:"mask,omitempty"`
Prompt string `json:"prompt,omitempty"`
Model string `json:"model,omitempty"`
N int `json:"n,omitempty"`
Size string `json:"size,omitempty"`
ResponseFormat string `json:"response_format,omitempty"`
Expand Down Expand Up @@ -131,7 +132,7 @@ func (c *Client) CreateEditImage(ctx context.Context, request ImageEditRequest)
return
}

req, err := c.newRequest(ctx, http.MethodPost, c.fullURL("/images/edits"),
req, err := c.newRequest(ctx, http.MethodPost, c.fullURL("/images/edits", request.Model),
withBody(body), withContentType(builder.FormDataContentType()))
if err != nil {
return
Expand All @@ -144,6 +145,7 @@ func (c *Client) CreateEditImage(ctx context.Context, request ImageEditRequest)
// ImageVariRequest represents the request structure for the image API.
type ImageVariRequest struct {
Image *os.File `json:"image,omitempty"`
Model string `json:"model,omitempty"`
N int `json:"n,omitempty"`
Size string `json:"size,omitempty"`
ResponseFormat string `json:"response_format,omitempty"`
Expand Down Expand Up @@ -181,7 +183,7 @@ func (c *Client) CreateVariImage(ctx context.Context, request ImageVariRequest)
return
}

req, err := c.newRequest(ctx, http.MethodPost, c.fullURL("/images/variations"),
req, err := c.newRequest(ctx, http.MethodPost, c.fullURL("/images/variations", request.Model),
withBody(body), withContentType(builder.FormDataContentType()))
if err != nil {
return
Expand Down

0 comments on commit 09f6920

Please sign in to comment.