AutoGen enables multi-agent conversations where LLM agents collaborate and execute code to solve complex tasks. These exercises cover AssistantAgent vs. UserProxyAgent roles, code execution configuration, GroupChat coordination, termination conditions, and human input modes.
0 / 5 completed
1 / 5
In AutoGen, what is the primary difference between AssistantAgent and UserProxyAgent?
AssistantAgent uses an LLM to generate responses, write code, and reason about problems. UserProxyAgent represents the human in the loop — it can execute code produced by AssistantAgent, run tool calls, and optionally solicit actual human input. Together they form AutoGen's foundational two-agent conversation pattern.
2 / 5
A developer configures UserProxyAgent(code_execution_config={'work_dir': 'coding'}). What does this enable?
The code_execution_config enables code execution: when AssistantAgent generates a code block, UserProxyAgent extracts and runs it in the work_dir directory. The execution output (stdout/stderr) is fed back into the conversation, allowing AutoGen to iteratively debug and improve code.
3 / 5
What is a GroupChat in AutoGen and when would you use it?
GroupChat enables conversations among multiple agents. A GroupChatManager (also LLM-backed) selects which agent should speak next based on the conversation context. This is useful for multi-agent collaboration where specialized agents (e.g., a coder, a critic, a planner) each contribute their expertise.
4 / 5
How does AutoGen handle conversation termination by default?
AutoGen uses a convention where conversations terminate when a message contains the string 'TERMINATE'. The is_termination_msg parameter on agents accepts a custom function, but the default behavior looks for this keyword. Agents are typically instructed in their system prompt to reply TERMINATE when the task is complete.
5 / 5
What does the human_input_mode parameter control on an AutoGen agent?
human_input_mode controls when real human input is requested: 'ALWAYS' prompts the human after every message, 'NEVER' runs fully automated, and 'TERMINATE' (default) only asks for human input when the conversation would otherwise terminate, allowing humans to continue or stop the conversation.