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.Windows.Controls
Assembly:Telerik.Windows.Controls.ConversationalUI.dll
Syntax:
[TelerikToolboxCategory("ConversationalUI")]
public class RadAIPrompt : ItemsControl
Inheritance: objectRadAIPrompt
Constructors
RadAIPrompt()
Initializes a new instance of the RadAIPrompt class.
Declaration
public RadAIPrompt()
Fields
ActiveItemProperty
Identifies the ActiveItem dependency property.
Declaration
public static readonly DependencyProperty ActiveItemProperty
Field Value
DependencyProperty
AreSuggestionsVisibleProperty
Identifies the AreSuggestionsVisible property.
Declaration
public static readonly DependencyProperty AreSuggestionsVisibleProperty
Field Value
DependencyProperty
CommandsProperty
Identifies the Commands property.
Declaration
public static readonly DependencyProperty CommandsProperty
Field Value
DependencyProperty
CurrentPageIndexProperty
Identifies the CurrentPageIndex property.
Declaration
public static readonly DependencyProperty CurrentPageIndexProperty
Field Value
DependencyProperty
HeaderBackgroundProperty
Identifies the HeaderBackground property.
Declaration
public static readonly DependencyProperty HeaderBackgroundProperty
Field Value
DependencyProperty
HeaderMinHeightProperty
Identifies the HeaderMinHeight property.
Declaration
public static readonly DependencyProperty HeaderMinHeightProperty
Field Value
DependencyProperty
InputButtonContentProperty
Identifies the InputButtonContent property.
Declaration
public static readonly DependencyProperty InputButtonContentProperty
Field Value
DependencyProperty
InputButtonContentTemplateProperty
Identifies the InputButtonContentTemplate property.
Declaration
public static readonly DependencyProperty InputButtonContentTemplateProperty
Field Value
DependencyProperty
InputTextBoxStyleProperty
Identifies the InputTextBoxStyle property.
Declaration
public static readonly DependencyProperty InputTextBoxStyleProperty
Field Value
DependencyProperty
InputTextProperty
Identifies the InputText property.
Declaration
public static readonly DependencyProperty InputTextProperty
Field Value
DependencyProperty
IsPagingEnabledProperty
Identifies the IsPagingEnabled property.
Declaration
public static readonly DependencyProperty IsPagingEnabledProperty
Field Value
DependencyProperty
MoveToFirstPageCommandProperty
Identifies the MoveToFirstPageCommand dependency property.
Declaration
public static readonly DependencyProperty MoveToFirstPageCommandProperty
Field Value
DependencyProperty
MoveToLastPageCommandProperty
Identifies the MoveToLastPageCommand dependency property.
Declaration
public static readonly DependencyProperty MoveToLastPageCommandProperty
Field Value
DependencyProperty
MoveToNextPageCommandProperty
Identifies the MoveToNextPageCommand dependency property.
Declaration
public static readonly DependencyProperty MoveToNextPageCommandProperty
Field Value
DependencyProperty
MoveToPreviousPageCommandProperty
Identifies the MoveToPreviousPageCommand dependency property.
Declaration
public static readonly DependencyProperty MoveToPreviousPageCommandProperty
Field Value
DependencyProperty
OutputItemCopyCommandProperty
Identifies the OutputItemCopyCommand property.
Declaration
public static readonly DependencyProperty OutputItemCopyCommandProperty
Field Value
DependencyProperty
OutputItemRatingChangedCommandProperty
Identifies the OutputItemRatingChangedCommand property.
Declaration
public static readonly DependencyProperty OutputItemRatingChangedCommandProperty
Field Value
DependencyProperty
OutputItemRetryCommandProperty
Identifies the OutputItemRetryCommand property.
Declaration
public static readonly DependencyProperty OutputItemRetryCommandProperty
Field Value
DependencyProperty
OutputItemsProperty
Identifies the OutputItems property.
Declaration
public static readonly DependencyProperty OutputItemsProperty
Field Value
DependencyProperty
PageCountProperty
Identifies the PageCount dependency property.
Declaration
public static readonly DependencyProperty PageCountProperty
Field Value
DependencyProperty
PageSizeProperty
Identifies the PageSize property.
Declaration
public static readonly DependencyProperty PageSizeProperty
Field Value
DependencyProperty
PagedOutputItemsProperty
Identifies the PagedOutputItems dependency property.
Declaration
public static readonly DependencyProperty PagedOutputItemsProperty
Field Value
DependencyProperty
PromptRequestCommandProperty
Identifies the PromptRequestCommand property.
Declaration
public static readonly DependencyProperty PromptRequestCommandProperty
Field Value
DependencyProperty
PromptRequestEvent
Identifies the event.
Declaration
public static readonly RoutedEvent PromptRequestEvent
Field Value
RoutedEvent
SuggestionClickedCommandProperty
Identifies the SuggestionClickedCommand property.
Declaration
public static readonly DependencyProperty SuggestionClickedCommandProperty
Field Value
DependencyProperty
SuggestionItemTemplateProperty
Identifies the SuggestionItemTemplate property.
Declaration
public static readonly DependencyProperty SuggestionItemTemplateProperty
Field Value
DependencyProperty
SuggestionsExpanderStyleProperty
Identifies the SuggestionsExpanderStyle property.
Declaration
public static readonly DependencyProperty SuggestionsExpanderStyleProperty
Field Value
DependencyProperty
SuggestionsHeaderContentProperty
Identifies the SuggestionsHeaderContent property.
Declaration
public static readonly DependencyProperty SuggestionsHeaderContentProperty
Field Value
DependencyProperty
SuggestionsHeaderContentTemplateProperty
Identifies the SuggestionsHeaderContentTemplate property.
Declaration
public static readonly DependencyProperty SuggestionsHeaderContentTemplateProperty
Field Value
DependencyProperty
SuggestionsProperty
Identifies the Suggestions property.
Declaration
public static readonly DependencyProperty SuggestionsProperty
Field Value
DependencyProperty
Properties
ActiveItem
Gets the currently active item.
Declaration
public RadAIPromptItem ActiveItem { get; }
Property Value
AreSuggestionsVisible
Gets or sets a boolean value indicating whether the RadExpander that displays the input suggestions is visible.
Commands
Gets or sets the AIPrompt commands.
Declaration
public IList<AIPromptCommandBase> Commands { get; set; }
Property Value
CurrentPageIndex
Gets of sets the index of the current page (starting from 1) in the output view.
HeaderBackground
Gets or sets the header background.
Declaration
public Brush HeaderBackground { get; set; }
Property Value
Brush
HeaderMinHeight
Gets or sets the header min height.
InputButtonContent
Gets or sets the Content of the input button.
InputButtonContentTemplate
Gets or sets the DataTemplate applied to the property of the input button.
Declaration
public DataTemplate InputButtonContentTemplate { get; set; }
Property Value
DataTemplate
InputText
Gets or sets the input text.
InputTextBoxStyle
Gets or sets the style that is to be applied to the input textbox. The style should target RadWatermarkTextBox.
Declaration
public Style InputTextBoxStyle { get; set; }
Property Value
Style
IsPagingEnabled
Gets of sets a boolean value indicating whether the AIPromptOutputItems should be paged in the output view.
MoveToFirstPageCommand
Gets or sets the command responsible for changing the current page to the first one in the output view.
Declaration
public DelegateCommand MoveToFirstPageCommand { get; set; }
Property Value
MoveToLastPageCommand
Gets or sets the command responsible for changing the current page to the last one in the output view.
Declaration
public DelegateCommand MoveToLastPageCommand { get; set; }
Property Value
MoveToNextPageCommand
Gets or sets the command responsible for changing the current page to the next one in the output view.
Declaration
public DelegateCommand MoveToNextPageCommand { get; set; }
Property Value
MoveToPreviousPageCommand
Gets or sets the command responsible for changing the current page to the previous one in the output view.
Declaration
public DelegateCommand MoveToPreviousPageCommand { get; set; }
Property Value
OutputItemCopyCommand
Gets or sets the command that is executed when the copy button in an AIPromptOutputItem is clicked.
Declaration
public ICommand OutputItemCopyCommand { get; set; }
Property Value
OutputItemRatingChangedCommand
Gets or sets the command that is executed when the rating of an AIPromptOutputItem is changed through the UI.
Declaration
public ICommand OutputItemRatingChangedCommand { get; set; }
Property Value
OutputItemRetryCommand
Gets or sets the command that is executed when the retry button in an AIPromptOutputItem is clicked.
Declaration
public ICommand OutputItemRetryCommand { get; set; }
Property Value
OutputItems
Gets or sets the output items (the responses from the AI).
Declaration
public ObservableCollection<AIPromptOutputItemModel> OutputItems { get; set; }
Property Value
PageCount
Gets the number of pages currently displayed in the output view.
PageSize
Gets of sets the number of items to display in a single page in the output view.
PagedOutputItems
Gets the collection view that holds the paged output items.
Declaration
public QueryableCollectionView PagedOutputItems { get; }
Property Value
PromptRequestCommand
Gets or sets the command that is executed when the end-user makes a request by pressing the input button or a command.
Declaration
public ICommand PromptRequestCommand { get; set; }
Property Value
SuggestionClickedCommand
Gets or sets the command that is executed when an input suggestion is clicked.
Declaration
public ICommand SuggestionClickedCommand { get; set; }
Property Value
SuggestionItemTemplate
Gets or sets DataTemplate applied to the that displays the Suggestions collection.
Declaration
public DataTemplate SuggestionItemTemplate { get; set; }
Property Value
DataTemplate
Suggestions
Gets or sets the suggestions. The default SuggestionItemTemplate expects string objects.
Declaration
public IEnumerable Suggestions { get; set; }
Property Value
Remarks
You can populate this collection with objects from a custom class and set the SuggestionItemTemplate property to customize their UI.
SuggestionsExpanderStyle
Gets or sets Style applied to the RadExpander that displays the Suggestions collection.
Declaration
public Style SuggestionsExpanderStyle { get; set; }
Property Value
Style
SuggestionsHeaderContent
Gets or sets the Content of the suggestions expander.
Declaration
public object SuggestionsHeaderContent { get; set; }
Property Value
SuggestionsHeaderContentTemplate
Gets or sets the ContentTemplate of the suggestions expander.
Declaration
public DataTemplate SuggestionsHeaderContentTemplate { get; set; }
Property Value
DataTemplate
Methods
GetContainerForItemOverride()
Declaration
protected override DependencyObject GetContainerForItemOverride()
Returns
DependencyObject
OnApplyTemplate()
Declaration
public override void OnApplyTemplate()
OnCreateAutomationPeer()
Returns an automation peer for this RadAIPrompt.
Declaration
protected override AutomationPeer OnCreateAutomationPeer()
Returns
AutomationPeer
OnInitialized(EventArgs)
Declaration
protected override void OnInitialized(EventArgs e)
Parameters
e
OnItemsChanged(NotifyCollectionChangedEventArgs)
Declaration
protected override void OnItemsChanged(NotifyCollectionChangedEventArgs e)
Parameters
e
OnOutputItemAdded()
Called when a new item is added to the OutputItems collection.
Declaration
protected virtual void OnOutputItemAdded()
OnOutputItemCopy(AIPromptOutputItemModel)
Called when the copy button of an AIPromptOutputItem is clicked.
Declaration
protected virtual void OnOutputItemCopy(AIPromptOutputItemModel outputItem)
Parameters
outputItem
The AIPromptOutputItemModel from the OutputItems collection.
OnOutputItemRatingChanged(AIPromptOutputItemModel)
Called when the rating of an AIPromptOutputItem is changed through the UI.
Declaration
protected virtual void OnOutputItemRatingChanged(AIPromptOutputItemModel outputItem)
Parameters
outputItem
The AIPromptOutputItemModel from the OutputItems collection.
OnOutputItemRetry(AIPromptOutputItemModel)
Called when the retry button of an AIPromptOutputItem is clicked.
Declaration
protected virtual void OnOutputItemRetry(AIPromptOutputItemModel outputItem)
Parameters
outputItem
The AIPromptOutputItemModel from the OutputItems collection.
OnPromptRequest(PromptRequestEventArgs)
Called when the end-user makes a request by pressing the input button or a command.
Declaration
protected virtual void OnPromptRequest(PromptRequestEventArgs args)
Parameters
args
The PromptRequestEventArgs describing the event.
OnSuggestionClicked(object)
Called when a prompt suggestion is clicked.
Declaration
protected virtual void OnSuggestionClicked(object suggestion)
Parameters
suggestion
The object from the Suggestions collection.
PrepareContainerForItemOverride(DependencyObject, object)
Declaration
protected override void PrepareContainerForItemOverride(DependencyObject element, object item)
Parameters
element
DependencyObject
item
Events
PromptRequest
Event is raised when the user initiates a prompt request.
Declaration
public event EventHandler<PromptRequestEventArgs> PromptRequest
Event Value