When i try request throw OpenAI laravel library to model gpt-3.5-turbo and result must be list, library throw Exception
WARNING Undefined array key "choices" in
vendor/openaiphp/client/src/Responses/Completions/CreateResponse.php on line 45.
TypeError array_map(): Argument #2 ($array) must be of type array, null given.
I tried this request for test
use OpenAI\Laravel\Facades\OpenAI;
OpenAI::completions()->create([
'model' => 'gpt-3.5-turbo',
'prompt' => 'Top 3 reachest peaople',
]);
The problem was related to the openai model. I changed the model to text-davinci-003 and it worked.