Kendo UI InlineAIPrompt TagHelper InlineAIPromptTagHelper class.
Definition
Namespace:Kendo.Mvc.TagHelpers
Assembly:Kendo.Mvc.dll
Syntax:
[HtmlTargetElement("kendo-inlineaiprompt")]
[RestrictChildren("service", new string[] { "popup", "speech-to-text", "commands", "output-actions", "messages", "response-template" })]
public class InlineAIPromptTagHelper : TagHelperBase, ITagHelper, ITagHelperComponent, ITemplateComponent
Inheritance: objectTagHelperTagHelperBaseInlineAIPromptTagHelper
Implements:
Inherited Members
Example:
@addTagHelper *, Kendo.Mvc
<kendo-inlineaiprompt name="inlineAi"
placeholder="Type your prompt here..."
system-prompt="systemPrompt"
readonly="false"
on-prompt-request="onPromptRequest"
on-prompt-request-cancel="onPromptRequestCancel" >
<popup width="400" />
<speech-to-text enabled="true" />
<commands>
<command id="funnier" icon="star" text="Make the text funnier" prompt="funnierHandler" />
<command id="explain" icon="question" text="Explain the text" prompt="explainHandler" />
</commands>
</kendo-inlineaiprompt>
Child Tags
Constructors
Creates a InlineAIPromptTagHelper instance.
public InlineAIPromptTagHelper(IKendoHtmlGenerator generator)
Properties
Specifies whether the underlying TextArea widget will be disabled or not.
public bool? Enable { 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; }
Sets the widget in a streaming mode.
public bool? IsStreaming { get; set; }
The name of the JavaScript function that will handle the commandExecute event. Triggered once a command is selected.
public string OnCommandExecute { get; set; }
The name of the JavaScript function that will handle the hide event. Triggered once the component has been closed programmatically.
public string OnHide { get; set; }
The name of the JavaScript function that will handle the kendoKeydown event. Triggered when the user presses a keyboard key while the InlineAIPrompt is focused.The event handler function context (available via the this keyword) will be set to the widget instance.
public string OnKendoKeydown { get; set; }
The name of the JavaScript function that will handle the outputAction event. This event will be fired with the button options that will be received, after the command has finished. Currently, these would be the Copy, Retry, and Discard options.
public string OnOutputAction { get; set; }
The name of the JavaScript function that will handle the promptRequest event. Triggered before a request has been initiated to the specified service.
public string OnPromptRequest { get; set; }
The name of the JavaScript function that will handle the promptRequestCancel event. Triggered when a prompt request is cancelled, typically by clicking the stop generation button during streaming operations.
public string OnPromptRequestCancel { get; set; }
The name of the JavaScript function that will handle the promptResponse event. Triggered once a response has been sent back from the specified service.
public string OnPromptResponse { get; set; }
The name of the JavaScript function that will handle the show event. Triggered once the component has been opened programmatically.
public string OnShow { get; set; }
Specifies the placeholder text for the underlying TextArea widget.
public string Placeholder { get; set; }
Specifies whether the underlying TextArea widget will be readonly or not.
public bool? Readonly { get; set; }
A template function for customizing the display of output content. This function is called when an output's and final content needs to be rendered.The function receives an object with output (the output data) and prompt (the output prompt text) properties and should return HTML string.
public string ResponseTemplate { get; set; }
A template function for customizing the display of output content. This function is called when an output's and final content needs to be rendered.The function receives an object with output (the output data) and prompt (the output prompt text) properties and should return HTML string. This option expects the name of a JavaScript function that will be called to return the template.
public string ResponseTemplateHandler { get; set; }
A template function for customizing the display of output content. This function is called when an output's and final content needs to be rendered.The function receives an object with output (the output data) and prompt (the output prompt text) properties and should return HTML string. This option expects the ID of the script element that contains the template.
public string ResponseTemplateId { get; set; }
A template function for customizing the display of output content. This function is called when an output's and final content needs to be rendered.The function receives an object with output (the output data) and prompt (the output prompt text) properties and should return HTML string. This option expects the IHtmlContent instance containing the created HTML.
public IHtmlContent ResponseTemplateView { get; set; }
Sets the systemPrompt's format which will be send to the specified AI Service. Exposes both a context and prompt metadata.
public string SystemPrompt { get; set; }
Configures the templates for the InlineAIPrompt.
[HtmlAttributeNotBound]
public IDictionary<string, string> Templates { get; }
Implements:
Methods
GetInitializationScript method.
public override Task ProcessAsync(TagHelperContext context, TagHelperOutput output)
Overrides:
Serializes the Inline AI Prompt settings.
public override IDictionary<string, object> Serialize()
Overrides:
SerializeEvents method.
protected override Dictionary<string, object> SerializeEvents()
Overrides:
SerializeSettings method.
protected override Dictionary<string, object> SerializeSettings()
Overrides:
Serializes the defined templates.
protected override Dictionary<string, object> SerializeTemplates()
Overrides:
WriteHtml method.
protected override void WriteHtml(TagHelperOutput output)
Overrides: