We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4d103b5 commit fe82510Copy full SHA for fe82510
src/Chat.php
@@ -35,7 +35,7 @@ public function completions(array $data, array $options)
35
'progress' => function ($buffer) use ($options) {
36
static $tmp = '';
37
$tmp .= $buffer;
38
- if ($tmp[strlen($tmp) - 1] !== "\n") {
+ if ($tmp === '' || $tmp[strlen($tmp) - 1] !== "\n") {
39
return null;
40
}
41
preg_match_all('/data: (\{.+?\})\n/', $tmp, $matches);
0 commit comments