Sign up (with export icon)

AIActionDefinition

Api-typedef icontypedef

Defines the parameters for an AI action executed via executeAction().

The definition supports a few different shapes, depending on the action type and its prompt source:

A system action runs one of the predefined actions. Provide its actionName.

{
	actionName: 'improve-writing'
}
Copy code

A custom action runs an inline prompt. Provide the model together with a userMessage that carries the prompt.

{
	model: 'claude-4-6-sonnet',
	userMessage: 'Rewrite the selected text in a more formal tone.'
}
Copy code

A custom action can also rely on a context reference instead of an inline prompt. In that case neither actionName nor userMessage is set, and the referenced context is passed through contexts.

{
	model: 'claude-4-6-sonnet',
	contexts: [ { id: 'style-guide', promptId: 'improve-writing' } ]
}
Copy code

Properties

  • args : Record<string, string> | undefined

  • Chevron-right icon

    contexts : Array<AIContextRef> | undefined

    Context references attached to the action.

    Experimental: This is a production-ready API but may change in minor releases without the standard deprecation policy. Check the changelog for migration guidance.

  • model : string | undefined

  • userMessage : string | undefined

Value

object