swarms 7.7.3__py3-none-any.whl → 7.7.5__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.
@@ -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
+ HistoryOutputType,
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: HistoryOutputType = "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
  )
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: swarms
3
- Version: 7.7.3
3
+ Version: 7.7.5
4
4
  Summary: Swarms - TGSC
5
5
  Home-page: https://github.com/kyegomez/swarms
6
6
  License: MIT
@@ -21,6 +21,9 @@ swarms/cli/main.py,sha256=T9YsCrNIzvbQA8h5qlke-TbRP498Wu6R_KkAxRiabvs,15319
21
21
  swarms/cli/onboarding_process.py,sha256=3-2LKoLhjnaPbX9iiasqXPZZpqmwm-ZrXawH88M4BIU,6940
22
22
  swarms/client/__init__.py,sha256=VASeCEYoZskTU3NOw5tQ22uc2_7gyK0oLsxG_WB20ys,268
23
23
  swarms/client/main.py,sha256=f-RpvfKfRK2AaapkyPN2ihXJvIGN4JWB_A7pJu4WyiU,13735
24
+ swarms/communication/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
25
+ swarms/communication/duckdb_wrap.py,sha256=CFJ3OlIlBLT6y68I3FB_74yikyHqFAK0GNs14g383LM,33821
26
+ swarms/communication/sqlite_wrap.py,sha256=Yl8gnaHL685GwJc6eHAqJ5nY-xn_nZHyn4i7rhUj9kQ,26236
24
27
  swarms/prompts/__init__.py,sha256=ZFcghAs4b0Rsjcc_DIFssiztZub5tJ66rxmJD2_tXpQ,747
25
28
  swarms/prompts/accountant_swarm_prompts.py,sha256=swceN1B0fZCOedd3-y3gjNOHDmR-3H5YK17ytp7tTDM,11320
26
29
  swarms/prompts/ag_prompt.py,sha256=mMeqC84SMNrCjQcBeejroSXLuF_wWrVRebHU1MrEQko,4577
@@ -101,8 +104,8 @@ swarms/structs/deep_research_swarm.py,sha256=axhzSK43-TViQJntt2Gz2AUhAc6zoBPzj9w
101
104
  swarms/structs/dynamic_conversational_swarm.py,sha256=n_d1jDCzBwiGb0QjJpW_MlXxqEkhGEhC1ttaebH7f3Q,8098
102
105
  swarms/structs/graph_workflow.py,sha256=TAaUG_J3898hhghPOp0WEAV3Zf0in6s48ZSVbSTX-vQ,8629
103
106
  swarms/structs/groupchat.py,sha256=CivOw0QlpjugG8MIu5uGGVoA_0_oY6sBg0XlA08gViQ,15691
104
- swarms/structs/hiearchical_swarm.py,sha256=5QKnAhPHFrVwQUzMpyYYtZ_SIu_uUjp_rFJJAoih_kM,33385
105
- swarms/structs/hybrid_hiearchical_peer_swarm.py,sha256=wLdVc9gdfIUGzevWQbZN2Hvk54sjlmoTQO9RgUImD28,9216
107
+ swarms/structs/hiearchical_swarm.py,sha256=2x3InS4HJg4T9Y195l_ANTGu6DYcllqCdJcR3v5Xuro,33402
108
+ swarms/structs/hybrid_hiearchical_peer_swarm.py,sha256=D1iBtNNee_mxPoOWS5WGTqcci5FQKtt38mW-J42GvfM,9494
106
109
  swarms/structs/ma_utils.py,sha256=FxMNCmeSpYEczZOxK0gpgn5a50CJTc1USmRHCqvxP54,3091
107
110
  swarms/structs/majority_voting.py,sha256=F_t_MOC3YCRyMw5N6qKdFThpaXZxwixRw592Ku5Uhto,10122
108
111
  swarms/structs/malt.py,sha256=0ZOuLfOzaJ4vAVOM6J1aZ3yWAiKxfMkNIBNp8pjsEqE,19392
@@ -113,6 +116,7 @@ swarms/structs/model_router.py,sha256=V5pZHYlxSmCvAA2Gsns7LaCz8dXtRi7pCvb-oLGHYI
113
116
  swarms/structs/multi_agent_collab.py,sha256=odh2NQRR23LidsphCxUfAke369lDdgL__w3Xovu9jkA,7731
114
117
  swarms/structs/multi_agent_exec.py,sha256=Gxwr9mHADX3n29pdxor-dQDnKPSNdnicpCxBLmPwnLg,14344
