TelerikAIPrompt
A component that enables you to compose AI interactions with a prompt input and a list of messages (outputs). It lets you execute predefined commands, switch between Prompt, Output, and Command views, and add custom views with ToolBar navigation.
Definition
Namespace:Telerik.Blazor.Components
Assembly:Telerik.Blazor.dll
Syntax:
public class TelerikAIPrompt : AIPromptBase, IComponent, IHandleEvent, IHandleAfterRender, IDisposable
Inheritance: objectComponentBaseBaseComponentAIPromptBaseTelerikAIPrompt
Implements:
Inherited Members
Constructors
public TelerikAIPrompt()
Methods
public void AddItem(IAIPromptToolBarItem item)
protected override void BuildRenderTree(RenderTreeBuilder __builder)
Overrides:
protected override void OnParametersSet()
Overrides:
Re-renders the component.
public void Refresh()
public void RemoveItem(IAIPromptToolBarItem item)
protected void SetActiveView(AIPromptViewBase view, bool forceFocus = true)
public override Task SetParametersAsync(ParameterView parameters)
Overrides:
Properties
Defines the settings for the AI prompt component. Children: AIPromptSpeechToTextButtonSettings.
[Parameter]
public RenderFragment AIPromptSettings { get; set; }
Additional action buttons for the toolbar. These won't replace the buttons you got for the views. AIPromptToolBarButton, AIPromptToolBarSpacer and AIPromptToolBarTemplateItem items are supported. Children: AIPromptToolBarButton, AIPromptToolBarSpacer, AIPromptToolBarTemplateItem.
[Parameter]
public RenderFragment AIPromptToolBar { get; set; }
The Views of the component. Children: AIPromptPromptView, AIPromptOutputView, AIPromptCommandView, AIPromptCustomView.
[Parameter]
public RenderFragment AIPromptViews { get; set; }
Defines the Commands of the component.
[Parameter]
public List<AIPromptCommandDescriptor> Commands { get; set; }
Specifies whether to enable speech to text functionality.
[Parameter]
public bool EnableSpeechToText { get; set; }
[Parameter]
public EventCallback<AIPromptCommandExecuteEventArgs> OnCommandExecute { get; set; }
Event callback that is triggered when an output action is clicked.
[Parameter]
public EventCallback<AIPromptOutputActionClickEventArgs> OnOutputActionClick { get; set; }
[Parameter]
public EventCallback<AIPromptPromptRequestEventArgs> OnPromptRequest { get; set; }
Defines the output actions for each output.
[Parameter]
public List<AIPromptOutputActionDescriptor> OutputActions { get; set; }
Defines the Output Item Template of the component.
[Parameter]
public RenderFragment<AIPromptOutputItemTemplateContext> OutputItemTemplate { get; set; }
Defines the Prompt Suggestion Item template of the component.
[Parameter]
public RenderFragment<AIPromptSuggestionItemTemplateContext> PromptSuggestionItemTemplate { get; set; }
Defines the Prompt Suggestions of the component.
[Parameter]
public List<string> PromptSuggestions { get; set; }