AIPrompt

Example

Razor
<kendo-aiprompt>
    <aiprompt-views></aiprompt-views>
    <messages />
    <output-actions></output-actions>
    <prompt-outputs></prompt-outputs>
    <prompt-text-area></prompt-text-area>
    <service />
    <speech-to-text />
    <toolbar-items></toolbar-items>
</kendo-aiprompt>

ChildTags

Attributes

AttributeTypeDescription
nameStringSets the name of the component.
active-viewObjectSpecifies the index of the active view or the name of the view.
as-moduleBooleanSpecifies whether the initialization script of the component will be rendered as a JavaScript module.
encoded-prompt-outputsBooleanSpecifies 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.
on-command-executeStringThe name of the JavaScript function that will handle the commandExecute event. Triggered when a command item from the Commands view is clicked. The panel bar dataItem of the selected item is available through the event argument.
on-output-actionStringThe name of the JavaScript function that will handle the outputAction event. Triggered when an action button on an output card is clicked. This event is fired for both built-in and custom actions.
on-output-copyStringThe name of the JavaScript function that will handle the outputCopy event. Triggered when the copy output button of an output is clicked. The prompt and the output object are available through the event argument.
on-output-rating-changeStringThe name of the JavaScript function that will handle the outputRatingChange event. Triggered when the rating of an output is changed through the rate buttons of an output. The output id and the new rating are available through the event argument.
on-prompt-requestStringThe name of the JavaScript function that will handle the promptRequest event. Triggered when the prompt view Generate output button is clicked. The prompt text is available through the event argument. Suitable to make a request to the AI service to receive an output. Use the addPromptOutput method to add the generated output to the promptOutputs collection.The prompt, output, history and isRetry properties are available in the event argument. When the output is generated after clicking the retry button of an output, the isRetry property is true and the output property is the output content of the output card. The history property is an array of prompt outputs generated before the current output.
on-prompt-request-cancelStringThe 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.
on-prompt-responseStringThe name of the JavaScript function that will handle the promptResponse event. Triggered when the AI service response is received. The response data is available through the event argument. Triggered only when the serviceUrl option is set.
output-templateStringA 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.
output-template-idStringA 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. This option expects the ID of the script element that contains the template.
is-in-client-templateBooleanWhen placing a Tag Helper within a Kendo Template, set the type to text/html and add the is-in-client-template="true" attribute.
output-template-handlerStringA 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. This option expects the name of a JavaScript function that will be called to return the template.
output-template-viewIHtmlContentA 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. This option expects the instance containing the created HTML.
prompt-suggestion-item-templateStringThe template of the prompt suggestion item. It can be a string, a function or a Kendo Template.
prompt-suggestion-item-template-handlerStringThe template of the prompt suggestion item. It can be a string, a function or a Kendo Template. This option expects the name of a JavaScript function that will be called to return the template.
prompt-suggestion-item-template-viewIHtmlContentThe template of the prompt suggestion item. It can be a string, a function or a Kendo Template. This option expects the instance containing the created HTML.
script-attributesIDictionary<String,Object>Sets the attributes that will be added to the script tag of the component's initialization script.
show-output-ratingBooleanSpecifies if the output rating should be displayed on the output card.
show-output-subtitle-tooltipBooleanControls 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.
deferredBooleanSuppress initialization script rendering. Note that this options should be used in conjunction with DeferredScripts method.
prompt-suggestion-item-template-idStringThe template of the prompt suggestion item. It can be a string, a function or a Kendo Template. This option expects the ID of the script element that contains the template.
prompt-suggestionsICollection<String>An array of prompt suggestions as strings to display in the prompt view. The suggestions can be clicked to populate the prompt input.
In this article
ExampleChildTagsAttributes
Not finding the help you need?
Contact Support