Skip to content

Commit

Permalink
Fix PHP 7.4 compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
thekid committed Oct 13, 2024
1 parent 2ef81c9 commit e490a4e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/php/com/openai/rest/EventStream.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public function deltas(?string $filter= null): iterable {

$r= new StringReader($this->stream);
while (null !== ($line= $r->readLine())) {
if (!str_starts_with($line, 'data: ')) continue;
if (0 !== strncmp($line, 'data: ', 5)) continue;
// echo "\n<<< $line\n";

// Last chunk is "data: [DONE]"
Expand Down

0 comments on commit e490a4e

Please sign in to comment.