Sign up (with export icon)

AIReviewCustomCommand

Api-typedef icontypedef

An extra review command definition.

The command needs a prompt source, provided in one of three ways:

  • an inline prompt string - sent as the prompt,
  • a context reference - the referenced context drives the command (for example through a prompt it contains),
  • both - the inline prompt is used and the context is attached as additional reference material (for example a file).

The model property is optional. If not specified, the default model is used.

{
	id: 'improve-captions',
	label: 'Improve Captions',
	description: 'Improve image captions in the document.',
	prompt: 'Suggest improvements for the image captions in the document.'
}
Copy code

The same command using a context reference instead of an inline prompt:

{
	id: 'improve-captions',
	label: 'Improve Captions',
	description: 'Improve image captions in the document.',
	context: { id: 'style-guide', promptId: 'improve-captions' }
}
Copy code

An inline prompt combined with a context that attaches a single file as reference material:

{
	id: 'improve-captions',
	label: 'Improve Captions',
	description: 'Improve image captions in the document.',
	prompt: 'Suggest improvements for the image captions in the document.',
	context: { id: 'style-guide', fileId: 'caption-examples' }
}
Copy code

Properties

  • Chevron-right icon

    context : AIContextRef | undefined
    readonly

    A context reference attached to the command.

    When no inline prompt is provided, the referenced context drives the command (a whole context or a promptId reference). When combined with an inline prompt, it is attached as additional reference material (for example a single file).

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

  • description : string

  • id : string

  • label : string

  • model : string | undefined

  • Chevron-right icon

    prompt : string | undefined
    readonly

    The prompt to be sent to the AI model when the command is executed.

    At least one prompt source is required: an inline prompt, a context that carries a prompt (a whole context or a promptId reference), or both. A context that references only a single file (fileId) cannot drive the command on its own and must be combined with an inline prompt.

Value

object