The AI Agent provider exposes several methods that you can call to control the AI Agent's behavior and manage the conversation.
Core methods
Method | Description | Parameters |
---|
addUserMessage(message, metadata?) | Adds a user message to the conversation | message : string, metadata? : any |
run() | Starts or continues the AI Agent run | None |
stop() | Stops the current AI Agent run | None |
reset(chatMessages?) | Resets the conversation to its initial state | chatMessages? : ChatMessage[] |
Conversation management
Method | Description | Parameters |
---|
setCheckpoint() | Saves the current state as a checkpoint | None |
restoreCheckpoint(checkpoint) | Restores a previously saved checkpoint | checkpoint : Checkpoint |
setChatMessages(messages) | Replaces all chat messages | messages : ChatMessage[] |
setAutoAccept(autoAccept) | Changes the auto-accept setting | autoAccept : "always" | "never" | "onlyRead" |
Method | Description | Parameters |
---|
acceptToolCall() | Accepts the pending tool call | None |
rejectToolCall() | Rejects the pending tool call | None |