ClassRadAIPrompt
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
RadAIPrompt()
Initializes a new instance of the RadAIPrompt class.
Declaration
public RadAIPrompt()
Properties
AIPromptElement
Gets the main AI prompt element that handles the core functionality of the control. This element manages the views, toolbar, and user interactions.
Declaration
[Browsable(false)]
public RadAIPromptElement AIPromptElement { get; }
Property Value
ActiveItem
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.
Declaration
[Browsable(false)]
public RadAIPromptItem ActiveItem { get; set; }
Property Value
DefaultSize
Gets the default size of the RadAIPrompt when a new instance is initialized.
Declaration
protected override Size DefaultSize { get; }
Property Value
Overrides
InputText
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.
Items
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.
Declaration
[Browsable(false)]
public ObservableCollection<RadAIPromptItem> Items { get; }
Property Value
OutputItems
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.
Declaration
[Browsable(false)]
public ObservableCollection<AIPromptOutputItem> OutputItems { get; }
Property Value
ToolbarPosition
Gets or sets the position of the toolbar within the control. The toolbar contains navigation elements for switching between different views.
Declaration
public ToolbarPosition ToolbarPosition { get; set; }
Property Value
Methods
CreateAiPromptElement()
Creates the main AI prompt element that provides the core functionality of the control. Override this method to provide a custom implementation of RadAIPromptElement.
Declaration
protected virtual RadAIPromptElement CreateAiPromptElement()
Returns
A new instance of RadAIPromptElement.
CreateChildItems(RadElement)
Creates the child items of the control by adding the main AI prompt element to the parent container.
Declaration
protected override void CreateChildItems(RadElement parent)
Parameters
parent
The parent RadElement that will contain the child items.
Overrides
Events
OutputItemAction
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.
Declaration
public event OutputItemActionEventHandler OutputItemAction
Event Value
OutputVisualItemCreated
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.
Declaration
public event OutputVisualItemCreatedEventHandler OutputVisualItemCreated
Event Value
PromptRequest
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.
Declaration
public event PromptRequestEventHandler PromptRequest
Event Value