BossBey File Manager
PHP:
8.2.30
OS:
Linux
User:
imagivibe
Root
/
home
/
imagivibe
/
public_html
/
app.imagivibe.com
/
vendor
/
openai-php
/
client
/
src
/
Responses
/
Completions
📤 Upload
📝 New File
📁 New Folder
Close
Editing: CreateResponseUsage.php
<?php declare(strict_types=1); namespace OpenAI\Responses\Completions; final class CreateResponseUsage { private function __construct( public readonly int $promptTokens, public readonly ?int $completionTokens, public readonly int $totalTokens, ) {} /** * @param array{prompt_tokens: int, completion_tokens: int|null, total_tokens: int} $attributes */ public static function from(array $attributes): self { return new self( $attributes['prompt_tokens'], $attributes['completion_tokens'] ?? null, $attributes['total_tokens'], ); } /** * @return array{prompt_tokens: int, completion_tokens: int|null, total_tokens: int} */ public function toArray(): array { return [ 'prompt_tokens' => $this->promptTokens, 'completion_tokens' => $this->completionTokens, 'total_tokens' => $this->totalTokens, ]; } }
Save
Cancel