Implement Human-in-the-Loop with the Email Agent
mainThe email_agent (accessed via email_agent graph ID) demonstrates how to handle user interruptions using the HumanInterrupt schema. When the agent reaches a point requiring user input, it throws an interrupt that the Agent Chat UI detects to render interactive components.
Trigger Prompt:
Write me an email to <email> about <description>
Supported UI Actions:
Accept: Sends the email as is.Edit: Allows editing fields before sending.Respond: Allows providing text feedback to rewrite the email.Ignore: Ends the graph without action.Mark as resolved: Resumes the graph at the__end__node, ending the session.