description
parameter, and then use an LLM to take in the description and make decisions for the next agent.
In this blog, we take advantage of a customized speaker selection function passed to the speaker_selection_method
of the GroupChat
object.
This function allows us to customize the transition logic between agents and can be used together with the transition graph introduced in FSM Group Chat. The current StateFlow implementation also allows the user to override the transition graph.
These transitions can be based on the current speaker and static checking of the context history (for example, checking if ‘Error’ is in the last message).
We present an example of how to build a state-oriented workflow using GroupChat.
We define a custom speaker selection function to be passed into the speaker_selection_method
parameter of the GroupChat.
Here, the task is to retrieve research papers related to a given topic and create a markdown table for these papers.
Agent
class representing the next speaker, we can also return a string from ['auto', 'manual', 'random', 'round_robin']
to select a default method to use.
For example, we can always default to the built-in auto
method to employ an LLM-based group chat manager to select the next speaker.
When returning None
, the group chat will terminate. Note that some of the transitions, such as “initializer” -> “coder” can be defined with the transition graph.