New to Kendo UI for jQueryStart a free 30-day trial

Ai.aiPrompt

configuration

Defines the configuration options for the side panel AI Prompt tool in the Editor. If set to false, the side panel AI Prompt tool is disabled.

ai.aiPrompt

Object|Boolean
<textarea id="editor"></textarea>
<script>
$("#editor").kendoEditor({
  ai: {
    aiPrompt: {
      // configuration options for the AI prompt
    }
  }
});
</script>

Defines the commands for the side panel AI Prompt tool. The commands are displayed in the side panel AI Prompt dropdown.

<textarea id="editor"></textarea>
<script>
$("#editor").kendoEditor({
  ai: {
    aiPrompt: {
      commands: [
        {
          id: "1",
          text: "Make the text funnier",
          icon: "star",
          prompt: (context) => `Make the following text funnier: ${context}`
        }
      ]
    }
  }
});
</script>

Defines the suggestions for the side panel AI Prompt tool. The suggestions are displayed in the side panel AIPrompt tool.

<textarea id="editor"></textarea>
<script>
$("#editor").kendoEditor({
    ai: {
        aiPrompt: {
            promptSuggestions: [
                "Summarize this text",
                "Improve grammar",
                "Make it more formal",
                "Translate to Spanish"
            ]
        }
    }
});
</script>

Defines the system prompt for the side panel AI Prompt tool. The function accepts the following arguments:

  • context - The selected text in the editor.
  • prompt - The user prompt.
<textarea id="editor"></textarea>
<script>
$("#editor").kendoEditor({
  ai: {
    aiPrompt: {
      systemPrompt: (context, prompt) => `You are an advanced AI language assistant.
                            A user has selected a portion of their text and provided a query regarding how they want it modified.
                            Your task is to accurately respond to their request while preserving the original intent of the text.
                            Follow the instructions strictly and provide only the requested output unless explicitly asked to explain your changes.

                            Selected Text:
                            ${context}

                            User's Request:
                            ${prompt}

                            Response:`
    }
  }
});
</script>