AIPrompt
Kendo UI AIPrompt component
Definition
Namespace:Kendo.Mvc.UI
Assembly:Kendo.Mvc.dll
Syntax:
public class AIPrompt : WidgetBase, IWidget, IHtmlAttributesContainer, IScriptableComponent
Inheritance: objectWidgetBaseAIPrompt
Implements:
Inherited Members
Constructors
Initializes a new instance of the AIPrompt class.
public AIPrompt(ViewContext viewContext, IJavaScriptInitializer initializer, IUrlGenerator urlGenerator)
The view context
initializerIJavaScriptInitializerThe JavaScriptInitializer
urlGeneratorIUrlGeneratorThe URL generator.
Properties
Specifies the index of the active view or the name of the view.
public object ActiveView { get; set; }
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.
public bool? EncodedPromptOutputs { get; set; }
The text messages displayed in the component. Use this option to customize or localize the messages.
public AIPromptMessagesSettings Messages { get; set; }
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 - "rating" - Expands to both positive and negative rating buttons - "ratingPositive" - Renders the positive rating button - "ratingNegative" - Renders the negative rating button - "spacer" - Adds spacing between action buttonsCustom actions trigger the outputAction event with the action command and output data.
public List<AIPromptOutputAction> OutputActions { get; set; }
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.
public string OutputTemplate { get; set; }
The handler for the OutputTemplate
public string OutputTemplateHandler { get; set; }
The id for the OutputTemplate
public string OutputTemplateId { get; set; }
An array of prompt outputs to display in the prompt view.
public List<AIPromptPromptOutput> PromptOutputs { get; set; }
The template of the prompt suggestion item. It can be a string, a function or a Kendo Template.
public string PromptSuggestionItemTemplate { get; set; }
The handler for the PromptSuggestionItemTemplate
public string PromptSuggestionItemTemplateHandler { get; set; }
The id for the PromptSuggestionItemTemplate
public string PromptSuggestionItemTemplateId { get; set; }
An array of prompt suggestions as strings to display in the prompt view. The suggestions can be clicked to populate the prompt input.
public ICollection<string> PromptSuggestions { get; set; }
Configuration options for the Kendo UI TextArea component used in the prompt view. Only specific properties from the Kendo UI TextArea are supported.
public AIPromptPromptTextAreaSettings PromptTextArea { get; set; }
The URL of the AI service to use for generating outputs.
public AIPromptServiceSettings Service { get; set; }
The URL of the AI service to use for generating outputs.
public string ServiceUrl { get; set; }
Specifies if the output rating should be displayed on the output card. > Note: This property is deprecated. Use the outputActions configuration instead.
public bool? ShowOutputRating { get; set; }
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.
public bool? ShowOutputSubtitleTooltip { get; set; }
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.
public AIPromptSpeechToTextSettings SpeechToText { get; set; }
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.
public List<AIPromptToolbarItem> ToolbarItems { get; set; }
An array of view configurations.
public List<AIPromptView> Views { get; set; }
Methods
public override IDictionary<string, object> Serialize()
Overrides:
Writes the HTML.
protected override void WriteHtml(HtmlTextWriter writer)
The HtmlTextWriter.
Overrides:
Writes the initialization script.
public override void WriteInitializationScript(TextWriter writer)
The TextWriter.
Overrides: