-
I am trying to use Dalle as it shows in the documentation: $openaiClient = Manager::build(new \GuzzleHttp\Client(), new Authentication('$api-key'));
|
Beta Was this translation helpful? Give feedback.
Replies: 5 comments
-
Hi there @Wellsj27 , I was unable to reproduce the error with the Would you mind sharing the following:
Thanks test script<?php
declare(strict_types=1);
use Symfony\Component\HttpClient\Psr18Client;
use Tectalic\OpenAi\Authentication;
use Tectalic\OpenAi\Manager;
use Tectalic\OpenAi\Models\ImagesGenerations\CreateRequest;
require_once __DIR__ . '/vendor/autoload.php';
$openaiClient = Manager::build(new Psr18Client(), new Authentication('token'));
$result = $openaiClient->imagesGenerations()->create(new CreateRequest([
'prompt' => 'draw a puppy',
'size' => '256x256',
'n' => 1
]));
var_dump($result->toModel()); |
Beta Was this translation helpful? Give feedback.
-
php -v |
Beta Was this translation helpful? Give feedback.
-
Thanks for the help, I was able to fix my issue, I am just starting out and didn't realize I needed the use use Tectalic\OpenAi\Models\ImagesGenerations\CreateRequest; and couldn't do both image and text in the same code. Thanks again |
Beta Was this translation helpful? Give feedback.
-
Hi @Wellsj27 , I'm glad you figured it out. Cheers |
Beta Was this translation helpful? Give feedback.
-
Hi there @Wellsj27, Just a brief note to say that we have also now updated our examples documentation to use fully qualified class names. This change should help users see that different All the best, James |
Beta Was this translation helpful? Give feedback.
Thanks for the help, I was able to fix my issue, I am just starting out and didn't realize I needed the use use Tectalic\OpenAi\Models\ImagesGenerations\CreateRequest; and couldn't do both image and text in the same code. Thanks again