Sign up (with export icon)

AICustomQuickActionDefinition

Api-typedef icon typedef

Defines a custom AI quick action with all required properties.

An example of 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'
}
Copy code

An example of an action that does not require content to be selected in the editor (adds a new content):

{
	id: 'add-random-cat-fact',
	displayedPrompt: 'Add cat fact.',
	prompt: 'Add a random fact about cats to the document.',
	type: 'ACTION',
	requiresContent: false
}
Copy code

An example of an action that opens the AI Chat interface for interactive conversations:

{
	id: 'summarize-in-bullet-points',
	displayedPrompt: 'Summarize in 5 bullet points',
	prompt: 'Summarize the selected text in 5 bullet points.',
	type: AIQuickActionType.CHAT
}
Copy code