FSM/Speaker Transition Control in Autogen v0.4 #5016
-
[Discussion]Hi everyone, I've been migrating from Autogen v0.2 to v0.4 and noticed that the FSM-like functionality for controlling agent transitions seems to have changed significantly. In v0.2, we could control agent transitions using group_chat = GroupChat( This allowed us to define explicit state transitions between agents using the However, in v0.4, I notice that Questions:
My use case requires strict control over which agents can communicate with each other in a workflow, similar to a state machine. Any guidance on how to achieve this in v0.4 would be greatly appreciated! Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
What you're looking for is called The second example in the docs for |
Beta Was this translation helpful? Give feedback.
-
Like what @jackgerrits has commented. See the selector group chat. It's important to note that both v0.2 and v0.4 group chats are functionally the same: all participants share the same message history and messages are broadcasted to all participants. So there isn't a notion of "an agent speak to another agent", as an agent always speak to all. The graph in v0.2 specifies the order of speakers. If you want strict sequences and do not want agents to broadcast, consider a sequential workflow using the Core API. |
Beta Was this translation helpful? Give feedback.
RoundRobinGroupChat
selects speakers in a round robin fashion, as in cycling through each speaker.What you're looking for is called
SelectorGroupChat
. In this the next speaker is selected via a function. By default this function is what you'd traditionally think of as group chat, where an LLM selects the next speaker. But you can pass a custom selector function (theselector_func
arg) which can be used to implement the specific functionality you describe.The second example in the docs for
SelectorGroupChat
show a custom function being used. The function is passed the conversation history and the next speakers name should be returned. You can determine who spoke last by looking at theso…