115
118
  swarms/structs/multi_agent_router.py,sha256=21PfswEuxMHqlWDBCyritj9UuHTShYVQRaK0o23eia8,10999
119
+ swarms/structs/multi_model_gpu_manager.py,sha256=h5y4eNCeBRbBqK36ifPp0RkzVbdbTrIS-Vh_LXLD0-U,47400
116
120
  swarms/structs/omni_agent_types.py,sha256=RdKLfZ-lXDJrEa0aJT_Rfx9TypJQo8SISqKz4fnLkAk,230
117
121
  swarms/structs/output_types.py,sha256=zseJBL2e50nXWy71VeAY31z9Bb2ugq9ohWUYk1xQV20,158
118
122
  swarms/structs/rearrange.py,sha256=5u7HwTVVH414w9rhEQvLdltW1ACHjgwn-zS8-8JEXmA,22576
@@ -121,7 +125,7 @@ swarms/structs/safe_loading.py,sha256=gmYX8G9TsvAIp6OCvREBZt5mwSFc-p-t1rSnDBfhEm
121
125
  swarms/structs/sequential_workflow.py,sha256=5jxHP-a2CzdclSXIrVWkQKXBr01VzrgOBIexR9s8diw,8492
122
126
  swarms/structs/spreadsheet_swarm.py,sha256=ToX56QJjlm_nnC3MYppvKC_NTr9Zy_orkBzfxNLdwbA,14845
123
127
  swarms/structs/stopping_conditions.py,sha256=JHHwqgPoUvjX897ofW2gpPZH_cqEWmv5lDTqb2GtA6M,1382
124
- swarms/structs/swarm_arange.py,sha256=6fexCPsXRgdLbpY0p9rp_REipeXzsbv1_GOtD9B4HaI,15179
128
+ swarms/structs/swarm_arange.py,sha256=5ewEfL52Y4gh-a0lRjFcleHWlsCBuc5XR1nVEEGh07w,15481
125
129
  swarms/structs/swarm_eval.py,sha256=148E2R2zaCmt_LZYx15nmdFjybXHiQ2CZbl6pk77jNs,11635
126
130
  swarms/structs/swarm_id_generator.py,sha256=Wly7AtGM9e6VgzhYmfg8_gSOdxAdsOvWHJFK81cpQNQ,68
127
131
  swarms/structs/swarm_matcher.py,sha256=E2KwHHEJxmW-UfTeMPWZ6VCmYdQ_I9_fwrfJbxD02GY,23322
@@ -175,8 +179,8 @@ swarms/utils/try_except_wrapper.py,sha256=appEGu9Afy3TmdkNNXUgQ9yU9lj2j0uNkIoW0J
175
179
  swarms/utils/visualizer.py,sha256=0ylohEk62MAS6iPRaDOV03m9qo2k5J56tWlKJk_46p4,16927
176
180
  swarms/utils/vllm_wrapper.py,sha256=OIGnU9Vf81vE_hul1FK-xEhChFK8fxqZX6-fhQeW22c,4987
177
181
  swarms/utils/wrapper_clusterop.py,sha256=PMSCVM7ZT1vgj1D_MYAe835RR3SMLYxA-si2JS02yNQ,4220
178
- swarms-7.7.3.dist-info/LICENSE,sha256=jwRtEmTWjLrEsvFB6QFdYs2cEeZPRMdj-UMOFkPF8_0,11363
179
- swarms-7.7.3.dist-info/METADATA,sha256=f-DDC3mh0GlIMANvwFQcDoROqL9SkEjZiAW3h7A-lK0,94905
180
- swarms-7.7.3.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
181
- swarms-7.7.3.dist-info/entry_points.txt,sha256=2K0rTtfO1X1WaO-waJlXIKw5Voa_EpAL_yU0HXE2Jgc,47
182
- swarms-7.7.3.dist-info/RECORD,,
182
+ swarms-7.7.5.dist-info/LICENSE,sha256=jwRtEmTWjLrEsvFB6QFdYs2cEeZPRMdj-UMOFkPF8_0,11363
183
+ swarms-7.7.5.dist-info/METADATA,sha256=4upfKa3OHBekr8msGULk_k8SY28U0vpdjj3hzYi5ioQ,94905
184
+ swarms-7.7.5.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
185
+ swarms-7.7.5.dist-info/entry_points.txt,sha256=2K0rTtfO1X1WaO-waJlXIKw5Voa_EpAL_yU0HXE2Jgc,47
186
+ swarms-7.7.5.dist-info/RECORD,,
File without changes