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 7ec1207 commit 769be96Copy full SHA for 769be96
src/Responses/Chat/CreateStreamedResponse.php
@@ -29,6 +29,7 @@ private function __construct(
29
public readonly int $created,
30
public readonly string $model,
31
public readonly array $choices,
32
+ public readonly ?CreateResponseUsage $usage,
33
) {
34
}
35
@@ -49,6 +50,7 @@ public static function from(array $attributes): self
49
50
$attributes['created'],
51
$attributes['model'],
52
$choices,
53
+ isset($attributes['usage']) ? CreateResponseUsage::from($attributes['usage']) : null,
54
);
55
56
@@ -66,6 +68,7 @@ public function toArray(): array
66
68
static fn (CreateStreamedResponseChoice $result): array => $result->toArray(),
67
69
$this->choices,
70
),
71
+ 'usage' => $this->usage?->toArray() ?? null,
72
];
73
74
0 commit comments