run_group_chat_iter
autogen.agentchat.run_group_chat_iter #
run_group_chat_iter(pattern, messages, max_rounds=20, safeguard_policy=None, safeguard_llm_config=None, mask_llm_config=None, yield_on=None)
Run a group chat with iterator-based stepped execution.
Iterate over events as they occur. The background thread blocks after each event until you advance to the next iteration.
| PARAMETER | DESCRIPTION |
|---|---|
pattern | The pattern that defines how agents interact (e.g., AutoPattern, RoundRobinPattern, RandomPattern). TYPE: |
messages | The initial message(s) to start the conversation. Can be a string or a list of message dictionaries. |
max_rounds | Maximum number of conversation rounds. Defaults to 20. TYPE: |
safeguard_policy | Optional safeguard policy for content filtering. |
safeguard_llm_config | Optional LLM config for safeguard evaluation. TYPE: |
mask_llm_config | Optional LLM config for content masking. TYPE: |
yield_on | List of event types to yield. If None, yields all events. Common types include TextEvent, ToolCallEvent, GroupChatRunChatEvent, and TerminationEvent. |
| RETURNS | DESCRIPTION |
|---|---|
RunIterResponse | An iterator that yields events as they occur. TYPE: |