Skip to content
This repository has been archived by the owner on Nov 28, 2023. It is now read-only.

Commit

Permalink
Merge remote-tracking branch 'origin/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
devhaozi committed Mar 17, 2023
2 parents 7a3bb15 + 88bad3b commit e8662f9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

All notable changes to `chatgpt-php` will be documented in this file.

## 1.7.1 - 2023-03-15

V1 support GPT-4 now.

## 1.7.0 - 2023-03-10

Update new V1 api endpoint.
Expand Down
4 changes: 2 additions & 2 deletions src/V1.php
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ public function ask(

$line = $this->formatStreamMessage($line);

if (!$this->checkFields($line)) {
if (! $this->checkFields($line)) {
if (isset($line["detail"]) && $line["detail"] === "Too many requests in 1 hour. Try again later.") {
throw new Exception("Rate limit exceeded");
}
Expand Down Expand Up @@ -277,7 +277,7 @@ public function getConversations(int $offset = 0, int $limit = 20, $account = 0)
throw new Exception('Response is not json');
}

if (!isset($data['items'])) {
if (! isset($data['items'])) {
throw new Exception('Field missing');
}

Expand Down

0 comments on commit e8662f9

Please sign in to comment.