Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -147,21 +147,26 @@ def __init__(
Example:
.. code-block:: python

from agent_framework_orchestrations import GroupChatOrchestrator
from agent_framework import Agent
from agent_framework_orchestrations import GroupChatBuilder, GroupChatState


async def round_robin_selector(state: GroupChatState) -> str:
def round_robin_selector(state: GroupChatState) -> str:
# Simple round-robin selection among participants
return state.participants[state.current_round % len(state.participants)]
names = list(state.participants)
return names[state.current_round % len(names)]


orchestrator = GroupChatOrchestrator(
id="group_chat_orchestrator_1",
# GroupChatBuilder creates a GroupChatOrchestrator when given a selection_func.
workflow = GroupChatBuilder(
participants=[
Agent(client=client, name="researcher"),
Agent(client=client, name="writer"),
],
selection_func=round_robin_selector,
participants=["researcher", "writer"],
name="Coordinator",
orchestrator_name="Coordinator",
max_rounds=10,
)
).build()
"""
super().__init__(
id,
Expand Down Expand Up @@ -895,10 +900,10 @@ def with_checkpointing(self, checkpoint_storage: CheckpointStorage) -> GroupChat

.. code-block:: python

from agent_framework import MemoryCheckpointStorage
from agent_framework import InMemoryCheckpointStorage
from agent_framework_orchestrations import GroupChatBuilder

storage = MemoryCheckpointStorage()
storage = InMemoryCheckpointStorage()
workflow = (
GroupChatBuilder(
participants=[agent1, agent2],
Expand Down
Loading