Package 

Class AIToolApprovalPromptKt

    • 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_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.
      • 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: true allows the call, false declines it.
        modifier - The modifier to apply to the card.
        textStyle - The style of the question.
        colors - The palette of the card.