---
title: "Review options"
description: "Configure preview and review behavior for AI-generated changes with ReviewOptions."
canonical_url: "https://tiptap.dev/docs/content-ai/capabilities/ai-toolkit/api-reference/review-options"
---

# Review options

Configure preview and review behavior for AI-generated changes with ReviewOptions.

All AI Toolkit methods that [edit the document](https://tiptap.dev/docs/content-ai/capabilities/ai-toolkit/api-reference/edit-the-document.md) have a `reviewOptions` property. When configured, it allows you to display a review UI after the document is edited.

```ts
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](https://tiptap.dev/docs/content-ai/capabilities/ai-toolkit/agents/review-changes.md) will be displayed.

The `reviewOptions` property takes a `ReviewOptions` configuration object.

## `ReviewOptions`

- `mode?` (`'disabled' | 'review' | 'preview' | 'trackedChanges'`): 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.
  - `'trackedChanges'`: AI-generated changes are encoded as tracked changes using the [Tracked Changes](https://tiptap.dev/docs/tracked-changes/getting-started/overview.md) extension, allowing users to accept or reject individual changes.
- `displayOptions?` (`DisplayOptions`): Customize how suggestions are displayed in the editor UI. Sets the `displayOptions` property of the [`Suggestion`](https://tiptap.dev/docs/content-ai/capabilities/ai-toolkit/api-reference/suggestions.md#the-suggestion-object) type. [See available options](https://tiptap.dev/docs/content-ai/capabilities/ai-toolkit/api-reference/suggestions.md#the-suggestion-object).
- `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.
- `trackedChangesOptions?` (`{ userId: string, userMetadata?: Record<string, unknown> | null }`): Configuration for the `trackedChanges` mode. `userId` identifies the author of the tracked changes. `userMetadata` stores additional information about the author.
- `commentsOptions?` (`{ threadData?: Record<string, unknown>, commentData?: Record<string, unknown> }`): When provided alongside the `trackedChanges` mode, operation metadata (the `meta` field in edit operations) becomes a comment thread linked to each tracked change. Requires the [Comments](https://tiptap.dev/docs/comments/getting-started/overview.md) extension.
- `useDiffUtility?` (`boolean`): Whether to use the [Diff Utility](https://tiptap.dev/docs/content-ai/capabilities/ai-toolkit/api-reference/diff-utility.md) to compare the documents before and after the change, displaying the deleted and added content as a rich diff. If `false`, the deleted content and added content are displayed in a whole block, as a single change. Default: `true`
- `diffUtilityOptions?` ([`ExternalDiffUtilityOptions`](https://tiptap.dev/docs/content-ai/capabilities/ai-toolkit/api-reference/diff-utility.md#parameters-diffutilityoptions)): Options for comparing the documents with the diff utility. [See available options](https://tiptap.dev/docs/content-ai/capabilities/ai-toolkit/api-reference/diff-utility.md#parameters-diffutilityoptions).
