GenAI-Powered Widget Generation in SmartUX

156 views

 

Welcome to the exciting new capabilities of Smart UX Studio. This update introduces GenAI-powered widget generation to accelerate your development process and improve productivity.

 

1. Introduce Gen AI Widget Generation

  • Hello everyone, welcome to SmartUX.
  • In this video, we will walk through how to generate widgets using Gen AI in SmartUX Studio.

Introduce Gen AI Widget Generation

2. Overview Of Gen AI Integration

  • With the Smart UX 3.1.1 in Magic xpa 4.12.1 Release, generative AI capabilities have been integrated to help accelerate widget development using supported AI providers such as OpenAI, GPT and Google Gemini.
  • Let’s get started. To generate the widgets using Gen-AI, you need to access the Gen-AI widget generation.

Overview Of Gen AI Integration

3. Access Gen AI Widget Generation

  • Click the icon to the left of the View Code button in the top right corner, and a window will appear.

Access Gen AI Widget Generation

4. View No Model Configuration Message

  • So this window appears when no model has been added to the configuration of SmartUX.
  • In this section, you will configure the Gen AI model required for Widget Generation.

View No Model Configuration Message

5. Navigate To Model Addition Screen

  • You can provide any model name you prefer.
  • For example, I have referred to it as the OpenAI GPT Model.

Navigate To Model Addition Screen

6. Select AI Provider

  • In the second part, you can choose the provider.
  • Here, you will find OpenAI and Google.

Select AI Provider

7. Select AI Model

  • We can select OpenAI, and from the model list, you will notice that there are numerous options available.

Select AI Model

8. Add OpenAI GPT Model

  • The options available from OpenAI include various models.
  • Let’s choose one. I have selected GPT-4.1. In the API key field, you must enter the key obtained from your OpenAI account.
  • You will receive an API key that you need to input here.

Add OpenAI GPT Model

9. Add Google Gemini Model

  • By default, we have only one model, which is set as the default.
  • However, we can add another model.
  • For instance, if I want to include a Google Gemini model, it is also supported.

Add Google Gemini Model

10. Configure Google Gemini Model

  • Let’s choose Google as the provider and select any model you prefer. I will select Gemini-3-flash here.

Configure Google Gemini Model

11. Configure Google Gemini API Key

  • Enter the API key from Google Gemini and save it.
  • If desired, you can set it as the default model for widget generation, then click save.

Configure Google Gemini API Key

12. Review Model Configuration Summary

  • You will notice one important aspect: this is exactly how you can configure or add various models in the SmartUX platform.
  • This process is crucial for ensuring that the models are set up correctly and operate as intended within the system.

Review Model Configuration Summary

13. System Instructions for Signature

  • The Gen AI models are available for generating widgets in the SmartUX.
  • It also offers a feature: system instruction.
  • System instruction lets you provide prompts or a predefined set of rules, which you can modify to suit your requirements.
  • The system generates your signature, ensuring that whenever a widget is created, it will include the signature based on this system instruction, just as it does with the widget instruction.

System Instructions for Signature

14. System Instructions for Widget And Template

  • It provides a set of instructions for generating the widget and corresponding tags.
  • Based on your selection, it creates an HTML template.

System Instructions for Widget And Template

15. System Instructions for Widget Properties

  • This system instruction is crafted to utilize the existing set of available properties.
  • In this file, you will find examples demonstrating how it generates or applies these properties accordingly.
  • The system will consistently leverage the existing properties.

System Instructions for Widget Properties

16. Edit System Instructions Format

  • Another option available to you is the ability to modify this system instruction at any time to suit your needs.
  • However, it is important to note that these restructuring instructions are formatted in Markdown format.
  • Therefore, when making modifications, ensure that they adhere to the Markdown format.

Edit System Instructions Format

17. Save And Restore System Instructions

  • There are additional options available.
  • If you make any changes here, you can save them.
  • If you wish to revert back you can restore it to the default settings.

Save And Restore System Instructions

18. Recap Gen AI Model Configuration

  • This outlines the process for configuring the Gen AI settings and adding a model to the SmartUX GenAI configuration to integrate OpenAI or Google Gemini models.

Recap Gen AI Model Configuration

19. Open Widget Operation Panel

  • Let’s proceed to the widget generation.
  • With the models successfully configured, you can click this button to access the widget operation panel, where you will find the list of widget groups.

Open Widget Operation Panel

20. Explore Widget Generation Panel Features

  • On the left-hand side, you will see a list of existing Widgets and Widget Groups.
  • On the right-hand side, you will find the Generate Widget window with GenAI.
  • In this window, the signature is optional.

Explore Widget Generation Panel Features

