Skip to content

Commit 19680fe

Browse files
authored
Merge pull request #418 from Gary-H9/add-dall-e-3
Add DALL·E 3 to specs & README
2 parents 096c88a + 7a4918f commit 19680fe

7 files changed

+446
-103
lines changed

README.md

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ Stream text with GPT-4, transcribe and translate audio with Whisper, or create i
3838
- [Runs](#runs)
3939
- [Runs involving function tools](#runs-involving-function-tools)
4040
- [Image Generation](#image-generation)
41+
- [DALL·E 2](#dalle-2)
42+
- [DALL·E 3](#dalle-3)
4143
- [Image Edit](#image-edit)
4244
- [Image Variations](#image-variations)
4345
- [Moderations](#moderations)
@@ -705,8 +707,11 @@ Note that you have 10 minutes to submit your tool output before the run expires.
705707

706708
### Image Generation
707709

708-
Generate an image using DALL·E! The size of any generated images must be one of `256x256`, `512x512` or `1024x1024` -
709-
if not specified the image will default to `1024x1024`.
710+
Generate images using DALL·E 2 or DALL·E 3!
711+
712+
#### DALL·E 2
713+
714+
For DALL·E 2 the size of any generated images must be one of `256x256`, `512x512` or `1024x1024` - if not specified the image will default to `1024x1024`.
710715

711716
```ruby
712717
response = client.images.generate(parameters: { prompt: "A baby sea otter cooking pasta wearing a hat of some sort", size: "256x256" })
@@ -716,6 +721,19 @@ puts response.dig("data", 0, "url")
716721

717722
![Ruby](https://i.ibb.co/6y4HJFx/img-d-Tx-Rf-RHj-SO5-Gho-Cbd8o-LJvw3.png)
718723

724+
#### DALL·E 3
725+
726+
For DALL·E 3 the size of any generated images must be one of `1024x1024`, `1024x1792` or `1792x1024`. Additionally the quality of the image can be specified to either `standard` or `hd`.
727+
728+
```ruby
729+
response = client.images.generate(parameters: { prompt: "A springer spaniel cooking pasta wearing a hat of some sort", size: "1024x1792", quality: "standard" })
730+
puts response.dig("data", 0, "url")
731+
# => "https://oaidalleapiprodscus.blob.core.windows.net/private/org-Rf437IxKhh..."
732+
```
733+
734+
![Ruby](https://i.ibb.co/z2tCKv9/img-Goio0l-S0i81-NUNa-BIx-Eh-CT6-L.png)
735+
736+
719737
### Image Edit
720738

721739
Fill in the transparent part of an image, or upload a mask with transparent sections to indicate the parts of an image that can be changed according to your prompt...

spec/fixtures/cassettes/images_edit_image_png_A_solid_red_Ruby_on_a_blue_background.yml

Lines changed: 125 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

spec/fixtures/cassettes/images_generate_A_baby_sea_otter_cooking_pasta_wearing_a_hat_of_some_sort.yml

Lines changed: 12 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

spec/fixtures/cassettes/images_generate_A_lion_cooking_pasta_wearing_a_hat_of_some_sort.yml

Lines changed: 72 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

spec/fixtures/cassettes/images_generate_A_springer_spaniel_cooking_pasta_wearing_a_hat_of_some_sort.yml

Lines changed: 72 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)