diff --git a/swarms/structs/ma_utils.py b/swarms/structs/ma_utils.py index 09639d36..51980e35 100644 --- a/swarms/structs/ma_utils.py +++ b/swarms/structs/ma_utils.py @@ -131,9 +131,11 @@ def set_random_models_for_agents( return random.choice(model_names) if isinstance(agents, list): - for agent in agents: + return [ setattr(agent, "model_name", random.choice(model_names)) - return agents + or agent + for agent in agents + ] else: setattr(agents, "model_name", random.choice(model_names)) return agents