-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Your issue may already be reported!
Please search on the issue tracker before creating one.
Describe the bug
CreateEditImage method upload file report Supported file formats are 'image/png'
To Reproduce
config := openai.DefaultConfig("token")
config.HTTPClient = &http.Client{}
c := openai.NewClientWithConfig(config)
f4, _ := os.Open("./4.png")
defer f4.Close()
ctx := context.Background()
reqUrl := openai.ImageEditRequest{
Image: f4,
Prompt: "添加一只红色的鸭子",
Model: openai.CreateImageModelDallE2,
Size: openai.CreateImageSize512x512,
ResponseFormat: openai.CreateImageResponseFormatURL,
N: 1,
}
respUrl, err := c.CreateEditImage(ctx, reqUrl)
if err != nil {
fmt.Printf("Image creation error: %v\n", err)
return
}
fmt.Println(respUrl.Data[0].URL)
Expected behavior
Print out the URL address
Screenshots/Logs
Invalid file 'image': unsupported mimetype ('application/octet-stream'). Supported file formats are 'image/png'.
Environment (please complete the following information):
- go-openai version: [e.g. v1.38.1]
- Go version: [e.g. 1.20]
- OpenAI API version: [e.g. v1]
- OS: [e.g. Windows 10]
Additional context
Add any other context about the problem here.
viirtus
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working