#GroupChat "Next Speaker" Issue

8 messages · Page 1 of 1 (latest)

vivid hound
#

Has anyone come across this error when using multiple agents and groupchat? "GroupChat select_speaker failed to resolve the next speaker's name. This is because the speaker selection OAI call returned:"

unkempt swallow
#

This is likely due to how the next speaker is selected.
There are some options here.

 - speaker_selection_method: the method for selecting the next speaker. Default is "auto".
        Could be any of the following (case insensitive), will raise ValueError if not recognized:
        - "auto": the next speaker is selected automatically by LLM.
        - "manual": the next speaker is selected manually by user input.
        - "random": the next speaker is selected randomly.
        - "round_robin": the next speaker is selected in a round robin fashion, i.e., iterating in the same order as provided in `agents`.

The error you have suggests that you are using an LLM to determine the next speaker. Now, less capable LLMs may not return a valid name of the next speaker ... leading to the error. One thing you can try is try other deterministic methods such as round_robin etc and verify performance for your task.

@cosmic nacelle might be able to provide additional perspectives here.

cosmic nacelle
#

Yeah there are many situations where that LLM call can fail at present. There are a few prs in progress to help address that. In the meantime use round_robin, or set allow_speaker_repeat to false (I think that’s what the option is called). You should also set last_n_messages to “auto” if using code execution

acoustic cape
#

@cosmic nacelle are there any major known failures for this even on GPT-4?

cosmic nacelle
#

GPT-4 is much better. I’ve seen failures like this, yes. But much less often than 3.5

regal isle
#

hi, how do i change the speaker selection method? in the config?

#

@cosmic nacelle

cosmic nacelle
#

Yes, so most recently I did it like this:

groupchat = autogen.GroupChat(
    agents=[user_proxy, assistant, guardrails_agent, distractor_agent],
    messages=[],
    speaker_selection_method="auto",
    allow_repeat_speaker=False,
    max_round=12,
)