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

Ai.commands

configuration

Defines the shared fast commands for the side panel AI Prompt tool and the inline popup prompt tool. The commands are displayed in the side panel AI Prompt view and the context menu of the inline popup tool.

The commands can be configured separately in the ai.aiPrompt.commands and ai.inlineAIPrompt.commands properties.

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

The icon of the command.

<textarea id="editor"></textarea>
<script>
$("#editor").kendoEditor({
    ai: {
        commands: [{
            icon: "spell-checker",
            text: "Proofread"
        }]
    }
});
</script>

The id of the command.

<textarea id="editor"></textarea>
<script>
$("#editor").kendoEditor({
    ai: {
        commands: [{
            id: "proofread",
            text: "Proofread"
        }]
    }
});
</script>

The prompt for the command. The function accepts the following arguments:

  • context - The text in the editor.
<textarea id="editor"></textarea>
<script>
$("#editor").kendoEditor({
    ai: {
        commands: [{
            text: "Proofread",
            prompt: function(context) {
                return "Please proofread and correct any errors in the following text: " + context;
            }
        }]
    }
});
</script>

The text of the command.

<textarea id="editor"></textarea>
<script>
$("#editor").kendoEditor({
    ai: {
        commands: [{
            text: "Proofread"
        }]
    }
});
</script>