New to Telerik UI for ASP.NET MVC? Start a free 30-day trial

Defines the fluent API for configuring the Kendo AIPrompt for ASP.NET MVC.

Definition

Constructors

Initializes a new instance of the AIPrompt class.

C#
public AIPromptBuilder(AIPrompt component)
Parameters:componentAIPrompt

The component.

Methods

Specifies the index of the active view or the name of the view.

C#
public AIPromptBuilder ActiveView(object value)
Parameters:valueobject

The value that configures the activeview.

Returns:

AIPromptBuilder

Specifies whether the prompt outputs are HTML-encoded before being displayed in the output view. When set to true (default), the output is encoded and displayed as plain text, preventing any HTML formatting or scripts from being rendered.

C#
public AIPromptBuilder EncodedPromptOutputs(bool value)
Parameters:valuebool

The value that configures the encodedpromptoutputs.

Returns:

AIPromptBuilder

Configures the client-side events.

C#
public AIPromptBuilder Events(Action<AIPromptEventBuilder> configurator)
Parameters:configuratorAction<AIPromptEventBuilder>

The client events action.

Returns:

AIPromptBuilder

Example:
C#
@(Html.Kendo().AIPrompt()
.Name("AIPrompt")
.Events(events =&gt; events
.CommandExecute("onCommandExecute")
)
)

The text messages displayed in the component. Use this option to customize or localize the messages.

C#
public AIPromptBuilder Messages(Action<AIPromptMessagesSettingsBuilder> configurator)
Parameters:configuratorAction<AIPromptMessagesSettingsBuilder>

The action that configures the messages.

Returns:

AIPromptBuilder

An array of action configurations for the output cards. Can contain strings for built-in actions or objects with custom action properties.Built-in actions: - "copy" - Copy output content to clipboard. - "retry" - Retry generating the output. - "discard" - Clears the output content and closes the popup.Custom actions trigger the outputAction event with the action command and output data.

C#
public AIPromptBuilder OutputActions(Action<AIPromptOutputActionFactory> configurator)
Parameters:configuratorAction<AIPromptOutputActionFactory>

The AIPromptOutputActionFactory for the outputactions setting.

Returns:

AIPromptBuilder

Returns the current instance of AIPromptBuilder .

A template function for customizing the display of output content. This function is called when an output has finished streaming and final content needs to be rendered.The function receives an object with output (the output data) and content (the output text) properties and should return HTML string.

C#
public AIPromptBuilder OutputTemplate(string value)
Parameters:valuestring

The value that configures the outputtemplate.

Returns:

AIPromptBuilder

A template function for customizing the display of output content. This function is called when an output has finished streaming and final content needs to be rendered.The function receives an object with output (the output data) and content (the output text) properties and should return HTML string.

C#
public AIPromptBuilder OutputTemplate<TModel>(TemplateBuilder<TModel> template)
Parameters:templateTemplateBuilder<TModel>

A Template component that configures the outputtemplate.

Returns:

AIPromptBuilder

A template function for customizing the display of output content. This function is called when an output has finished streaming and final content needs to be rendered.The function receives an object with output (the output data) and content (the output text) properties and should return HTML string.

C#
public AIPromptBuilder OutputTemplateHandler(string value)
Parameters:valuestring

The value that configures the outputtemplate.

Returns:

AIPromptBuilder

A template function for customizing the display of output content. This function is called when an output has finished streaming and final content needs to be rendered.The function receives an object with output (the output data) and content (the output text) properties and should return HTML string.

C#
public AIPromptBuilder OutputTemplateId(string value)
Parameters:valuestring

The value that configures the outputtemplate.

Returns:

AIPromptBuilder

A template function for customizing the display of output content. This function is called when an output has finished streaming and final content needs to be rendered.The function receives an object with output (the output data) and content (the output text) properties and should return HTML string.

C#
public AIPromptBuilder OutputTemplateView(MvcHtmlString value)
Parameters:valueMvcHtmlString

The value that configures the outputtemplate.

Returns:

AIPromptBuilder

An array of prompt outputs to display in the prompt view.

C#
public AIPromptBuilder PromptOutputs(Action<AIPromptPromptOutputFactory> configurator)
Parameters:configuratorAction<AIPromptPromptOutputFactory>

The action that configures the promptoutputs.

Returns:

AIPromptBuilder

The template of the prompt suggestion item. It can be a string, a function or a Kendo Template.

C#
public AIPromptBuilder PromptSuggestionItemTemplate(string value)
Parameters:valuestring

The value that configures the promptsuggestionitemtemplate.

Returns:

AIPromptBuilder

The template of the prompt suggestion item. It can be a string, a function or a Kendo Template.

C#
public AIPromptBuilder PromptSuggestionItemTemplate<TModel>(TemplateBuilder<TModel> template)
Parameters:templateTemplateBuilder<TModel>

A Template component that configures the promptsuggestionitemtemplate.

Returns:

AIPromptBuilder

The template of the prompt suggestion item. It can be a string, a function or a Kendo Template.

C#
public AIPromptBuilder PromptSuggestionItemTemplateHandler(string value)
Parameters:valuestring

The value that configures the promptsuggestionitemtemplate.

Returns:

AIPromptBuilder

