// your tool that needs human approval. Can be anythingconst sendEmailTool = async() => { //...}// Wrap a function that needs approval before execution// defaults to an async approval request so your agent will continue after sending an approval request// to a human.const sendEmail = needsHumanApproval({actionId: "send-email"}, sendEmailTool);// Like normally, add your tool definitions to your LLM however you normally do, you don't need to change// anything there.// ...// Now jus use the wrapped tool in your tool handler for tool calling. Works with OpenAI and any other// Agent frameworks that support toolsexport const executeTool = async ( toolName: string, toolArguments: any) => { switch (toolName) { case 'sendEmail': // use the wrapped humaniq tool return sendEmail(toolArguments) // other tools }}