Blazor AI Prompt Component | Telerik UI for Blazor (original) (raw)
- Empower users to execute tasks leveraging intuitive AI commands with the Telerik UI for Blazor AI Prompt.
- Part of the Telerik UI for Blazor library along with 110+ professionally-designed UI components.
- Includes support, documentation, demos, virtual classrooms, Visual Studio Code Extensions and more!
Easily Integrate GenAI Services into Your Blazor App
Telerik UI for Blazor AI Prompt component offers a range of functionalities, from generating responses to writing prompts and interacting with AI outputs, to executing a set of predefined commands. The Blazor AI Prompt is focused on providing users with a modern interface to interact with AI services, while enhancing usability for developers by offering smooth customization.
See the Telerik UI for Blazor AI Prompt overview demo
AI Prompt Views
The Telerik UI for Blazor AI Prompt component enables three predefined views to interact with:
- Prompt View: Features an area for user input. Users can enter prompts, suggestions and submit requests to the Large Language Model (LLM).
- Output View: By logging all previous interactions, this view shows prompts/commands, their results, plus options to retry, copy or rate each.
- Command View: Custom commands can be created by leveraging this view. It is beneficial for a specific context and can be used as independent queries to the AI.
See the Telerik UI for Blazor AI Prompt views demo - The default mode of the Telerik UI for Blazor AI Prompt toolbar is to showcase the button of the currently visible view, e.g., Output. Upon clicking, these built-in buttons trigger the view they represent. Defining custom tools within the AI Prompt control is also possible by using a simple tag.
See the Telerik UI for Blazor AI Prompt toolbar documentation AI Prompt Customization
Effortlessly customize the UI for Blazor AI Prompt to meet the desired look and feel. From configuring the button design to playing with the layout and footer template, you can adjust any feature to suit your needs.
AI Prompt Templates
The three predefined views of the Telerik UI for Blazor AI Prompt component can be easily configured by leveraging the available ViewTemplate and FooterTemplate. The ViewTemplate allows you to control the rendering of the view's content, while the FooterTemplate handles the rendering of the footer within individual views.
The AI Prompt also supports a PromptSuggestionItem Template for controlling the appearance of individual suggestions and a CommandItem Template that is used to define a custom markup for the command items.
See the Telerik UI for Blazor AI Prompt templates demo
Integration with Microsoft.Extensions.AI Preview Package
The Telerik UI for Blazor AI Prompt integration with Microsoft.Extensions.AI preview package allows you to build AI-powered features in your Blazor applications more efficiently. Benefit from the out-of-the box abstractions for integrating popular AI services into your apps.
See the Telerik UI for Blazor AI Prompt integration demo
AI Prompt Events
To ensure smooth interaction, the UI for Blazor AI Prompt includes the following set of events:
- OnRequest, which fires when the user clicks on the generate button within the Prompt View or retries a prompt from the Output View
- OnCommandExecute, which fires when the user clicks on a command within the Command View
- OnOutputRating, which fires when the user rates an output
- PromptTextChanged, which fires when the user changes the prompt text
See the Telerik UI for Blazor AI Prompt events documentation Globalization and Localization
Right-to-Left (RTL) Support
The Telerik UI for Blazor AI Prompt supports right-to-left configuration. The RTL functionality is supported by most Telerik components to accommodate users who communicate in a right-to-left language script, such as Arabic and Hebrew.
See the Telerik UI for Blazor AI Prompt RTL demo