AICommandDefinition
Properties
-
id : stringmodule:ai/aiassistant/aiassistant~AICommandDefinition#idThe unique identifier of the command. It can be referenced while removing commands. See
removeCommandsto learn more. -
label : stringmodule:ai/aiassistant/aiassistant~AICommandDefinition#labelThe human-readable label of the command.
-
order : number | undefinedmodule:ai/aiassistant/aiassistant~AICommandDefinition#orderThe order of the command on the list. The lower the number, the higher the command is displayed on the list. If not specified, the position of this command will be determined by the order of configuration.
If a new command is added without
orderproperty, it will be added at the end of the group.The order uses zero-based numbering (the first command's order is
0). -
prompt : stringmodule:ai/aiassistant/aiassistant~AICommandDefinition#promptThe instruction that will be passed to the AI model.
It is wrapped in a "full prompt template" for better results.
-
requiresContent : boolean | undefinedmodule:ai/aiassistant/aiassistant~AICommandDefinition#requiresContentBy default, all commands require a selection for the assistant to work on. If the selection is collapsed, it automatically expands to the nearest block boundaries to provide the AI context.
Setting this to
falseallows the command to work on a collapsed selection and prevent selection expansion. This is helpful, for instance, for commands that generate content from scratch.Note: If not specified, the default is
true.