Skip to content

Commit

Permalink
style: Fixed styling
Browse files Browse the repository at this point in the history
  • Loading branch information
Fatih Aydın committed Oct 8, 2024
1 parent ca691fa commit 1f3a155
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Data/UsageMetadata.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,19 @@ final class UsageMetadata implements Arrayable
*/
public function __construct(
public readonly int $promptTokenCount,
public readonly int $candidatesTokenCount,
public readonly ?int $candidatesTokenCount,
public readonly int $totalTokenCount,
public readonly ?int $cachedContentTokenCount = null,
) {}

/**
* @param array{ promptTokenCount: int, candidatesTokenCount: int, totalTokenCount: int, cachedContentTokenCount: ?int } $attributes
* @param array{ promptTokenCount: int, candidatesTokenCount: ?int, totalTokenCount: int, cachedContentTokenCount: ?int } $attributes
*/
public static function from(array $attributes): self
{
return new self(
promptTokenCount: $attributes['promptTokenCount'],
candidatesTokenCount: $attributes['candidatesTokenCount'],
candidatesTokenCount: $attributes['candidatesTokenCount'] ?? null,
totalTokenCount: $attributes['totalTokenCount'],
cachedContentTokenCount: $attributes['cachedContentTokenCount'] ?? null
);
Expand Down

0 comments on commit 1f3a155

Please sign in to comment.