Skip to content

Commit

Permalink
Merge pull request #408 from beliven-daniele-sarnari/main
Browse files Browse the repository at this point in the history
fix: expect delta to not exist
  • Loading branch information
gehrisandro authored May 28, 2024
2 parents 9d14eef + 2f3aa15 commit 7b61b9b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Responses/Chat/CreateStreamedResponseChoice.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public static function from(array $attributes): self
{
return new self(
$attributes['index'],
CreateStreamedResponseDelta::from($attributes['delta']),
CreateStreamedResponseDelta::from($attributes['delta'] ?? []),

Check failure on line 23 in src/Responses/Chat/CreateStreamedResponseChoice.php

View workflow job for this annotation

GitHub Actions / Formats P8.1 - ubuntu-latest - prefer-lowest

Offset 'delta' on array{index: int, delta: array{role?: string, content?: string}, finish_reason: string|null} on left side of ?? always exists and is not nullable.

Check failure on line 23 in src/Responses/Chat/CreateStreamedResponseChoice.php

View workflow job for this annotation

GitHub Actions / Formats P8.1 - ubuntu-latest - prefer-stable

Offset 'delta' on array{index: int, delta: array{role?: string, content?: string}, finish_reason: string|null} on left side of ?? always exists and is not nullable.
$attributes['finish_reason'] ?? null,
);
}
Expand Down

0 comments on commit 7b61b9b

Please sign in to comment.