New to Kendo UI for Vue? Start a free 30-day trial

AIPrompt

Component

Represents the Kendo UI for Vue AIPrompt component. Accepts properties of type AIPromptProps.

Definition

Package:@progress/kendo-vue-conversational-ui

Properties Interface:AIPromptProps

Syntax:

vue
<AIPrompt
    :active-view="activeView"
    :toolbar-items="[promptViewDefaults, outputViewDefaults]"
    :loading="isLoading"
    :streaming="isStreaming"
    :suggestions-view="'modern'"
    @activeviewchange="onActiveViewChange"
    @promptrequest="onPromptRequest"
>
    <AIPromptView :prompt-suggestions="['Summarize order #10248']" />
    <AIPromptOutputView :outputs="outputs" />
</AIPrompt>

Properties

Sets the name of the active view. The AIPrompt shows the view with the matching name.

dir?

string

Sets the dir HTML attribute of the AIPrompt. Use it to switch between LTR and RTL.

loading?

boolean

Sets the AIPrompt in a loading state. When you set it to true, the Output view shows a loading skeleton.

onActiveviewchange?

(name: string) => void

Fires when the active view changes. Exposes the name of the new active view as event data.

Parameters:namestring

onCancel?

() => void

Fires when the user cancels the generation with the stop button or the Esc key.

Fires each time the user clicks a command in the Commands view. Exposes the selected command as event data.

Parameters:commandAIPromptCommandInterface

onPromptrequest?

(prompt: string, outputItem: AIPromptOutputInterface) => void

Fires when the user clicks the Generate button in the Prompt view, or the Retry or rating buttons in the Output view. Exposes the prompt and the related output as event data.

Parameters:prompt?stringoutputItem?AIPromptOutputInterface

Sets the generated prompt outputs that the Output view renders.

Sets the placeholder text of the textarea in the Prompt view.

streaming?

boolean

Sets the AIPrompt in a streaming state. When you set it to true, the Output view shows a stop button. The user can click it to cancel the generation.

Sets the style of the suggestions in the AIPrompt.

The available options are:

  • classic - Renders the suggestions with a rectangular style.
  • modern - Renders the suggestions with a chip-like style.
Default:

'classic'

Sets the items of the Toolbar. These items replace the default Toolbar items.