RadAIPrompt
A component that bridges the gap between an app and the next-generation AI language model applications. Use the AIPrompt to provide your users with pre-determined ways to interact with a trained language model of your choice.
Definition
Namespace:Telerik.WinControls.UI
Assembly:Telerik.WinControls.UI.dll
Syntax:
[TelerikToolboxCategory("Data Controls")]
public class RadAIPrompt : RadControl, IDropTarget, ISynchronizeInvoke, IWin32Window, IBindableComponent, IComponent, IDisposable, INotifyPropertyChanged, ISupportInitializeNotification, ISupportInitialize, IComponentTreeHandler, ILayoutHandler, IAnalyticsProvider
Inheritance: objectMarshalByRefObjectComponentControlScrollableControlRadControlRadAIPrompt...
Implements:
Inherited Members
Constructors
Initializes a new instance of the RadAIPrompt class.
public RadAIPrompt()
Properties
Gets or sets the currently active item which determines what view is displayed to the user. The active item controls which part of the AI prompt interface is visible and interactive.
[Browsable(false)]
public RadAIPromptItem ActiveItem { get; set; }
Gets the main AI prompt element that handles the core functionality of the control. This element manages the views, toolbar, and user interactions.
[Browsable(false)]
public RadAIPromptElement AIPromptElement { get; }
Gets the default size of the RadAIPrompt when a new instance is initialized.
protected override Size DefaultSize { get; }
Overrides:
Gets or sets the input text that will be sent to the AI when a prompt request is initiated. This text represents the user's query or command to the AI language model.
public string InputText { get; set; }
Gets the items that represent the different views of the AI Prompt control. These views include input, output, and other functional areas of the control.
[Browsable(false)]
public ObservableCollection<RadAIPromptItem> Items { get; }
Gets the output items which represent the responses from the AI. Each item contains the response text, input prompt, and metadata about the AI interaction.
[Browsable(false)]
public ObservableCollection<AIPromptOutputItem> OutputItems { get; }
Gets or sets the position of the toolbar within the control. The toolbar contains navigation elements for switching between different views.
public ToolbarPosition ToolbarPosition { get; set; }
Methods
Creates the main AI prompt element that provides the core functionality of the control. Override this method to provide a custom implementation of RadAIPromptElement.
protected virtual RadAIPromptElement CreateAiPromptElement()
A new instance of RadAIPromptElement.
Creates the child items of the control by adding the main AI prompt element to the parent container.
protected override void CreateChildItems(RadElement parent)
The parent RadElement that will contain the child items.
Overrides:
Events
Occurs when the user interacts with an output visual item through actions like copy, retry, or rating. Use this event to handle custom logic for these user interactions.
public event OutputItemActionEventHandler OutputItemAction
Occurs when a new item is added to the OutputItems collection and a new visual item is about to be added to the output view. This event allows you to modify or replace the visual item before it is displayed to the user.
public event OutputVisualItemCreatedEventHandler OutputVisualItemCreated
Occurs when the user initiates a prompt request by pressing the input button or retry button. Handle this event to send the prompt text to your AI service and receive a response.
public event PromptRequestEventHandler PromptRequest