Skip to content

Commit

Permalink
fix: Dall-E image generation examples
Browse files Browse the repository at this point in the history
  • Loading branch information
DZunke committed Jan 7, 2025
1 parent 86b80f9 commit 86c417a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
3 changes: 1 addition & 2 deletions examples/image-generator-dall-e-2.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,9 @@
$platform = PlatformFactory::create($_ENV['OPENAI_API_KEY']);

$response = $platform->request(
model: new DallE(),
model: new DallE(), // Utilize Dall-E 2 version in default
input: 'A cartoon-style elephant with a long trunk and large ears.',
options: [
'version' => DallE::DALL_E_2, // Utilize Dall-E 2 version
'response_format' => 'url', // Generate response as URL
'n' => 2, // Generate multiple images for example
],
Expand Down
5 changes: 1 addition & 4 deletions examples/image-generator-dall-e-3.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,8 @@
$platform = PlatformFactory::create($_ENV['OPENAI_API_KEY']);

$response = $platform->request(
model: new DallE(),
model: new DallE(version: DallE::DALL_E_3),
input: 'A cartoon-style elephant with a long trunk and large ears.',
options: [
'version' => DallE::DALL_E_3, // Utilize Dall-E 3 version
],
);

if ($response instanceof AsyncResponse) {
Expand Down

0 comments on commit 86c417a

Please sign in to comment.