Tiptap Editor 3.0 Beta is out. Start here

Available Methods

The AI Agent provider exposes several methods that you can call to control the AI Agent's behavior and manage the conversation.

Core methods

MethodDescriptionParameters
addUserMessage(message, metadata?)Adds a user message to the conversationmessage: string, metadata?: any
run()Starts or continues the AI Agent runNone
stop()Stops the current AI Agent runNone
reset(chatMessages?)Resets the conversation to its initial statechatMessages?: ChatMessage[]

Conversation management

MethodDescriptionParameters
setCheckpoint()Saves the current state as a checkpointNone
restoreCheckpoint(checkpoint)Restores a previously saved checkpointcheckpoint: Checkpoint
setChatMessages(messages)Replaces all chat messagesmessages: ChatMessage[]
setAutoAccept(autoAccept)Changes the auto-accept settingautoAccept: "always" | "never" | "onlyRead"

Tool call review

MethodDescriptionParameters
acceptToolCall()Accepts the pending tool callNone
rejectToolCall()Rejects the pending tool callNone