From 09f6920ad04666f65dd86ed542e5ebf8bffc93a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=9F=A9=E5=AE=8F=E6=95=8F?= Date: Mon, 15 Jan 2024 20:01:49 +0800 Subject: [PATCH] fixed #594 (#609) APITypeAzure dall-e3 model url Co-authored-by: HanHongmin --- image.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/image.go b/image.go index afd4e196b..665de1a74 100644 --- a/image.go +++ b/image.go @@ -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"` @@ -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 @@ -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"` @@ -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