New to Kendo UI for jQuery? Start 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>
String|Object

The icon of the command.

Set this option to an icon descriptor such as { name: "gear", variant: "outline" }. The variant can be outline, solid, or duotone; it applies to SVG rendering and is ignored for font icons.

<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>