swarms 7.7.3__py3-none-any.whl → 7.7.4__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- swarms/structs/hiearchical_swarm.py +1 -1
- swarms/structs/hybrid_hiearchical_peer_swarm.py +1 -1
- swarms/structs/multi_model_gpu_manager.py +1447 -0
- swarms/structs/swarm_arange.py +18 -15
- {swarms-7.7.3.dist-info → swarms-7.7.4.dist-info}/METADATA +1 -1
- {swarms-7.7.3.dist-info → swarms-7.7.4.dist-info}/RECORD +9 -8
- {swarms-7.7.3.dist-info → swarms-7.7.4.dist-info}/LICENSE +0 -0
- {swarms-7.7.3.dist-info → swarms-7.7.4.dist-info}/WHEEL +0 -0
- {swarms-7.7.3.dist-info → swarms-7.7.4.dist-info}/entry_points.txt +0 -0
swarms/structs/swarm_arange.py
CHANGED
@@ -1,10 +1,13 @@
|
|
1
1
|
import threading
|
2
|
-
import time
|
3
2
|
import uuid
|
4
3
|
from typing import Any, Callable, Dict, List, Optional
|
5
4
|
|
6
5
|
from swarms.utils.any_to_str import any_to_str
|
7
6
|
from swarms.utils.loguru_logger import initialize_logger
|
7
|
+
from swarms.structs.conversation import Conversation
|
8
|
+
from swarms.utils.history_output_formatter import (
|
9
|
+
output_type,
|
10
|
+
)
|
8
11
|
|
9
12
|
logger = initialize_logger(log_folder="swarm_arange")
|
10
13
|
|
@@ -13,20 +16,6 @@ def swarm_id():
|
|
13
16
|
return uuid.uuid4().hex
|
14
17
|
|
15
18
|
|
16
|
-
class SwarmArrangeInput:
|
17
|
-
id: str = uuid.uuid4().hex
|
18
|
-
time_stamp: str = time.strftime("%Y-%m-%d %H:%M:%S")
|
19
|
-
name: str
|
20
|
-
description: str
|
21
|
-
swarms: List[Callable] = []
|
22
|
-
output_type: str
|
23
|
-
flow: str = ""
|
24
|
-
|
25
|
-
|
26
|
-
class SwarmArrangeOutput:
|
27
|
-
input_config: SwarmArrangeInput = None
|
28
|
-
|
29
|
-
|
30
19
|
class SwarmRearrange:
|
31
20
|
"""
|
32
21
|
A class representing a swarm of swarms for rearranging tasks.
|
@@ -69,6 +58,7 @@ class SwarmRearrange:
|
|
69
58
|
Callable[[str], str]
|
70
59
|
] = None,
|
71
60
|
return_json: bool = False,
|
61
|
+
output_type: output_type = "dict-all-except-first",
|
72
62
|
*args,
|
73
63
|
**kwargs,
|
74
64
|
):
|
@@ -96,7 +86,9 @@ class SwarmRearrange:
|
|
96
86
|
self.verbose = verbose
|
97
87
|
self.human_in_the_loop = human_in_the_loop
|
98
88
|
self.custom_human_in_the_loop = custom_human_in_the_loop
|
89
|
+
self.output_type = output_type
|
99
90
|
self.return_json = return_json
|
91
|
+
|
100
92
|
self.swarm_history = {swarm.name: [] for swarm in swarms}
|
101
93
|
self.lock = threading.Lock()
|
102
94
|
self.id = uuid.uuid4().hex if id is None else id
|
@@ -104,6 +96,9 @@ class SwarmRearrange:
|
|
104
96
|
# Run the reliability checks
|
105
97
|
self.reliability_checks()
|
106
98
|
|
99
|
+
# Conversation
|
100
|
+
self.conversation = Conversation()
|
101
|
+
|
107
102
|
def reliability_checks(self):
|
108
103
|
logger.info("Running reliability checks.")
|
109
104
|
if not self.swarms:
|
@@ -283,6 +278,10 @@ class SwarmRearrange:
|
|
283
278
|
current_task, img, *args, **kwargs
|
284
279
|
)
|
285
280
|
result = any_to_str(result)
|
281
|
+
self.conversation.add(
|
282
|
+
role=swarm.name, content=result
|
283
|
+
)
|
284
|
+
|
286
285
|
logger.info(
|
287
286
|
f"Swarm {swarm_name} returned result of type: {type(result)}"
|
288
287
|
)
|
@@ -325,6 +324,10 @@ class SwarmRearrange:
|
|
325
324
|
current_task, img, *args, **kwargs
|
326
325
|
)
|
327
326
|
result = any_to_str(result)
|
327
|
+
|
328
|
+
self.conversation.add(
|
329
|
+
role=swarm.name, content=result
|
330
|
+
)
|
328
331
|
logger.info(
|
329
332
|
f"Swarm {swarm_name} returned result of type: {type(result)}"
|
330
333
|
)
|
@@ -101,8 +101,8 @@ swarms/structs/deep_research_swarm.py,sha256=axhzSK43-TViQJntt2Gz2AUhAc6zoBPzj9w
|
|
101
101
|
swarms/structs/dynamic_conversational_swarm.py,sha256=n_d1jDCzBwiGb0QjJpW_MlXxqEkhGEhC1ttaebH7f3Q,8098
|
102
102
|
swarms/structs/graph_workflow.py,sha256=TAaUG_J3898hhghPOp0WEAV3Zf0in6s48ZSVbSTX-vQ,8629
|
103
103
|
swarms/structs/groupchat.py,sha256=CivOw0QlpjugG8MIu5uGGVoA_0_oY6sBg0XlA08gViQ,15691
|
104
|
-
swarms/structs/hiearchical_swarm.py,sha256=
|
105
|
-
swarms/structs/hybrid_hiearchical_peer_swarm.py,sha256=
|
104
|
+
swarms/structs/hiearchical_swarm.py,sha256=2x3InS4HJg4T9Y195l_ANTGu6DYcllqCdJcR3v5Xuro,33402
|
105
|
+
swarms/structs/hybrid_hiearchical_peer_swarm.py,sha256=HcT1cha0uqnjAgyr6EDYP1DEZOsUvxOirTEDnJS9MFs,9234
|
106
106
|
swarms/structs/ma_utils.py,sha256=FxMNCmeSpYEczZOxK0gpgn5a50CJTc1USmRHCqvxP54,3091
|
107
107
|
swarms/structs/majority_voting.py,sha256=F_t_MOC3YCRyMw5N6qKdFThpaXZxwixRw592Ku5Uhto,10122
|
108
108
|
swarms/structs/malt.py,sha256=0ZOuLfOzaJ4vAVOM6J1aZ3yWAiKxfMkNIBNp8pjsEqE,19392
|
@@ -113,6 +113,7 @@ swarms/structs/model_router.py,sha256=V5pZHYlxSmCvAA2Gsns7LaCz8dXtRi7pCvb-oLGHYI
|
|
113
113
|
swarms/structs/multi_agent_collab.py,sha256=odh2NQRR23LidsphCxUfAke369lDdgL__w3Xovu9jkA,7731
|
114
114
|
swarms/structs/multi_agent_exec.py,sha256=Gxwr9mHADX3n29pdxor-dQDnKPSNdnicpCxBLmPwnLg,14344
|
115
115
|
swarms/structs/multi_agent_router.py,sha256=21PfswEuxMHqlWDBCyritj9UuHTShYVQRaK0o23eia8,10999
|
116
|
+
swarms/structs/multi_model_gpu_manager.py,sha256=h5y4eNCeBRbBqK36ifPp0RkzVbdbTrIS-Vh_LXLD0-U,47400
|
116
117
|
swarms/structs/omni_agent_types.py,sha256=RdKLfZ-lXDJrEa0aJT_Rfx9TypJQo8SISqKz4fnLkAk,230
|
117
118
|
swarms/structs/output_types.py,sha256=zseJBL2e50nXWy71VeAY31z9Bb2ugq9ohWUYk1xQV20,158
|
118
119
|
swarms/structs/rearrange.py,sha256=5u7HwTVVH414w9rhEQvLdltW1ACHjgwn-zS8-8JEXmA,22576
|
@@ -121,7 +122,7 @@ swarms/structs/safe_loading.py,sha256=gmYX8G9TsvAIp6OCvREBZt5mwSFc-p-t1rSnDBfhEm
|
|
121
122
|
swarms/structs/sequential_workflow.py,sha256=5jxHP-a2CzdclSXIrVWkQKXBr01VzrgOBIexR9s8diw,8492
|
122
123
|
swarms/structs/spreadsheet_swarm.py,sha256=ToX56QJjlm_nnC3MYppvKC_NTr9Zy_orkBzfxNLdwbA,14845
|
123
124
|
swarms/structs/stopping_conditions.py,sha256=JHHwqgPoUvjX897ofW2gpPZH_cqEWmv5lDTqb2GtA6M,1382
|
124
|
-
swarms/structs/swarm_arange.py,sha256=
|
125
|
+
swarms/structs/swarm_arange.py,sha256=DYjuDCh1msFrjNnFO4aVVmeSy_QXkjZFuBAEAHDR1ew,15469
|
125
126
|
swarms/structs/swarm_eval.py,sha256=148E2R2zaCmt_LZYx15nmdFjybXHiQ2CZbl6pk77jNs,11635
|
126
127
|
swarms/structs/swarm_id_generator.py,sha256=Wly7AtGM9e6VgzhYmfg8_gSOdxAdsOvWHJFK81cpQNQ,68
|
127
128
|
swarms/structs/swarm_matcher.py,sha256=E2KwHHEJxmW-UfTeMPWZ6VCmYdQ_I9_fwrfJbxD02GY,23322
|
@@ -175,8 +176,8 @@ swarms/utils/try_except_wrapper.py,sha256=appEGu9Afy3TmdkNNXUgQ9yU9lj2j0uNkIoW0J
|
|
175
176
|
swarms/utils/visualizer.py,sha256=0ylohEk62MAS6iPRaDOV03m9qo2k5J56tWlKJk_46p4,16927
|
176
177
|
swarms/utils/vllm_wrapper.py,sha256=OIGnU9Vf81vE_hul1FK-xEhChFK8fxqZX6-fhQeW22c,4987
|
177
178
|
swarms/utils/wrapper_clusterop.py,sha256=PMSCVM7ZT1vgj1D_MYAe835RR3SMLYxA-si2JS02yNQ,4220
|
178
|
-
swarms-7.7.
|
179
|
-
swarms-7.7.
|
180
|
-
swarms-7.7.
|
181
|
-
swarms-7.7.
|
182
|
-
swarms-7.7.
|
179
|
+
swarms-7.7.4.dist-info/LICENSE,sha256=jwRtEmTWjLrEsvFB6QFdYs2cEeZPRMdj-UMOFkPF8_0,11363
|
180
|
+
swarms-7.7.4.dist-info/METADATA,sha256=nsrofluYIt5VmvVlANUDYB9HLVOHJ2XU968XhC8p-kY,94905
|
181
|
+
swarms-7.7.4.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
182
|
+
swarms-7.7.4.dist-info/entry_points.txt,sha256=2K0rTtfO1X1WaO-waJlXIKw5Voa_EpAL_yU0HXE2Jgc,47
|
183
|
+
swarms-7.7.4.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|