-
public final class AIToolApprovalPromptKt
-
-
Method Summary
Modifier and Type Method Description final static UnitAIToolApprovalPrompt(AIToolCallPart call, AIToolApprover approver, Modifier modifier, Function3<AIToolApproval, AIToolApprovalState, Function1<Boolean, Unit>, Unit> content)Asks the person a tool call waits for whether it may run: the question its ai_tool_callstep carries (statusawaiting_approval, withapproval).final static UnitAIToolApprovalCard(AIToolApproval approval, AIToolApprovalState state, Function1<Boolean, Unit> decide, Modifier modifier, TextStyle textStyle, AIToolApprovalColors colors)A tool call's question: what it asks, the agent's reason and what allowing it shares, and buttons to allow or decline it. -
-
Method Detail
-
AIToolApprovalPrompt
@Composable() final static Unit AIToolApprovalPrompt(AIToolCallPart call, AIToolApprover approver, Modifier modifier, Function3<AIToolApproval, AIToolApprovalState, Function1<Boolean, Unit>, Unit> content)
Asks the person a tool call waits for whether it may run: the question its
ai_tool_callstep carries (statusawaiting_approval, withapproval). 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.
-
AIToolApprovalCard
@Composable() final static Unit AIToolApprovalCard(AIToolApproval approval, AIToolApprovalState state, Function1<Boolean, Unit> decide, Modifier modifier, TextStyle textStyle, AIToolApprovalColors colors)
A tool call's question: what it asks, the agent's reason and what allowing it shares, and buttons to allow or decline it.
- Parameters:
approval- The question.state- Where the person's answer is.decide- Answers:trueallows the call,falsedeclines it.modifier- The modifier to apply to the card.textStyle- The style of the question.colors- The palette of the card.
-
-
-
-