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

Defines the fluent API for configuring the Kendo UI AIPrompt

Definition

Namespace:Kendo.Mvc.UI.Fluent

Assembly:Kendo.Mvc.dll

Syntax:

C#
public class AIPromptBuilder : WidgetBuilderBase<AIPrompt, AIPromptBuilder>, IHtmlContent

Inheritance: objectHelperResultWidgetBuilderBase<AIPrompt, AIPromptBuilder>AIPromptBuilder

Implements: IHtmlContent

Inherited Members WidgetBuilderBase<AIPrompt, AIPromptBuilder>.ToComponent()WidgetBuilderBase<AIPrompt, AIPromptBuilder>.Expression(string)WidgetBuilderBase<AIPrompt, AIPromptBuilder>.Explorer(ModelExplorer)WidgetBuilderBase<AIPrompt, AIPromptBuilder>.Name(string)WidgetBuilderBase<AIPrompt, AIPromptBuilder>.Deferred(bool)WidgetBuilderBase<AIPrompt, AIPromptBuilder>.HtmlAttributes(object)WidgetBuilderBase<AIPrompt, AIPromptBuilder>.HtmlAttributes(IDictionary<string, object>)WidgetBuilderBase<AIPrompt, AIPromptBuilder>.ScriptAttributes(object, bool)WidgetBuilderBase<AIPrompt, AIPromptBuilder>.ScriptAttributes(IDictionary<string, object>, bool)WidgetBuilderBase<AIPrompt, AIPromptBuilder>.Render()WidgetBuilderBase<AIPrompt, AIPromptBuilder>.ToHtmlString()WidgetBuilderBase<AIPrompt, AIPromptBuilder>.WriteTo(TextWriter, HtmlEncoder)WidgetBuilderBase<AIPrompt, AIPromptBuilder>.ToClientTemplate()WidgetBuilderBase<AIPrompt, AIPromptBuilder>.AsModule(bool)WidgetBuilderBase<AIPrompt, AIPromptBuilder>.ComponentWidgetBuilderBase<AIPrompt, AIPromptBuilder>.ContainerHelperResult.WriteTo(TextWriter, HtmlEncoder)HelperResult.WriteActionobject.GetType()object.MemberwiseClone()object.ToString()object.Equals(object)object.Equals(object, object)object.ReferenceEquals(object, object)object.GetHashCode()...

Constructors

Initializes a new instance of the AIPromptBuilder class.

C#
public AIPromptBuilder(AIPrompt component)
Parameters:componentAIPrompt

Methods

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

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

The value for ActiveView

Returns:

AIPromptBuilder

Returns the current AIPromptBuilder instance.

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 for EncodedPromptOutputs

Returns:

AIPromptBuilder

Returns the current AIPromptBuilder instance.

Configures the client-side events.

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

The client events action.

Returns:

AIPromptBuilder

Returns the current AIPromptBuilder instance.

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 AIPromptMessagesSettingsBuilder for the messages setting.

Returns:

AIPromptBuilder

Returns the current instance of 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 for OutputTemplate

Returns:

AIPromptBuilder

Returns the current AIPromptBuilder instance.

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

Returns the current AIPromptBuilder instance.

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 templateHandler)
Parameters:templateHandlerstring

The handler that returs the template for OutputTemplate

Returns:

AIPromptBuilder

Returns the current AIPromptBuilder instance.

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 templateId)
Parameters:templateIdstring

The ID of the template element for OutputTemplate

Returns:

AIPromptBuilder

Returns the current AIPromptBuilder instance.

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(IHtmlContent templateView)
Parameters:templateViewIHtmlContent

The view that contains the template for OutputTemplate

Returns:

AIPromptBuilder

Returns the current AIPromptBuilder instance.

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

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

The AIPromptPromptOutputFactory for the promptoutputs setting.

Returns:

AIPromptBuilder

Returns the current instance of 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 for PromptSuggestionItemTemplate

Returns:

AIPromptBuilder

Returns the current AIPromptBuilder instance.

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

Returns the current AIPromptBuilder instance.

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

C#
public AIPromptBuilder PromptSuggestionItemTemplateHandler(string templateHandler)
Parameters:templateHandlerstring

The handler that returs the template for PromptSuggestionItemTemplate

Returns:

AIPromptBuilder

Returns the current AIPromptBuilder instance.

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

C#
public AIPromptBuilder PromptSuggestionItemTemplateId(string templateId)
Parameters:templateIdstring

The ID of the template element for PromptSuggestionItemTemplate

Returns:

AIPromptBuilder

Returns the current AIPromptBuilder instance.

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

C#
public AIPromptBuilder PromptSuggestionItemTemplateView(IHtmlContent templateView)
Parameters:templateViewIHtmlContent

The view that contains the template for PromptSuggestionItemTemplate

Returns:

AIPromptBuilder

Returns the current AIPromptBuilder instance.

Sets the PromptSuggestions collection

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

The collection

Returns:

AIPromptBuilder

Returns the current AIPromptBuilder instance.

Adds a suggestion to the PromptSuggestions collection.

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

The suggestion

Returns:

AIPromptBuilder

Returns the current AIPromptBuilder instance.

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 AIPromptPromptTextAreaSettingsBuilder for the prompttextarea setting.

Returns:

AIPromptBuilder

Returns the current instance of AIPromptBuilder .

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

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

The AIPromptServiceSettingsBuilder for the service setting.

Returns:

AIPromptBuilder

Returns the current instance of AIPromptBuilder .

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

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

The action name of the service setting.

controllerNamestring

The controller name of the service setting.

routeValuesobject

The route values of the service setting.

Returns:

AIPromptBuilder

Returns the current instance of AIPromptBuilder .

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

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

The action name of the service setting.

controllerNamestring

The controller name of the service setting.

routeValuesRouteValueDictionary

The route values of the service setting.

Returns:

AIPromptBuilder

Returns the current instance of AIPromptBuilder .

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

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

The action name of the service setting.

controllerNamestring

The controller name of the service setting.

Returns:

AIPromptBuilder

Returns the current instance of AIPromptBuilder .

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

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

The url of the service setting.

Returns:

AIPromptBuilder

Returns the current instance of AIPromptBuilder .

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

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

The value for ShowOutputRating

Returns:

AIPromptBuilder

Returns the current AIPromptBuilder instance.

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

Returns the current AIPromptBuilder instance.

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 for ShowOutputSubtitleTooltip

Returns:

AIPromptBuilder

Returns the current AIPromptBuilder instance.

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

Returns the current instance of AIPromptSpeechToTextSettingsBuilder .

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 AIPromptSpeechToTextSettingsBuilder for the speechtotext setting.

Returns:

AIPromptBuilder

Returns the current instance of 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

Returns the current instance of AIPromptSpeechToTextSettingsBuilder .

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 AIPromptToolbarItemFactory for the toolbaritems setting.

Returns:

AIPromptBuilder

Returns the current instance of AIPromptBuilder .

An array of view configurations.

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

The AIPromptViewFactory for the views setting.

Returns:

AIPromptBuilder

Returns the current instance of AIPromptBuilder .