AIQuickActionCustomActionDefinition
interface
A custom AI quick action definition.
An example of an action that inserts content in the editor:
{
id: 'add-random-cat-fact',
label: 'Add cat fact.',
prompt: 'Add a random fact about cats to the document.',
type: 'action',
}
Copy code
Optionally, action can have an AI model specified that it will use when run:
{
id: 'add-quote-from-famous-person',
label: '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: 'action',
model: 'claude-4-sonnet'
}
Copy code
Properties
id : stringreadonlyinheritedmodule:ai/aiquickactions/aiquickactions~AIQuickActionCustomActionDefinition#idThe unique identifier of the action.
label : stringreadonlyinheritedmodule:ai/aiquickactions/aiquickactions~AIQuickActionCustomActionDefinition#labelThe human-readable label of the action.
model : string | undefinedreadonlyinheritedmodule:ai/aiquickactions/aiquickactions~AIQuickActionCustomActionDefinition#modelThe model to use for the action. If not specified, the default model will be used.
prompt : stringreadonlyinheritedmodule:ai/aiquickactions/aiquickactions~AIQuickActionCustomActionDefinition#promptThe prompt to be sent to the AI model when the action is executed.
type : 'action'module:ai/aiquickactions/aiquickactions~AIQuickActionCustomActionDefinition#typeThe type of the action.