21. Instruction Field to Generate Widget

  • The prompt or instruction you provide to generate a widget should be entered in the Instructions field.
  • This field is mandatory and must be completed to successfully generate a widget.

Instruction Field to Generate Widget

22. Generate Widget with GenAI

  • The source HTML can be a straightforward instruction, or it can be meticulously constructed using specific statements that are thoughtfully combined with HTML elements.
  • This flexibility allows for a range of possibilities in how the HTML is presented and utilized.
  • Now, let’s proceed by clicking on the Generate button to see the results of our input.

Generate Widget with GenAI

23. Newly Created Widget

  • In this section, you can observe that the ID, Name, Description, and Signature for this widget are generated by GenAI.
  • You have the ability to modify the ID, Name, Description, and Signature even after the widget has been created.

Newly Created Widget

24. Assign Widget Group And More

  • You can choose the group in which to add this widget.
  • Since this breadcrumb will serve as a navigation tool, we can include it in the navigation section.
  • Additionally, you have the option to change the icon.

Assign Widget Group And More

25. Assign Widget To Magic xpa Control

  • If you plan to assign it to a specific Magic xpa control, you can select it from the dropdown menu here.
  • This will display only the supported Magic xpa controls that can be assigned to this particular widget.
  • For now, we will not make any assignments.

Assign Widget To Magic xpa Control

26. HTML Template of Generated Widget

  • When this widget is dragged and dropped onto the canvas, the corresponding HTML template will be generated or added to the code section.

HTML Template of Generated Widget

27. Review Properties Tab

  • Moving on to the Properties tab. Here, you can see that properties are generated by GenAI for the generated Widget.
  • First one is Magic, it is used for any bindings to the Magic xpa control or functions.
  • You can assign it using this property.
  • The ID property allows you to provide a specific ID as per your need, and the class name property for styling purposes.
  • You can see that GenAI has automatically created properties for the widget based on existing properties from SmartUX.

Review Properties Tab

28. Save Widget Generated Widget

  • Let’s save this, and now you can see that the widget has been created.
  • Now, let’s close this window. Once you close it, the widget will refresh.

Save Widget Generated Widget

29. Drag Widget To Canvas

  • Now, let’s open a component to place the newly generated widget.
  • If we navigate to the widget section here, you will find the Breadcrumb widget in the Widgets Panel.
  • By dragging and dropping it here, you will see the HTML being created.

Drag Widget To Canvas

30. Breadcrumb widget on the Canvas

  • You can view the properties for this on the right-hand side.
  • Now, save it, and we will switch out of expanded mode.

Breadcrumb widget on the Canvas

31. View Code section with HTML template of Breadcrumb widget

  • In the code section, you can view the generated HTML template for the dropped Breadcrumb widget, ready for modification according to your requirements.

View Code section with HTML template of Breadcrumb widget

32. Create Widget From HTML Code

  • That was one approach. The alternative option is, for instance, we have some HTML code.
  • Here, we have HTML code that is not a widget, so you can select it.

Create Widget From HTML Code

33. Generate Widget From Selected HTML

  • Once you make a selection, you will notice that an icon has appeared.
  • Simply click on this icon. Select the desired portion of HTML, and an icon will appear to create a widget from the selected HTML.
  • Click on it to initiate the generation process.

Generate Widget From Selected HTML

34. Widget Creation Approach

  • When you click on the hat icon in the code section, it will open the Widget Operation panel featuring “Generate Widget with GenAI.”
  • You will notice that it has automatically generated a signature and instructions to create a widget based on the selected HTML code.
  • Now, simply click on “Generate” to create the widget using GenAI.

Widget Creation Approach

35. Widget Creation Approach And ID Modification

  • Let’s save this, and now you can see that the widget has been created.
  • Now, let’s close this window. Once you close it, the widget will refresh.

Widget Creation Approach And ID Modification

36. Use newly Generated Widget

  • Now, if I remove this part of the code and go to the widgets and drag and drop the newly created widget, you can see

Use newly Generated Widget

To summarize the steps and actions we have taken with SmartUX 3.1.1, we reaffirm our commitment to innovation by integrating generative AI directly into the development experience. This integration will provide end users and developers with faster widget generation through GenAI, which supports both OpenAI and Google Gemini. Additionally, we offer centralized GenAI configuration, multi-model management, and editable system instructions. We are confident that these enhancements will significantly boost productivity, flexibility, and user experience within SmartUX Studio. Thank you for watching the video. Get started right away by configuring your preferred AI models and generating widgets effortlessly with the GenAI-powered features of Smart UX Studio.
Share this Article

GenAI-Powered Widget Generation in SmartUX

Or copy link

CONTENTS