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.
- swarms/communication/__init__.py +0 -0
- swarms/communication/duckdb_wrap.py +1037 -0
- swarms/communication/sqlite_wrap.py +813 -0
- swarms/structs/hiearchical_swarm.py +1 -1
- swarms/structs/hybrid_hiearchical_peer_swarm.py +20 -3
- 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.5.dist-info}/METADATA +1 -1
- {swarms-7.7.3.dist-info → swarms-7.7.5.dist-info}/RECORD +12 -8
- {swarms-7.7.3.dist-info → swarms-7.7.5.dist-info}/LICENSE +0 -0
- {swarms-7.7.3.dist-info → swarms-7.7.5.dist-info}/WHEEL +0 -0
- {swarms-7.7.3.dist-info → swarms-7.7.5.dist-info}/entry_points.txt +0 -0
@@ -251,7 +251,7 @@ class HierarchicalSwarm(BaseSwarm):
|
|
251
251
|
director: Optional[Union[Agent, Any]] = None,
|
252
252
|
agents: List[Union[Agent, Any]] = None,
|
253
253
|
max_loops: int = 1,
|
254
|
-
output_type: OutputType = "dict",
|
254
|
+
output_type: OutputType = "dict-all-except-first",
|
255
255
|
director_model_name: str = "gpt-4o",
|
256
256
|
teams: Optional[List[TeamUnit]] = None,
|
257
257
|
inter_agent_loops: int = 1,
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import os
|
2
|
-
from typing import List
|
2
|
+
from typing import List, Literal
|
3
3
|
from swarms.structs.agent import Agent
|
4
4
|
from swarms.structs.conversation import Conversation
|
5
5
|
from swarms.structs.multi_agent_exec import get_swarms_info
|
@@ -10,6 +10,23 @@ from swarms.utils.history_output_formatter import (
|
|
10
10
|
from concurrent.futures import ThreadPoolExecutor, as_completed
|
11
11
|
from typing import Union, Callable
|
12
12
|
|
13
|
+
|
14
|
+
HistoryOutputType = Literal[
|
15
|
+
"list",
|
16
|
+
"dict",
|
17
|
+
"dictionary",
|
18
|
+
"string",
|
19
|
+
"str",
|
20
|
+
"final",
|
21
|
+
"last",
|
22
|
+
"json",
|
23
|
+
"all",
|
24
|
+
"yaml",
|
25
|
+
# "dict-final",
|
26
|
+
"dict-all-except-first",
|
27
|
+
"str-all-except-first",
|
28
|
+
]
|
29
|
+
|
13
30
|
tools = [
|
14
31
|
{
|
15
32
|
"type": "function",
|
@@ -105,7 +122,7 @@ class HybridHierarchicalClusterSwarm:
|
|
105
122
|
description: str = "A swarm that uses a hybrid hierarchical-peer model to solve complex tasks.",
|
106
123
|
swarms: List[Union[SwarmRouter, Callable]] = [],
|
107
124
|
max_loops: int = 1,
|
108
|
-
output_type:
|
125
|
+
output_type: HistoryOutputType = "list",
|
109
126
|
router_agent_model_name: str = "gpt-4o-mini",
|
110
127
|
*args,
|
111
128
|
**kwargs,
|
@@ -121,7 +138,7 @@ class HybridHierarchicalClusterSwarm:
|
|
121
138
|
self.router_agent = Agent(
|
122
139
|
agent_name="Router Agent",
|
123
140
|
agent_description="A router agent that routes tasks to the appropriate swarms.",
|
124
|
-
system_prompt=f"{router_system_prompt}\n\n{get_swarms_info()}",
|
141
|
+
system_prompt=f"{router_system_prompt}\n\n{get_swarms_info(swarms=self.swarms)}",
|
125
142
|
tools_list_dictionary=tools,
|
126
143
|
model_name=router_agent_model_name,
|
127
144
|
max_loops=1,
|