|
I am trying to use Dalle as it shows in the documentation: $openaiClient = Manager::build(new \GuzzleHttp\Client(), new Authentication('$api-key')); |
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()); |
|
php -v |
|
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 |
|
Hi @Wellsj27 , I'm glad you figured it out. Cheers |
|
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 |

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