-
public final class AIToolApprovalWhat a tool call asks the person it waits for before it runs, such as "Share your location?", and how they answered.
The agent's backend writes it on the call's
ai_tool_callstep, which waits with statusawaiting_approval, and holds the call until the person answers. Allowed, the call goes on (a client tool then awaits the device); declined, it is cancelled and never runs.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public final classAIToolApproval.DecisionHow the person answered. An open set: compare against the decisions you know.
-
Field Summary
Fields Modifier and Type Field Description private final Stringtitleprivate final Stringmessageprivate final Stringreasonprivate final StringallowTitleprivate final StringdeclineTitleprivate final AIToolApproval.Decisiondecision
-
Constructor Summary
Constructors Constructor Description AIToolApproval(String title, String message, String reason, String allowTitle, String declineTitle, AIToolApproval.Decision decision)
-
Method Summary
Modifier and Type Method Description final StringgetTitle()final StringgetMessage()final StringgetReason()final StringgetAllowTitle()final StringgetDeclineTitle()final AIToolApproval.DecisiongetDecision()-
-
Constructor Detail
-
AIToolApproval
AIToolApproval(String title, String message, String reason, String allowTitle, String declineTitle, AIToolApproval.Decision decision)
- Parameters:
title- The question, such as "Share your location?".message- What allowing it shares or does, such as "Only your city is shared.reason- The agent's own words for why it wants the call, such as "to check the local weather".allowTitle- The label of the button that allows the call, ornullwhen the agent sent none.declineTitle- The label of the button that declines it, ornullwhen the agent sent none.decision- How the person answered, once they did.
-
-
Method Detail
-
getMessage
final String getMessage()
-
getAllowTitle
final String getAllowTitle()
-
getDeclineTitle
final String getDeclineTitle()
-
getDecision
final AIToolApproval.Decision getDecision()
-
-
-
-