• Introduction
  • Getting Started
  • Vue 2 End of Support
  • Native Components
    • Animation
    • Buttons
    • Chartsupdated
    • Conversational UInew
    • Data Query
    • Data Tools
    • Date Inputs
    • Date Math
    • Dialogs
    • Drawing
    • Dropdownsupdated
    • Editor
    • Excel Export
    • File Saver
    • Form
    • Gauges
    • Grid
    • Icons
    • Indicators
    • Inputs
    • Labels
    • Layoutupdated
    • ListBox
    • ListView
    • Notification
    • PDF Processing
    • Popup
    • Progress Bars
    • Scheduler
    • ScrollView
    • Tooltip
    • TreeList
    • TreeView
    • Upload
  • Wrapper Components
  • Sample Applications
  • Styling & Themes
  • Common Features
  • Project Setup
  • Knowledge Base
  • Changelog
  • FAQ
  • Troubleshooting

Getting Started with the Kendo UI for Vue Conversational UI

This guide provides essential information about using the Kendo UI for Vue AIPrompt component, part of the Conversational UI package in the Kendo UI for Vue Native suite. In this page you will learn how to:

  • Install the Conversational UI package that provides the AIPrompt
  • Add the AIPrompt component to your Vue project and apply basic configurations to it.
  • Style the component and activate your product license.
The Conversational UI Package is part of Kendo UI for Vue, a professional grade UI library with 100+ components for building modern and feature-rich applications. To try it out sign up for a free 30-day trial.

After completing this guide, you will be able to reproduce the following example.

Example
View Source
Change Theme:

Setting Up Your Vue Project

Before you install the Kendo UI for Vue AIPrompt, make sure that you have a running Vue project. The easiest way to set up a Vue project is to use the approach described in the Set up the Vue project section of the First Steps with JavaScript article.

Installing the Conversational UI Package

All Kendo UI for Vue packages are distributed through npm and offer a similar installation experience. To use the AIPrompt component, start with the installation of the Conversational UI npm package and its dependencies.

npm install --save @progress/kendo-vue-conversational-ui @progress/kendo-vue-buttons @progress/kendo-vue-layout @progress/kendo-vue-inputs @progress/kendo-vue-progressbars @progress/kendo-licensing @progress/kendo-drawing @progress/kendo-svg-icons @progress/kendo-vue-intl

Importing the Component

After installing the package, import the AIPrompt component in the Vue App.

In the src/App.vue file of your Vue project, import the AIPrompt, AIPromptView and AIPromptOutputView components together with the outputViewDefaults and promptViewDefaults default configurations from the Conversational UI package.

// ES2015 module syntax
import { AIPrompt, AIPromptOutputView, AIPromptView, outputViewDefaults, promptViewDefaults } from "@progress/kendo-vue-conversational-ui";
// CommonJS format
const { AIPrompt, AIPromptOutputView, AIPromptView, outputViewDefaults, promptViewDefaults } = require('@progress/kendo-vue-conversational-ui');

Using the Component

  1. Define the AIPrompt, AIPromptView and AIPromptOutputView components

       <AIPrompt>
          <AIPromptView />
          <AIPromptOutputView />
       </AIPrompt>
  2. Next, define the following:

  • activeView property that sets the currently visible view for the component.
  • onActiveViewChange event triggered when the component's view is changed.
  • onPromptRequest event which is triggered when the user clicks the Generate button in the Prompt view.

Finally pass promptViewDefaults and outputViewDefaults to the toolbarItems prop and define the outputs property in the AIPromptOutputView component.

   <AIPrompt
      :activeView="activeView"
      @activeviewchange="handleActiveViewChange"
      @promptrequest="handleOnRequest"
      :toolbarItems="[promptViewDefaults, outputViewDefaults]"
   >
      <AIPromptView />
      <AIPromptOutputView :outputs="outputs" />
   </AIPrompt>
  1. Add the following data properties and methods:

       components: {
          AIPrompt,
          AIPromptOutputView,
          AIPromptView,
       },
       data: function () {
          return {
             outputViewDefaults,
             promptViewDefaults,
             activeView: promptViewDefaults.name,
             outputs: [],
          };
       },
       methods: {
          handleOnRequest(prompt, outputItem) {
             if (!prompt) {
             return;
             }
    
             this.outputs = [
             {
                id: this.outputs.length + 1,
                title: "Title",
                subTitle: `Request ${this.outputs.length + 1}`,
                responseContent: `Response content for prompt ${
                   prompt + ". Generation: " + this.outputs.length
                }`,
                prompt,
             },
             ...this.outputs,
             ];
             this.activeView = outputViewDefaults.name;
          },
          handleActiveViewChange(viewName) {
             this.activeView = viewName;
          },
       }
  2. To make the AIPrompt look correctly, install and import the Kendo UI Default Theme, which is one of the four beautiful themes for Kendo UI for Vue.

    1. Install the Default theme package.

      npm install --save @progress/kendo-theme-default
    2. Import the Theme package in src/App.vue.

      import '@progress/kendo-theme-default';
  3. Build, run and test the application by typing the following command in the root folder of your project:

    npm run dev
    

Activating Your License Key

Using any of the UI components in the Kendo UI for Vue Native library requires either a commercial license key or an active trial license key.

Follow the instructions on the My License page to activate your trial or commercial license. You can skip this step if your application already contains a Kendo UI for Vue license file.

Dependencies

The Conversational UI package requires you to install the following peer dependencies in your application:

Package NameDescription
vue 2.6.14 or 3.0.0+Contains the functionality necessary to define Vue components.
@progress/kendo-licensingContains the internal infrastructure related to licensing.
@progress/kendo-vue-buttonsContains the Kendo UI for Vue Buttons components.
@progress/kendo-vue-layoutsContains all layout related components part of the Kendo UI for Vue suite.
@progress/kendo-vue-inputsContains the Inputs available in Kendo UI for Vue.
@progress/kendo-vue-progressbarsContains the Kendo UI for Vue components that display progress.
@progress/kendo-vue-intlContains the Kendo UI for Vue Internationalization package that applies the desired cultures by providing services and pipes for the parsing and formatting of dates and numbers.
@progress/kendo-svg-iconsContains the Kendo UI for Vue SVG icons.

Vue 2 is currently in its end-of-support phase till Nov 2024. After our last major release for 2024, Vue 2 will no longer be supported in the new versions of the Kendo UI for Vue components. Please check our Vue 2 End of Support article for more details.

Learning Resources