New to Telerik UI for BlazorStart a free 30-day trial

A component that enables you to prompt inline near a selection and display AI outputs in a popup. Supports output actions (Retry, Copy, Discard), optional speech-to-text, custom commands, and callbacks for prompt and command execution. Provides methods to show/hide at coordinates and integrates with when callbacks are not supplied.

Definition

Namespace:Telerik.Blazor.Components

Assembly:Telerik.Blazor.dll

Syntax:

C#
public class TelerikInlineAIPrompt : AIPromptBase, IComponent, IHandleEvent, IHandleAfterRender, IDisposable

Inheritance: objectComponentBaseBaseComponentAIPromptBaseTelerikInlineAIPrompt

Implements: IComponentIDisposableIHandleAfterRenderIHandleEvent

Inherited Members AIPromptBase.OnInitializedAsync()AIPromptBase.PromptContextAIPromptBase.SystemPromptAIPromptBase.OnPromptRequestStopAIPromptBase.PromptAIPromptBase.PromptChangedAIPromptBase.PromptPlaceholderBaseComponent.ShouldRender()BaseComponent.Dispose()BaseComponent.InitLocalizer()BaseComponent.ThrowIfParameterIsNull(object, string)BaseComponent.HaveOptionsChanged(IDictionary<string, object>, IDictionary<string, object>)BaseComponent.GetClassString(params string[])BaseComponent.InvokeAsync<T>(string, params object[])BaseComponent.InvokeAsync<T>(string, CancellationToken, params object[])BaseComponent.InvokeVoidAsync(string, params object[])BaseComponent.InvokeVoidAsyncWithoutAwait(string, params object[])BaseComponent.InvokeComponentMethodAsync<T>(string, params object[])BaseComponent.InvokeComponentMethodAsync<T>(string, CancellationToken, params object[])BaseComponent.InvokeVoidComponentMethodAsync(string, params object[])BaseComponent.InvokeComponentVoidMethodAsync(string, object)BaseComponent.InvokeDisposeAsync()BaseComponent.StateHasChanged()BaseComponent.RootComponentBaseComponent.ClassComponentBase.OnInitialized()ComponentBase.OnParametersSet()ComponentBase.OnParametersSetAsync()ComponentBase.OnAfterRender(bool)ComponentBase.InvokeAsync(Action)ComponentBase.InvokeAsync(Func<Task>)ComponentBase.DispatchExceptionAsync(Exception)...

Constructors

C#
public TelerikInlineAIPrompt()

Methods

Appends output to the current output item in the inline prompt.

C#
public void AppendOutput(string output)
Parameters:outputstring
C#
protected override void BuildRenderTree(RenderTreeBuilder __builder)
Parameters:__builderRenderTreeBuilder

Overrides: ComponentBase.BuildRenderTree(RenderTreeBuilder)

Hides the inline prompt.

C#
public Task HideAsync()
Returns:

Task

C#
protected override Task OnAfterRenderAsync(bool firstRender)
Parameters:firstRenderboolReturns:

Task

Overrides: BaseComponent.OnAfterRenderAsync(bool)

Refresh the component.

C#
public void Refresh()
C#
public override Task SetParametersAsync(ParameterView parameters)
Parameters:parametersParameterViewReturns:

Task

Overrides: ComponentBase.SetParametersAsync(ParameterView)

Shows the inline prompt at defined coordinates.

C#
public Task ShowAsync(double clientX, double clientY)
Parameters:clientXdouble

Coordinate for X axis.

clientYdouble

Coordinate for Y axis.

Returns:

Task

Properties

Defines the Commands of the component.

C#
[Parameter]
public List<InlineAIPromptCommandDescriptor> Commands { get; set; }

Specifies whether to enable speech to text functionality.

C#
[Parameter]
public bool EnableSpeechToText { get; set; }

Container to define settings.

C#
[Parameter]
public RenderFragment InlineAIPromptSettings { get; set; }

Event callback that is triggered when a command is executed. If not provided the component will try to execute the command using an service.

C#
[Parameter]
public EventCallback<InlineAIPromptCommandExecuteEventArgs> OnCommandExecute { get; set; }

Event callback that is triggered when an output action is clicked.

C#
[Parameter]
public EventCallback<InlineAIPromptOutputActionClickEventArgs> OnOutputActionClick { get; set; }

Event callback that is triggered when a prompt request is made. If not provided the component will try to prompt LLM using an service.

C#
[Parameter]
public EventCallback<InlineAIPromptPromptRequestEventArgs> OnPromptRequest { get; set; }

Defines the output actions for each output.

C#
[Parameter]
public List<InlineAIPromptOutputActionDescriptor> OutputActions { get; set; }

Defines how the output items are displayed in the inline prompt.

C#
[Parameter]
public RenderFragment<InlineAIPromptOutputItemTemplateContext> OutputTemplate { get; set; }

Placeholder text for the input field.

C#
[Parameter]
public string Placeholder { get; set; }