Skip to content

Commit

Permalink
Merge pull request #43 from google-gemini-php/main-beta-conflict
Browse files Browse the repository at this point in the history
main --> beta
  • Loading branch information
aydinfatih authored Oct 11, 2024
2 parents 1f3a155 + 2c9b4d8 commit 0c2c75c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/Concerns/HasModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ public function parseModel(ModelType|string $model): string
{
return match (true) {
$model instanceof BackedEnum => $model->value,
str_starts_with($model, 'models') => $model,
str_starts_with($model, 'models/') => $model,
str_starts_with($model, 'tunedModels/') => $model,
default => "models/$model"
};
}
Expand Down
4 changes: 2 additions & 2 deletions src/Data/UsageMetadata.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ final class UsageMetadata implements Arrayable
*/
public function __construct(
public readonly int $promptTokenCount,
public readonly ?int $candidatesTokenCount,
public readonly int $totalTokenCount,
public readonly ?int $candidatesTokenCount = null,
public readonly ?int $cachedContentTokenCount = null,
) {}

Expand All @@ -33,8 +33,8 @@ public static function from(array $attributes): self
{
return new self(
promptTokenCount: $attributes['promptTokenCount'],
candidatesTokenCount: $attributes['candidatesTokenCount'] ?? null,
totalTokenCount: $attributes['totalTokenCount'],
candidatesTokenCount: $attributes['candidatesTokenCount'] ?? null,
cachedContentTokenCount: $attributes['cachedContentTokenCount'] ?? null
);
}
Expand Down
2 changes: 2 additions & 0 deletions src/Enums/MimeType.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,6 @@ enum MimeType: string
case APPLICATION_RTF = 'application/rtf';
case TEXT_RTF = 'text/rtf';

// Pdf
case APPLICATION_PDF = 'application/pdf';
}

0 comments on commit 0c2c75c

Please sign in to comment.