Skip to content

RoundRobinTarget

autogen.beta.network.transitions.RoundRobinTarget dataclass #

RoundRobinTarget()

Next participant after state.last_speaker_id in participant_order.

name class-attribute #

name = 'round_robin'

resolve #

resolve(state, envelope)
Source code in autogen/beta/network/transitions.py
def resolve(self, state: "WorkflowState", envelope: Envelope) -> TransitionDecision:
    order = state.participant_order
    if not order:
        return TransitionDecision(next_speaker=None, close_reason="no_participants")
    anchor = state.last_speaker_id or envelope.sender_id
    if anchor in order:
        idx = order.index(anchor)
        next_idx = (idx + 1) % len(order)
    else:
        next_idx = 0
    return TransitionDecision(next_speaker=order[next_idx])