}> $toolCalls * Tool calls the model wants the host to execute. Empty array if none. * @param string $finishReason Why generation stopped: 'stop', 'tool_calls', 'length', 'error', etc. * @param array{tokens_in?: int, tokens_out?: int} $usage Token usage for cost tracking (optional). * @param string|null $model Echoed model ID that produced this response (optional). */ public function __construct( public readonly ?string $message, public readonly array $toolCalls = [], public readonly string $finishReason = 'stop', public readonly array $usage = [], public readonly ?string $model = null, ) {} public function hasToolCalls(): bool { return $this->toolCalls !== []; } }