Skip to content

Commit 2857c52

Browse files
authored
Merge pull request #1314 from ZackBradshaw/Bug-MultiVal
fix: avoid passing duplicate 'strategy' in speaker state
2 parents 6a54ba4 + 568f001 commit 2857c52

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

swarms/structs/interactive_groupchat.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -806,11 +806,13 @@ def _process_dynamic_speakers(
806806
mentioned_agents
807807
):
808808
# Determine next speaker(s) using dynamic function
809+
# Avoid passing duplicate 'strategy' if it's present in speaker_state
810+
speaker_state = {k: v for k, v in (self.speaker_state or {}).items() if k != "strategy"}
809811
next_speakers = self.speaker_function(
810812
mentioned_agents,
811813
last_response,
812814
strategy=strategy,
813-
**self.speaker_state,
815+
**speaker_state,
814816
)
815817

816818
# Handle both single agent and multiple agents

0 commit comments

Comments
 (0)