The template of the prompt suggestion item. It can be a string, a function or a Kendo Template.

C#
public AIPromptBuilder PromptSuggestionItemTemplateId(string value)
Parameters:valuestring

The value that configures the promptsuggestionitemtemplate.

Returns:

AIPromptBuilder

The template of the prompt suggestion item. It can be a string, a function or a Kendo Template.

C#
public AIPromptBuilder PromptSuggestionItemTemplateView(MvcHtmlString value)
Parameters:valueMvcHtmlString

The value that configures the promptsuggestionitemtemplate.

Returns:

AIPromptBuilder

Sets the PromptSuggestions collection

C#
public AIPromptBuilder PromptSuggestions(ICollection<string> value)
Parameters:valueICollection<string>

The collection

Returns:

AIPromptBuilder

Adds a suggestion to the PromptSuggestions collection.

C#
public AIPromptBuilder PromptSuggestions(string value)
Parameters:valuestring

The suggestion

Returns:

AIPromptBuilder

Configuration options for the Kendo UI TextArea component used in the prompt view. Only specific properties from the Kendo UI TextArea are supported.

C#
public AIPromptBuilder PromptTextArea(Action<AIPromptPromptTextAreaSettingsBuilder> configurator)
Parameters:configuratorAction<AIPromptPromptTextAreaSettingsBuilder>

The action that configures the prompttextarea.

Returns:

AIPromptBuilder

The URL of the AI service to use for generating outputs.

C#
public AIPromptBuilder Service(Action<AIPromptServiceSettingsBuilder> configurator)
Parameters:configuratorAction<AIPromptServiceSettingsBuilder>

The action that configures the service.

Returns:

AIPromptBuilder

Specifies the URL of the AI service to use for generating outputs.

C#
public AIPromptBuilder Service(string actionName, string controllerName, object routeValues)
Parameters:actionNamestring

The name of tha action.

controllerNamestring

The name of the controller.

routeValuesobject

The route values.

Returns:

AIPromptBuilder

Specifies the URL of the AI service to use for generating outputs.

C#
public AIPromptBuilder Service(string actionName, string controllerName, RouteValueDictionary routeValues)
Parameters:actionNamestring

The name of tha action.

controllerNamestring

The name of the controller.

routeValuesRouteValueDictionary

The route values.

Returns:

AIPromptBuilder

Specifies the URL of the AI service to use for generating outputs.

C#
public AIPromptBuilder Service(string actionName, string controllerName)
Parameters:actionNamestring

The name of the action.

controllerNamestring

The name of the controller.

Returns:

AIPromptBuilder

Specifies the URL of the AI service to use for generating outputs.

C#
public AIPromptBuilder Service(string value)
Parameters:valuestring

The url.

Returns:

AIPromptBuilder

Specifies if the output rating should be displayed on the output card. > Note: This property is deprecated. Use the outputActions configuration instead.

C#
[Obsolete("This option is obsolete since Q3 2025 and will be removed in future releases")]
public AIPromptBuilder ShowOutputRating(bool value)
Parameters:valuebool

The value that configures the showoutputrating.

Returns:

AIPromptBuilder

Controls whether the subtitle of the card in the output view displays a tooltip containing the full content of the subtitle, which is the prompt used to generate the output.

C#
public AIPromptBuilder ShowOutputSubtitleTooltip()
Returns:

AIPromptBuilder

Controls whether the subtitle of the card in the output view displays a tooltip containing the full content of the subtitle, which is the prompt used to generate the output.

C#
public AIPromptBuilder ShowOutputSubtitleTooltip(bool value)
Parameters:valuebool

The value that configures the showoutputsubtitletooltip.

Returns:

AIPromptBuilder

Configures speech-to-text functionality for the prompt input. When true, enables speech-to-text with default settings. When false, disables the feature. When an object, configures custom speech-to-text options.

C#
public AIPromptBuilder SpeechToText()
Returns:

AIPromptBuilder

Configures speech-to-text functionality for the prompt input. When true, enables speech-to-text with default settings. When false, disables the feature. When an object, configures custom speech-to-text options.

C#
public AIPromptBuilder SpeechToText(Action<AIPromptSpeechToTextSettingsBuilder> configurator)
Parameters:configuratorAction<AIPromptSpeechToTextSettingsBuilder>

The action that configures the speechtotext.

Returns:

AIPromptBuilder

Configures speech-to-text functionality for the prompt input. When true, enables speech-to-text with default settings. When false, disables the feature. When an object, configures custom speech-to-text options.

C#
public AIPromptBuilder SpeechToText(bool enabled)
Parameters:enabledbool

Enables or disables the speechtotext option.

Returns:

AIPromptBuilder

An array of toolbar items to display in the header Toolbar. They will be rendered after the items generated from the configurations of the views.

C#
public AIPromptBuilder ToolbarItems(Action<AIPromptToolbarItemFactory> configurator)
Parameters:configuratorAction<AIPromptToolbarItemFactory>

The action that configures the toolbaritems.

Returns:

AIPromptBuilder

An array of view configurations.

C#
public AIPromptBuilder Views(Action<AIPromptViewFactory> configurator)
Parameters:configuratorAction<AIPromptViewFactory>

The action that configures the views.

Returns:

AIPromptBuilder