Skip to content

Commit e8a80d9

Browse files
committed
fix mistral streaming with advanced api response
1 parent 7058f6e commit e8a80d9

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/Providers/Mistral/Mistral.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
use function array_unshift;
1515
use function json_encode;
16+
use function is_array;
1617

1718
class Mistral extends OpenAI
1819
{
@@ -88,7 +89,7 @@ public function stream(array|string $messages, callable $executeToolsCallback):
8889

8990
// Process regular content
9091
$content = $choice['delta']['content'] ?? '';
91-
if (\is_array($content) && $content['type'] === 'text') {
92+
if (is_array($content) && $content['type'] === 'text') {
9293
$text .= $content['text'];
9394
} else {
9495
$text .= $content;

0 commit comments

Comments
 (0)