Review options
All AI Toolkit methods that edit the document have a reviewOptions property. When configured, it allows you to display a review UI after the document is edited.
const result = toolkit.executeTool({
toolName: 'tiptapEdit',
input,
// Display a UI that allows the user to review
// the changes after they are applied.
reviewOptions: { mode: 'review' },
})After editing the document, a list of suggestions will be displayed.
The reviewOptions property takes a ReviewOptions configuration object.
ReviewOptions
mode?('disabled' | 'review' | 'preview'): Whether to review the changes before or after applying them. Default:'disabled''disabled': No review UI is displayed.'review': The changes are applied first, then a review UI is displayed allowing the user to undo them.'preview': A preview UI is displayed before applying the changes, allowing the user to accept or reject them.
displayOptions?(DisplayOptions): Customize how suggestions are displayed in the editor UI. Sets thedisplayOptionsproperty of theSuggestiontype. See available options.metadata?(Record<string, any>): Extra metadata for the suggestions that can be used to store additional information about them (e.g. their source or their category). It is not used internally by the extension but it may help developers customize how the suggestions are displayed in the UI.useDiffUtility?(boolean): Whether to use the Diff Utility to compare the documents before and after the change, displaying the deleted and added content as a rich diff. Iffalse, the deleted content and added content are displayed in a whole block, as a single change. Default:truediffUtilityOptions?(ExternalDiffUtilityOptions): Options for comparing the documents with the diff utility. See available options.