Fatal error: Uncaught OpenAI\Exceptions\ErrorException: This is a chat model and not supported in the v1/completions endpoint. Did you mean to use v1/chat/completions? in /var/www/html/vendor/openai-php/client/src/Transporters/HttpTransporter.php on line 131
OpenAI\Exceptions\ErrorException: This is a chat model and not supported in the v1/completions endpoint. Did you mean to use v1/chat/completions? in /var/www/html/vendor/openai-php/client/src/Transporters/HttpTransporter.php on line 131
Description
Completion API was deprecated with final last update in July 2023 as stated in open api documentation.
A new API endpoint was created to support GPT-4 model, chat completions.
I believe we have to create a new class,
ChatCompletions
to support this endpoint following same structured we have inCompletions
class.Steps To Reproduce
If we try to use gpt-4 as:
An error will surface:
OpenAI PHP Client Version
v0.8.0
PHP Version
8.1.2
Notes
No response