OpenAI released a https://platform.openai.com/docs/guides/chat/introduction that allows you to make use of the powerful AI model that also powers ChatGPT. Let's see how we can make use of it and build a ChatGPT clone using Laravel 10.
The new AI model is called gpt-3.5-turbo and is 10 times (!) cheaper than the most powerful DaVinci model, which is amazing.
$response = OpenAI::chat()->create([ 'model' => 'gpt-3.5-turbo', 'messages' => $messages ]); This will give us the OpenAI chat response, which we also want to add to our messages array.
And that's all you need to do, thanks to the new OpenAI Chat completions API to build a ChatGPT clone yourself.