Sign up (with export icon)

AIQuickActionsConfig

Api-interface icon interface

The configuration of the AI Quick Actions feature.

The properties defined in this config are set in the config.ai.quickActions namespace.

ClassicEditor
	.create( editorElement, {
		ai: {
			quickActions: {
				// AI Quick Actions configuration.
			}
		}
	} )
	.then( ... )
	.catch( ... );
Copy code

See the full AI configuration.

See all editor options.

Properties

  • Chevron-right icon

    The extra commands to add to the AI Quick Actions feature to become available for the user. You can fine-tune the commands by specifying the type, prompt, and other properties. By default, the extra commands land in the "Other" group in the user interface.

    The following example will add three new commands to the AI Quick Actions feature:

    ClassicEditor
    	.create( editorElement, {
    		// ... Other configuration options ...
    		ai: {
    			quickActions: {
    				extraCommands: [
    					// An action that requires content to be selected in the editor (it transforms the selected content).
    				{
    				id: 'add-quote-from-famous-person',
    				displayedPrompt: 'Add a quote from a famous person',
    				prompt: 'Add a quote from a known person, which would make sense in the context of the selected text.',
    				type: AIQuickActionType.ACTION,
    				model: 'claude-4-sonnet'
    			},
    			{
    				id: 'summarize-in-bullet-points',
    				displayedPrompt: 'Summarize in 5 bullet points',
    				prompt: 'Summarize the selected text in 5 bullet points.',
    				type: AIQuickActionType.CHAT
    			},
    			{
    				id: 'include-more-sarcasm',
    				displayedPrompt: 'Rewrite adding more sarcasm',
    				prompt: 'Rewrite using a sarcastic tone.',
    				type: AIQuickActionType.ACTION,
    				model: 'claude-4-sonnet'
    			}
    
    					// ... More commands ...
    				],
    			},
    		}
    	} )
    	.then( ... )
    	.catch( ... );
    
    Copy code
  • Chevron-right icon

    removeCommands : Array<string> | undefined

    The ids of the commands to remove from the AI Quick Actions feature. Removing all commands from a specific category will remove the category from the user interface.

    The defaults are as follows:

    • 'ask-ai,
    • "Chat commands" category
      • 'explain',
      • 'summarize',
      • 'highlight-key-points',
    • 'improve-writing',
    • 'continue',
    • 'fix-grammar',
    • "Adjust length" category
      • 'make-shorter',
      • 'make-longer',
    • "Change tone" category
      • 'make-tone-casual',
      • 'make-tone-direct',
      • 'make-tone-friendly',
      • 'make-tone-confident',
      • 'make-tone-professional',
    • "Translate" category
      • 'translate-to-english',
      • 'translate-to-chinese',
      • 'translate-to-french',
      • 'translate-to-german',
      • 'translate-to-italian',
      • 'translate-to-portuguese',
      • 'translate-to-russian'

    The following example will remove the "Explain" and "Summarize" commands from the user interface:

    ClassicEditor
    	.create( editorElement, {
    		// ... Other configuration options ...
    		ai: {
    			quickActions: {
    				removeCommands: [
    					'explain',
    					'summarize',
    					// ...
    				]
    			},
    		}
    	} )
    	.then( ... )
    	.catch( ... );
    
    Copy code