Can I use Generative expand in UXP Indesign plugin?

Hello,

I would like to use Generative expand in an Indesign UXP plugin. Is it possible?

The goal would be to automatically fill a background layer with content if it is smaller than the available space. This works great when used manually, but I would like to automate this function in my plugin. When the plugin is running, it would automatically accept the first version offered.

Thank you for your help!