Text-to-design: Can anyone help me get started with some basic ideas or resources?

How to create text-to-design using generative AI models in plugins? Mostly it would be like a user enters a text and the model would generate the Figma js code and it would be rendered on the canvas. Share any resources possible. Thanks!

Basically, I want to create a text-to-design feature in my plugin.