I need a system where AutoGen (Microsoft Agent Framework) handles the majority of a customer support ticket, but pauses and asks for human confirmation if the refund amount exceeds $100. How do I define a conditional trigger that shifts the 'human_input_mode' from NEVER to ALWAYS mid-conversation?
3 answers
You can achieve this by using the is_termination_msg or a custom reply function. Instead of just checking for a "TERMINATE" keyword, your function can parse the agent's output for a currency value. If the logic detects an amount over $100, it can return a signal that prompts the UserProxyAgent. You can also set the human_input_mode to "TERMINATE", which only asks for input when the task is done or a specific condition is met. This ensures the high-volume, low-risk tasks flow autonomously while maintaining strict human oversight for sensitive financial transactions.
What happens if the human wants to suggest a different refund amount instead of just saying 'yes' or 'no'?
It's basically like a breakpoint where the agent waits for a string input from the terminal or your UI.
Precisely, and with the newer Studio UI, you can even see the visual state of the conversation while you are providing that input.
The human can type a specific instruction like "Limit it to $75 instead." The agent receives this as a new message in the chat history, processes the feedback, and updates its plan accordingly before proceeding.