AIToolApprovalPrompt

fun AIToolApprovalPrompt(call: AIToolCallPart, approver: AIToolApprover, modifier: Modifier = Modifier, content: @Composable (approval: AIToolApproval, state: AIToolApprovalState, decide: (allowed: Boolean) -> Unit) -> Unit = { approval, state, decide -> AIToolApprovalCard(approval = approval, state = state, decide = decide) })

Asks the person a tool call waits for whether it may run: the question its ai_tool_call step carries (status awaiting_approval, with approval). It shows only to that person, on the device the call names, and only while the call waits, so it can sit under every tool call:

AIToolCall(part = call)
AIToolApprovalPrompt(call = call, approver = approver)

To ask in your own design, pass the content. It gets the question, where the answer is, and a function that answers:

AIToolApprovalPrompt(call = call, approver = approver) { approval, state, decide ->
MyApprovalCard(approval.title, busy = state.isSending, onAllow = { decide(true) }, onDecline = { decide(false) })
}

Parameters

call

The tool call.

approver

Who answers on this device, and how the answer is sent.

modifier

The modifier to apply to the question.

content

Shows the question. Defaults to AIToolApprovalCard.