API Reference
The AI Toolkit provides a set of methods that are the building blocks for your AI integrations. You can call these methods from the AI Tolkit instance:
import { Editor } from '@tiptap/core'
import { AiToolkit, getAiToolkit } from '@tiptap-pro/ai-toolkit'
// Get the AI Toolkit instance
const editor = new Editor({ extensions: [AiToolkit] })
const toolkit = getAiToolkit(editor)
// Call an AI Toolkit method
const text = toolkit.getText()Below is a list of the available methods:
Read the document
More →Extract document content in JSON, HTML, or text formats with support for selections, ranges, and chunked reads.
Edit the document
More →Insert, stream, and patch AI-generated content in text, HTML, or JSON formats with review options.
Execute tool
More →Execute AI agent tool calls against a Tiptap editor using the AI Toolkit.
Workflows
More →API reference for the built-in workflows of the AI Toolkit.
Display suggestions
More →Manage and render AI suggestions with preview and review modes.
Compare documents
More →Compare documents and visualize differences in real time.
Schema awareness
More →Provide schema awareness to AI models so they understand nodes, marks, and attributes.
Diff utility
More →Compute changes between two documents programmatically.