Class 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.
Inherited Members
Namespace: Telerik.WinControls.UI
Assembly: Telerik.WinControls.UI.dll
Syntax
[TelerikToolboxCategory("Data Controls")]
public class RadAIPrompt : RadControl, INotifyPropertyChanged, ISupportInitializeNotification, ISupportInitialize, IComponentTreeHandler, ILayoutHandler, IPCHost, IAnalyticsProvider
Constructors
RadAIPrompt()
Properties
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
public RadAIPromptItem ActiveItem { get; set; }
Property Value
RadAIPromptItem
|
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
public RadAIPromptElement AIPromptElement { get; }
Property Value
RadAIPromptElement
|
DefaultSize
Gets the default size of the RadAIPrompt when a new instance is initialized.
Declaration
protected override Size DefaultSize { get; }
Property Value
System.Drawing.Size
|
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.
Declaration
public string InputText { get; set; }
Property Value
System.String
|
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
public ObservableCollection<RadAIPromptItem> Items { get; }
Property Value
System.Collections.ObjectModel.ObservableCollection<RadAIPromptItem>
|
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
public ObservableCollection<AIPromptOutputItem> OutputItems { get; }
Property Value
System.Collections.ObjectModel.ObservableCollection<AIPromptOutputItem>
|
Text
This property is not relevant for this class.
Declaration
public override string Text { get; set; }
Property Value
System.String
|
Overrides
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
ToolbarPosition
|
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
RadAIPromptElement
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
RadElement
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 Type
OutputItemActionEventHandler
|
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 Type
OutputVisualItemCreatedEventHandler
|
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 Type
PromptRequestEventHandler
|