-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add create image edit #20
base: main
Are you sure you want to change the base?
Conversation
ysinjab
commented
Mar 26, 2023
- Refactor Upload function to support uplading multiple files
- Add support for create image edit. Check image/edit.go
- Refactor examples/images to include two examples (edit & create)
- Rename json tag for CreatedAt to Created
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great, I left some minor comments but can resolve if you don't have bandwidth.
examples/image/create/main.go
Outdated
N: 3, | ||
Prompt: "a cute baby", | ||
Size: "1024x1024", | ||
ResponseFormat: "b64_json", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to break this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please explain what do you mean by "break it"? do you mean into separate task or PR? or into set of values like enum?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was wondering if we can keep this as Format not to break the existing package.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh yes I got it now! I revert the field ResponseFormat to Format. I also reverted Created to CreatedAt.
examples/image/edit/main.go
Outdated
log.Fatalf("ReadAll error: %v", err) | ||
} | ||
_ = data // use data | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove line.
image/create.go
Outdated
Prompt string `json:"prompt,omitempty"` | ||
N int `json:"n,omitempty"` | ||
Size string `json:"size,omitempty"` | ||
ResponseFormat string `json:"response_format,omitempty"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ditto. Do we need to break it?
image/edit.go
Outdated
Size string | ||
ResponseFormat string | ||
User string | ||
N *int |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's use N int here, you can omit it if it's 0.