fixe
This commit is contained in:
parent
3871b0cef7
commit
2eb327d3b0
|
@ -625,7 +625,7 @@ class ChatController extends BaseController
|
|||
]);
|
||||
|
||||
$data = json_decode($response->getBody()->getContents(), true);
|
||||
return $this->handleResponse((object)$data);
|
||||
return $this->handleResponse($data);
|
||||
} catch (\Throwable $th) {
|
||||
// If Rate limit reached
|
||||
if ($th->getCode() == 429) {
|
||||
|
@ -637,10 +637,10 @@ class ChatController extends BaseController
|
|||
}
|
||||
}
|
||||
|
||||
private function handleResponse(object $response)
|
||||
private function handleResponse(array $response)
|
||||
{
|
||||
|
||||
$message = $response->choices[0]->text;
|
||||
$message = $response['choices'][0]['text'];
|
||||
return [
|
||||
(object)[
|
||||
"choices" => [
|
||||
|
|
Loading…
Reference in New Issue