ToolApprover

fun interface ToolApprover(source)

The human in the loop. Backends ask it to approve tool calls (AgentTool.requiresApproval, AI SDK tool approval, AG-UI interrupts) and for information only the user can give (AG-UI interrupts with a responseSchema, MCP elicitation). ChatController implements it by surfacing a Confirmation or an input form in the UI.

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
abstract suspend fun approve(toolCallId: String): Boolean
Link copied to clipboard
open suspend fun decide(toolCallId: String): ToolDecision

The user's full decision on a tool call: approval, a reason, edited arguments.

Link copied to clipboard
open suspend fun input(request: InputRequest): InputResponse

Ask the user for request; hosts that cannot ask answer InputResponse.Cancel.