I want to write a PHP code that sends a text to gpt-3.5-turbo and gets the result. For example, send the information of a book and receive explanations about that book
I used the following package:
https://packagist.org/packages/haozi-team/chatgpt-php?query=chatgpt
But after running it displays this error:
Fatal error: Uncaught Tectalic\OpenAi\ClientException: Unsuccessful response. HTTP status code: 401 (Unauthorized). in /private/var/www/chatgpt/vendor/tectalic/openai/src/Handlers/ChatCompletions.php:150 Stack trace: #0 /private/var/www/chatgpt/index.php(21): Tectalic\OpenAi\Handlers\ChatCompletions->toModel() #1 {main} thrown in /private/var/www/chatgpt/vendor/tectalic/openai/src/Handlers/ChatCompletions.php on line 150
Is there a solution to my problem? Or can you introduce me another way to do this?