client icon indicating copy to clipboard operation
client copied to clipboard

Constant HTTP 500 Server errors

Open XavLimSG opened this issue 1 year ago • 2 comments

Hey guys, I’ve been trying to implement the OpenAI PHP client into my PHP web server and I really don’t know what i’m doing wrong.

API KEY created in environment variable Depedencies are all installed on the server hosting the site. When I go to the site, it still pronmpts HTTP500 error

CODE BELOW:

chat()->create([ 'model' => 'gpt-4', 'messages' => [ ['role' => 'user', 'content' => 'Hello!'], ], ]); echo $result->choices[0]->message->content; // Hello! How can I assist you today?

XavLimSG avatar Mar 18 '24 13:03 XavLimSG

I'm using php 8.1.2 cli ubuntu if that matters.

XavLimSG avatar Mar 18 '24 13:03 XavLimSG

Check the apache error log file, it will show you what is going wrong.

PeperMarkreel avatar Mar 20 '24 15:03 PeperMarkreel

Hi @wolfhuntme

This does not look like an error related to the package.

If you do not agree, feel free to reopen the issue.

gehrisandro avatar May 28 '24 21:05 gehrisandro