openai-php / laravel

⚡️ OpenAI PHP for Laravel is a supercharged PHP API client that allows you to interact with OpenAI API

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Not working even after installing.

shahidkarimi opened this issue · comments

Class "OpenAI\Laravel\Facades\OpenAI" not found

tried to use:
`\OpenAI\Laravel\Facades\OpenAI

\OpenAI\Laravel\Facades\OpenAI\OpenAI`

I cant get the what you try. Could you provide code?

I have the same issue, Class "OpenAI\Laravel\Facades\OpenAI" not found, please help.

Any change if you run this? composer require openai-php/laravel:^0.7.0

Can you share some example code where you are trying to use it?

I ran composer require openai-php/laravel
in a fresh instalation or laravel 10

Where are you seeing the error?

here is the code
image
image
sometimes a get Class "OpenAI\Laravel\Facades\OpenAI" not found

Unsupported operand types: string * int

Either set a value for OPENAI_REQUEST_TIMEOUT or comment it out. Issue occurs when it is left blank


Could not reproduce Class Not Found error:

laravel new test
cd test
composer require openai-php/laravel
php artisan vendor:publish --provider="OpenAI\Laravel\ServiceProvider"
php artisan serve
use OpenAI\Laravel\Facades\OpenAI;
Route::get('/', function () {
    dd(OpenAI:: completions()->create([
                                          'model'  => 'text-davinci-003',
                                          'prompt' => 'PHP is']));
});