From 22afe4b24b0b916e75b8e6c573810c2478f2bd67 Mon Sep 17 00:00:00 2001 From: CI-DEV <154627941+IlumCI@users.noreply.github.com> Date: Fri, 3 Oct 2025 20:31:53 +0300 Subject: [PATCH] Update ma_utils.py --- swarms/structs/ma_utils.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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