Skip to main content

useToolApprovalDialog

Agent Runtimes


Agent Runtimes / chat/tools/ToolApprovalDialog / useToolApprovalDialog

Function: useToolApprovalDialog()

useToolApprovalDialog(): object

Defined in: chat/tools/ToolApprovalDialog.tsx:187

Hook to manage tool approval dialog state

Returns

object

args

args: Record<string, unknown> = state.args

handleApprove

handleApprove: (rememberChoice?) => void

Parameters

rememberChoice?

boolean

Returns

void

handleClose

handleClose: () => void

Returns

void

handleDeny

handleDeny: (rememberChoice?) => void

Parameters

rememberChoice?

boolean

Returns

void

isOpen

isOpen: boolean = state.isOpen

requestApproval

requestApproval: (toolName, args, toolDescription?) => Promise<{ approved: boolean; rememberChoice?: boolean; }>

Parameters

toolName

string

args

Record<string, unknown>

toolDescription?

string

Returns

Promise<{ approved: boolean; rememberChoice?: boolean; }>

toolDescription

toolDescription: string | undefined = state.toolDescription

toolName

toolName: string = state.toolName