WithApprovalHandler so tool calls can be approved interactively on stdin — same semantics as Run.
Source: examples/agent_with_run_async/
What it demonstrates
RunAsyncreturning<-chan AgentRunAsyncResultWithApprovalHandlerfor tool approval during async runs- Integrating agents into non-blocking application loops
Run
Fromexamples/:
y or n at the approval prompt.
Key code
*agent.ApprovalRequest and calls req.Respond(agent.ApprovalStatusApproved) or Rejected. See Approvals for stream-based approval with Stream.
Expected output
n rejects the tool call and the agent replies without that result.
Learn more
Approvals
Policies, handlers, and stream events
Configuration
Run, RunAsync, and Stream