swarms 7.6.2__py3-none-any.whl → 7.6.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/__init__.py +1 -0
- swarms/agents/__init__.py +0 -3
- swarms/agents/flexion_agent.py +2 -1
- swarms/client/__init__.py +15 -0
- swarms/prompts/multi_agent_collab_prompt.py +313 -0
- swarms/structs/__init__.py +4 -14
- swarms/structs/agent.py +142 -255
- swarms/structs/base_swarm.py +0 -7
- swarms/structs/concurrent_workflow.py +1 -1
- swarms/structs/conversation.py +16 -2
- swarms/structs/de_hallucination_swarm.py +8 -4
- swarms/structs/groupchat.py +80 -84
- swarms/structs/hybrid_hiearchical_peer_swarm.py +23 -40
- swarms/structs/multi_agent_exec.py +63 -139
- swarms/structs/rearrange.py +65 -204
- swarms/structs/sequential_workflow.py +34 -47
- swarms/structs/swarm_router.py +2 -1
- swarms/telemetry/bootup.py +19 -38
- swarms/telemetry/main.py +56 -20
- swarms/utils/auto_download_check_packages.py +2 -2
- swarms/utils/disable_logging.py +0 -17
- swarms/utils/history_output_formatter.py +8 -3
- swarms/utils/litellm_wrapper.py +117 -1
- {swarms-7.6.2.dist-info → swarms-7.6.4.dist-info}/METADATA +1 -5
- {swarms-7.6.2.dist-info → swarms-7.6.4.dist-info}/RECORD +29 -29
- swarms/utils/agent_ops_check.py +0 -26
- swarms/utils/pandas_utils.py +0 -92
- /swarms/{structs/swarms_api.py → client/main.py} +0 -0
- {swarms-7.6.2.dist-info → swarms-7.6.4.dist-info}/LICENSE +0 -0
- {swarms-7.6.2.dist-info → swarms-7.6.4.dist-info}/WHEEL +0 -0
- {swarms-7.6.2.dist-info → swarms-7.6.4.dist-info}/entry_points.txt +0 -0
swarms/telemetry/main.py
CHANGED
@@ -1,10 +1,14 @@
|
|
1
|
+
import datetime
|
1
2
|
import hashlib
|
2
3
|
import platform
|
3
4
|
import socket
|
4
5
|
import subprocess
|
6
|
+
import threading
|
5
7
|
import uuid
|
6
8
|
from typing import Dict
|
7
9
|
|
10
|
+
import aiohttp
|
11
|
+
import httpx
|
8
12
|
import pkg_resources
|
9
13
|
import psutil
|
10
14
|
import requests
|
@@ -262,9 +266,48 @@ def capture_system_data() -> Dict[str, str]:
|
|
262
266
|
return {}
|
263
267
|
|
264
268
|
|
265
|
-
def
|
269
|
+
def _log_agent_data(data_dict: dict) -> dict | None:
|
270
|
+
"""
|
271
|
+
|
272
|
+
Args:
|
273
|
+
data_dict (dict): The dictionary containing the agent data to be logged.
|
274
|
+
|
275
|
+
Returns:
|
276
|
+
dict | None: The JSON response from the server if successful, otherwise None.
|
277
|
+
"""
|
278
|
+
if not data_dict:
|
279
|
+
return None
|
280
|
+
|
281
|
+
url = "https://swarms.world/api/get-agents/log-agents"
|
282
|
+
headers = {
|
283
|
+
"Content-Type": "application/json",
|
284
|
+
"Authorization": "sk-xxx", # replace with actual
|
285
|
+
}
|
286
|
+
|
287
|
+
payload = {
|
288
|
+
"data": data_dict,
|
289
|
+
"system_data": get_user_device_data(),
|
290
|
+
"timestamp": datetime.datetime.now(datetime.UTC).isoformat(),
|
291
|
+
}
|
292
|
+
|
293
|
+
try:
|
294
|
+
with httpx.Client(http2=True, timeout=3.0) as client:
|
295
|
+
response = client.post(url, json=payload, headers=headers)
|
296
|
+
if response.status_code == 200 and response.content:
|
297
|
+
return response.json()
|
298
|
+
except Exception:
|
299
|
+
pass
|
300
|
+
|
301
|
+
|
302
|
+
def log_agent_data(data_dict: dict) -> None:
|
303
|
+
"""Runs log_agent_data in a separate thread (detached from main thread)."""
|
304
|
+
threading.Thread(
|
305
|
+
target=_log_agent_data, args=(data_dict,), daemon=True
|
306
|
+
).start()
|
307
|
+
|
308
|
+
|
309
|
+
async def async_log_agent_data(data_dict: dict) -> dict | None:
|
266
310
|
"""
|
267
|
-
Silently logs agent data to the Swarms database with retry logic.
|
268
311
|
|
269
312
|
Args:
|
270
313
|
data_dict (dict): The dictionary containing the agent data to be logged.
|
@@ -284,23 +327,16 @@ def log_agent_data(data_dict: dict) -> dict | None:
|
|
284
327
|
data_input = {
|
285
328
|
"data": data_dict,
|
286
329
|
"system_data": get_user_device_data(),
|
330
|
+
"timestamp": datetime.datetime.now(datetime.UTC).isoformat(),
|
287
331
|
}
|
288
332
|
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
except (
|
300
|
-
requests.exceptions.RequestException,
|
301
|
-
requests.exceptions.JSONDecodeError,
|
302
|
-
):
|
303
|
-
return None # Return None if anything goes wrong
|
304
|
-
|
305
|
-
|
306
|
-
# print(log_agent_data(get_user_device_data()))
|
333
|
+
async with aiohttp.ClientSession() as session:
|
334
|
+
try:
|
335
|
+
async with session.post(
|
336
|
+
url, json=data_input, headers=headers, timeout=10
|
337
|
+
) as response:
|
338
|
+
if response.ok and await response.text():
|
339
|
+
out = await response.json()
|
340
|
+
return out
|
341
|
+
except Exception:
|
342
|
+
pass
|
swarms/utils/disable_logging.py
CHANGED
@@ -5,20 +5,6 @@ import warnings
|
|
5
5
|
from threading import Thread
|
6
6
|
|
7
7
|
|
8
|
-
def disable_langchain():
|
9
|
-
"""
|
10
|
-
Disables the LangChain deprecation warning.
|
11
|
-
"""
|
12
|
-
from langchain_core._api.deprecation import (
|
13
|
-
LangChainDeprecationWarning,
|
14
|
-
)
|
15
|
-
|
16
|
-
# Ignore LangChainDeprecationWarning
|
17
|
-
warnings.filterwarnings(
|
18
|
-
"ignore", category=LangChainDeprecationWarning
|
19
|
-
)
|
20
|
-
|
21
|
-
|
22
8
|
def disable_logging():
|
23
9
|
"""
|
24
10
|
Disables logging for specific modules and sets up file and stream handlers.
|
@@ -47,7 +33,6 @@ def disable_logging():
|
|
47
33
|
"numexpr",
|
48
34
|
"git",
|
49
35
|
"wandb.docker.auth",
|
50
|
-
"langchain",
|
51
36
|
"distutils",
|
52
37
|
"urllib3",
|
53
38
|
"elasticsearch",
|
@@ -80,8 +65,6 @@ def disable_logging():
|
|
80
65
|
stream_handler.setLevel(logging.ERROR)
|
81
66
|
logging.getLogger().addHandler(stream_handler)
|
82
67
|
|
83
|
-
disable_langchain()
|
84
|
-
|
85
68
|
|
86
69
|
def set_logger_level(logger_name: str) -> None:
|
87
70
|
"""
|
@@ -1,3 +1,4 @@
|
|
1
|
+
import yaml
|
1
2
|
from swarms.structs.conversation import Conversation
|
2
3
|
|
3
4
|
|
@@ -6,13 +7,17 @@ def history_output_formatter(
|
|
6
7
|
):
|
7
8
|
if type == "list":
|
8
9
|
return conversation.return_messages_as_list()
|
9
|
-
elif type == "dict":
|
10
|
+
elif type == "dict" or type == "dictionary":
|
10
11
|
return conversation.to_dict()
|
11
12
|
elif type == "string" or type == "str":
|
12
13
|
return conversation.get_str()
|
13
|
-
elif type == "final":
|
14
|
-
return conversation.
|
14
|
+
elif type == "final" or type == "last":
|
15
|
+
return conversation.get_final_message_content()
|
15
16
|
elif type == "json":
|
16
17
|
return conversation.to_json()
|
18
|
+
elif type == "all":
|
19
|
+
return conversation.get_str()
|
20
|
+
elif type == "yaml":
|
21
|
+
return yaml.safe_dump(conversation.to_dict(), sort_keys=False)
|
17
22
|
else:
|
18
23
|
raise ValueError(f"Invalid type: {type}")
|
swarms/utils/litellm_wrapper.py
CHANGED
@@ -1,3 +1,6 @@
|
|
1
|
+
import base64
|
2
|
+
import requests
|
3
|
+
|
1
4
|
import asyncio
|
2
5
|
from typing import List
|
3
6
|
|
@@ -24,6 +27,37 @@ except ImportError:
|
|
24
27
|
litellm.ssl_verify = False
|
25
28
|
|
26
29
|
|
30
|
+
def get_audio_base64(audio_source: str) -> str:
|
31
|
+
"""
|
32
|
+
Convert audio from a given source to a base64 encoded string.
|
33
|
+
|
34
|
+
This function handles both URLs and local file paths. If the audio source is a URL, it fetches the audio data
|
35
|
+
from the internet. If it is a local file path, it reads the audio data from the specified file.
|
36
|
+
|
37
|
+
Args:
|
38
|
+
audio_source (str): The source of the audio, which can be a URL or a local file path.
|
39
|
+
|
40
|
+
Returns:
|
41
|
+
str: A base64 encoded string representation of the audio data.
|
42
|
+
|
43
|
+
Raises:
|
44
|
+
requests.HTTPError: If the HTTP request to fetch audio data fails.
|
45
|
+
FileNotFoundError: If the local audio file does not exist.
|
46
|
+
"""
|
47
|
+
# Handle URL
|
48
|
+
if audio_source.startswith(("http://", "https://")):
|
49
|
+
response = requests.get(audio_source)
|
50
|
+
response.raise_for_status()
|
51
|
+
audio_data = response.content
|
52
|
+
# Handle local file
|
53
|
+
else:
|
54
|
+
with open(audio_source, "rb") as file:
|
55
|
+
audio_data = file.read()
|
56
|
+
|
57
|
+
encoded_string = base64.b64encode(audio_data).decode("utf-8")
|
58
|
+
return encoded_string
|
59
|
+
|
60
|
+
|
27
61
|
class LiteLLM:
|
28
62
|
"""
|
29
63
|
This class represents a LiteLLM.
|
@@ -42,6 +76,7 @@ class LiteLLM:
|
|
42
76
|
tools_list_dictionary: List[dict] = None,
|
43
77
|
tool_choice: str = "auto",
|
44
78
|
parallel_tool_calls: bool = False,
|
79
|
+
audio: str = None,
|
45
80
|
*args,
|
46
81
|
**kwargs,
|
47
82
|
):
|
@@ -65,6 +100,7 @@ class LiteLLM:
|
|
65
100
|
self.tools_list_dictionary = tools_list_dictionary
|
66
101
|
self.tool_choice = tool_choice
|
67
102
|
self.parallel_tool_calls = parallel_tool_calls
|
103
|
+
self.modalities = ["text"]
|
68
104
|
|
69
105
|
def _prepare_messages(self, task: str) -> list:
|
70
106
|
"""
|
@@ -87,7 +123,83 @@ class LiteLLM:
|
|
87
123
|
|
88
124
|
return messages
|
89
125
|
|
90
|
-
def
|
126
|
+
def audio_processing(self, task: str, audio: str):
|
127
|
+
"""
|
128
|
+
Process the audio for the given task.
|
129
|
+
|
130
|
+
Args:
|
131
|
+
task (str): The task to be processed.
|
132
|
+
audio (str): The path or identifier for the audio file.
|
133
|
+
"""
|
134
|
+
self.modalities.append("audio")
|
135
|
+
|
136
|
+
encoded_string = get_audio_base64(audio)
|
137
|
+
|
138
|
+
# Append messages
|
139
|
+
self.messages.append(
|
140
|
+
{
|
141
|
+
"role": "user",
|
142
|
+
"content": [
|
143
|
+
{"type": "text", "text": task},
|
144
|
+
{
|
145
|
+
"type": "input_audio",
|
146
|
+
"input_audio": {
|
147
|
+
"data": encoded_string,
|
148
|
+
"format": "wav",
|
149
|
+
},
|
150
|
+
},
|
151
|
+
],
|
152
|
+
}
|
153
|
+
)
|
154
|
+
|
155
|
+
def vision_processing(self, task: str, image: str):
|
156
|
+
"""
|
157
|
+
Process the image for the given task.
|
158
|
+
"""
|
159
|
+
self.modalities.append("vision")
|
160
|
+
|
161
|
+
# Append messages
|
162
|
+
self.messages.append(
|
163
|
+
{
|
164
|
+
"role": "user",
|
165
|
+
"content": [
|
166
|
+
{"type": "text", "text": task},
|
167
|
+
{
|
168
|
+
"type": "image_url",
|
169
|
+
"image_url": {
|
170
|
+
"url": image,
|
171
|
+
# "detail": "high"
|
172
|
+
# "format": "image",
|
173
|
+
},
|
174
|
+
},
|
175
|
+
],
|
176
|
+
}
|
177
|
+
)
|
178
|
+
|
179
|
+
def handle_modalities(
|
180
|
+
self, task: str, audio: str = None, img: str = None
|
181
|
+
):
|
182
|
+
"""
|
183
|
+
Handle the modalities for the given task.
|
184
|
+
"""
|
185
|
+
if audio is not None:
|
186
|
+
self.audio_processing(task=task, audio=audio)
|
187
|
+
|
188
|
+
if img is not None:
|
189
|
+
self.vision_processing(task=task, image=img)
|
190
|
+
|
191
|
+
if audio is not None and img is not None:
|
192
|
+
self.audio_processing(task=task, audio=audio)
|
193
|
+
self.vision_processing(task=task, image=img)
|
194
|
+
|
195
|
+
def run(
|
196
|
+
self,
|
197
|
+
task: str,
|
198
|
+
audio: str = None,
|
199
|
+
img: str = None,
|
200
|
+
*args,
|
201
|
+
**kwargs,
|
202
|
+
):
|
91
203
|
"""
|
92
204
|
Run the LLM model for the given task.
|
93
205
|
|
@@ -103,6 +215,8 @@ class LiteLLM:
|
|
103
215
|
|
104
216
|
messages = self._prepare_messages(task)
|
105
217
|
|
218
|
+
self.handle_modalities(task=task, audio=audio, img=img)
|
219
|
+
|
106
220
|
if self.tools_list_dictionary is not None:
|
107
221
|
response = completion(
|
108
222
|
model=self.model_name,
|
@@ -111,6 +225,7 @@ class LiteLLM:
|
|
111
225
|
temperature=self.temperature,
|
112
226
|
max_tokens=self.max_tokens,
|
113
227
|
tools=self.tools_list_dictionary,
|
228
|
+
modalities=self.modalities,
|
114
229
|
tool_choice=self.tool_choice,
|
115
230
|
parallel_tool_calls=self.parallel_tool_calls,
|
116
231
|
*args,
|
@@ -130,6 +245,7 @@ class LiteLLM:
|
|
130
245
|
stream=self.stream,
|
131
246
|
temperature=self.temperature,
|
132
247
|
max_tokens=self.max_tokens,
|
248
|
+
modalities=self.modalities,
|
133
249
|
*args,
|
134
250
|
**kwargs,
|
135
251
|
)
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: swarms
|
3
|
-
Version: 7.6.
|
3
|
+
Version: 7.6.4
|
4
4
|
Summary: Swarms - TGSC
|
5
5
|
Home-page: https://github.com/kyegomez/swarms
|
6
6
|
License: MIT
|
@@ -467,8 +467,6 @@ We provide vast array of features to save agent states using json, yaml, toml, u
|
|
467
467
|
| `tokens_checks()` | Performs token checks for the agent. |
|
468
468
|
| `print_dashboard()` | Prints the dashboard of the agent. |
|
469
469
|
| `get_docs_from_doc_folders()` | Fetches all the documents from the doc folders. |
|
470
|
-
| `activate_agentops()` | Activates agent operations. |
|
471
|
-
| `check_end_session_agentops()` | Checks the end of the session for agent operations. |
|
472
470
|
|
473
471
|
|
474
472
|
|
@@ -520,8 +518,6 @@ agent.print_dashboard()
|
|
520
518
|
agent.get_docs_from_doc_folders()
|
521
519
|
|
522
520
|
# Activate agent ops
|
523
|
-
agent.activate_agentops()
|
524
|
-
agent.check_end_session_agentops()
|
525
521
|
|
526
522
|
# Dump the model to a JSON file
|
527
523
|
agent.model_dump_json()
|
@@ -1,12 +1,12 @@
|
|
1
|
-
swarms/__init__.py,sha256=
|
2
|
-
swarms/agents/__init__.py,sha256=
|
1
|
+
swarms/__init__.py,sha256=bc-57terLt5Uxlawsdq-ER6ukbVrxxWy8PEoG7VB5Ug,560
|
2
|
+
swarms/agents/__init__.py,sha256=ebUrX9rMccQokq5XthgnzGDMISn8EyQyOIOwVAlLs1E,1190
|
3
3
|
swarms/agents/agent_judge.py,sha256=xT242CX5mV64cq2B-3RGkuEHiV5aD04P_Zq8_s64iMQ,3967
|
4
4
|
swarms/agents/agent_print.py,sha256=SXqWA2ZzXwRFdv8hkuYwOPMTasvaGTG6U29413qRCAA,918
|
5
5
|
swarms/agents/ape_agent.py,sha256=1kz_65LJgjLlY1yv2WLBeVMs7sP9BgEVWk0w1f67YLc,1563
|
6
6
|
swarms/agents/auto_generate_swarm_config.py,sha256=7eJ873xS7PJmyreMaa5Uub8qFu-qIinuyMuogB2Ehjc,8474
|
7
7
|
swarms/agents/consistency_agent.py,sha256=41h0yvnjzmKsE8-q4UsN0ckHP7WWmB5E_z64ec9QaJM,7414
|
8
8
|
swarms/agents/create_agents_from_yaml.py,sha256=PgFIpuYZehxEl79BAK6TolSZwydDQzvGMAKhLsHuBbc,13008
|
9
|
-
swarms/agents/flexion_agent.py,sha256=
|
9
|
+
swarms/agents/flexion_agent.py,sha256=Agjq1rvTzboE8lT26-mcjp0tKQEjlUj_eVYsFjLIvN0,21468
|
10
10
|
swarms/agents/gkp_agent.py,sha256=5Jms3zHQ2qwJ6-PHDh9X-cFtAlH4dSUoDgRqN-xZzog,21067
|
11
11
|
swarms/agents/i_agent.py,sha256=_eKUcgPfiVqQpF5Q-Sv1tT-JZxIeNl9Fp7OrnjVUtz8,12276
|
12
12
|
swarms/agents/openai_assistant.py,sha256=mTSEtj26J0mc5pCeWrmMY0EXzTRYQfyfw_BtOqtcCHc,11044
|
@@ -19,6 +19,8 @@ swarms/cli/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
19
19
|
swarms/cli/create_agent.py,sha256=o2V6EDQN477MxUOm0wShlr4uNyPpPzqpJhGM5tiuWUU,1128
|
20
20
|
swarms/cli/main.py,sha256=T9YsCrNIzvbQA8h5qlke-TbRP498Wu6R_KkAxRiabvs,15319
|
21
21
|
swarms/cli/onboarding_process.py,sha256=3-2LKoLhjnaPbX9iiasqXPZZpqmwm-ZrXawH88M4BIU,6940
|
22
|
+
swarms/client/__init__.py,sha256=VASeCEYoZskTU3NOw5tQ22uc2_7gyK0oLsxG_WB20ys,268
|
23
|
+
swarms/client/main.py,sha256=f-RpvfKfRK2AaapkyPN2ihXJvIGN4JWB_A7pJu4WyiU,13735
|
22
24
|
swarms/prompts/__init__.py,sha256=ZFcghAs4b0Rsjcc_DIFssiztZub5tJ66rxmJD2_tXpQ,747
|
23
25
|
swarms/prompts/accountant_swarm_prompts.py,sha256=swceN1B0fZCOedd3-y3gjNOHDmR-3H5YK17ytp7tTDM,11320
|
24
26
|
swarms/prompts/ag_prompt.py,sha256=_mydaflPh3kPpogqfObJ9UK5D8ySAGgtcO4BoNBN3LE,2658
|
@@ -44,6 +46,7 @@ swarms/prompts/idea2img.py,sha256=ZM-iD0ZFuqU2V1SY3V5Ds6ItTDd6JzQ4vpmz3faMzlM,88
|
|
44
46
|
swarms/prompts/legal_agent_prompt.py,sha256=DhIroYuviqrU7cgKz6F8U2LNSBykLH57AZqoH5AfD0U,3346
|
45
47
|
swarms/prompts/logistics.py,sha256=_XT_feYFgv-1IzHi5cPKuAp8xBjSX5KqwlPKh9xfK7E,4785
|
46
48
|
swarms/prompts/meta_system_prompt.py,sha256=GOsWqtGfFezpKyg8c876Y-kCkWGI563iS2-0AaI__MI,3374
|
49
|
+
swarms/prompts/multi_agent_collab_prompt.py,sha256=kyGWhoy50j0IxUBvxWAEBMLbIE8UbNOqixqCNHH2oFs,12610
|
47
50
|
swarms/prompts/multi_modal_autonomous_instruction_prompt.py,sha256=SHfaKs5Hj9sV4jgtVAFhv1N_N2e3jKwvdx_8G8-OdhM,10662
|
48
51
|
swarms/prompts/multi_modal_prompts.py,sha256=yvE9_RAFTKU1QhN0rNOelrO7jn5fjDARpcKussbBc2c,3511
|
49
52
|
swarms/prompts/multi_modal_visual_prompts.py,sha256=Apv5vqTzB7nBj7nnoMPO0fog3PL9KLrteEjYM_SjaEE,3225
|
@@ -78,8 +81,8 @@ swarms/schemas/__init__.py,sha256=EqqtVcpoptF1kfy19Wykp22ut4AA0z-yMQ5H9WB7ptA,18
|
|
78
81
|
swarms/schemas/agent_input_schema.py,sha256=qhPyThMx2on91yG9mzNdP_08GpMh1IRDHDwFna29jPs,6345
|
79
82
|
swarms/schemas/agent_step_schemas.py,sha256=a14gb58vR0xOwB_fwSJQbN6yb9HddEaT30E6hUrzEQA,2573
|
80
83
|
swarms/schemas/base_schemas.py,sha256=UvBLVWg2qRen4tK5GJz50v42SiX95EQ5qK7hfyAHTEU,3267
|
81
|
-
swarms/structs/__init__.py,sha256=
|
82
|
-
swarms/structs/agent.py,sha256=
|
84
|
+
swarms/structs/__init__.py,sha256=LgAeWDQxbBpUyIYgvikgSdDoDPrvNryDKYTBfflmLMk,4352
|
85
|
+
swarms/structs/agent.py,sha256=JC48tv2Jn4hNGTBvBb5Lk-LiTwnyfBO81Doyv6EWbOA,92409
|
83
86
|
swarms/structs/agent_builder.py,sha256=tYNpfO4_8cgfMHfgA5DAOWffHnt70p6CLt59esqfVCY,12133
|
84
87
|
swarms/structs/agent_registry.py,sha256=il507cO1NF-d4ChyANVLuWrN8bXsEAi8_7bLJ_sTU6A,12112
|
85
88
|
swarms/structs/agent_roles.py,sha256=8XEw6RjOOZelaZaWt4gXaYQm5WMLEhSO7W6Z8sQjmFg,582
|
@@ -89,20 +92,20 @@ swarms/structs/async_workflow.py,sha256=7YWsLPyGY-1-mMxoIXWQ0FnYH6F227nxsS9PFAJo
|
|
89
92
|
swarms/structs/auto_swarm.py,sha256=AHWswlEWDL_i3V8IP362tx6pi_B2arlZhALykrkI5OA,8215
|
90
93
|
swarms/structs/auto_swarm_builder.py,sha256=vPM5Kq59D_FvuWJB8hxgHuEvTXsxDxovlBnHGVQsM4o,10938
|
91
94
|
swarms/structs/base_structure.py,sha256=GDu4QJQQmhU7IyuFJHIh9UVThACCva-L7uoMbVD9l4s,15901
|
92
|
-
swarms/structs/base_swarm.py,sha256=
|
95
|
+
swarms/structs/base_swarm.py,sha256=LSGJDPJdyUCcK6698mNtjxoC1OU3s_J2NxC2k_ccGUs,23779
|
93
96
|
swarms/structs/base_workflow.py,sha256=DTfFwX3AdFYxACDYwUDqhsbcDZnITlg5TeEYyxmJBCc,11414
|
94
97
|
swarms/structs/concat.py,sha256=utezSxNyh1mIwXgdf8-dJ803NDPyEy79WE8zJHuooGk,732
|
95
|
-
swarms/structs/concurrent_workflow.py,sha256=
|
96
|
-
swarms/structs/conversation.py,sha256=
|
98
|
+
swarms/structs/concurrent_workflow.py,sha256=d1_slbALpxrdEGzZffUSAcEbONW0kc7fyTpVZTBmzi4,15517
|
99
|
+
swarms/structs/conversation.py,sha256=h4A4l9Mcucw1v-N0mOA4keZ9vf-l3t-kBINZlk_CrOA,18392
|
97
100
|
swarms/structs/csv_to_agent.py,sha256=ug9JqQFPguXeU9JQpSUXuVtOpHYdJhlpKJUJBovo694,9443
|
98
|
-
swarms/structs/de_hallucination_swarm.py,sha256=
|
101
|
+
swarms/structs/de_hallucination_swarm.py,sha256=9cC0rSSXGwYu6SRDwpeMbCcQ40C1WI1RE9SNapKRLOQ,10309
|
99
102
|
swarms/structs/deep_research_swarm.py,sha256=h4jtrcuiAKMWMYo8I7oaq6eFn8cJpqHhml58EveNbZ4,16756
|
100
103
|
swarms/structs/dynamic_conversational_swarm.py,sha256=n_d1jDCzBwiGb0QjJpW_MlXxqEkhGEhC1ttaebH7f3Q,8098
|
101
104
|
swarms/structs/graph_swarm.py,sha256=HPHlLWwdSPSe4o-I06ZOIgtBg72a06llEnv8-aglf3Q,20962
|
102
105
|
swarms/structs/graph_workflow.py,sha256=TAaUG_J3898hhghPOp0WEAV3Zf0in6s48ZSVbSTX-vQ,8629
|
103
|
-
swarms/structs/groupchat.py,sha256=
|
106
|
+
swarms/structs/groupchat.py,sha256=CivOw0QlpjugG8MIu5uGGVoA_0_oY6sBg0XlA08gViQ,15691
|
104
107
|
swarms/structs/hiearchical_swarm.py,sha256=XDEdy5kAISmWKraMR26VX47eCT4YgGTI2FNcBQzIvLE,35274
|
105
|
-
swarms/structs/hybrid_hiearchical_peer_swarm.py,sha256=
|
108
|
+
swarms/structs/hybrid_hiearchical_peer_swarm.py,sha256=wLdVc9gdfIUGzevWQbZN2Hvk54sjlmoTQO9RgUImD28,9216
|
106
109
|
swarms/structs/majority_voting.py,sha256=F_t_MOC3YCRyMw5N6qKdFThpaXZxwixRw592Ku5Uhto,10122
|
107
110
|
swarms/structs/malt.py,sha256=0ZOuLfOzaJ4vAVOM6J1aZ3yWAiKxfMkNIBNp8pjsEqE,19392
|
108
111
|
swarms/structs/matrix_swarm.py,sha256=qHuhOYrTyOv6ujHMe8PrQT-h-WmaCPCfX4ghv5L8UFI,9765
|
@@ -110,17 +113,17 @@ swarms/structs/meme_agent_persona_generator.py,sha256=b3kKlumhsV4KV88-GS3CUnGO1U
|
|
110
113
|
swarms/structs/mixture_of_agents.py,sha256=G8_MVMrDd0-ZD_gJ5YZgtTCUjl7COha9Me-vOYMXsAE,10575
|
111
114
|
swarms/structs/model_router.py,sha256=V5pZHYlxSmCvAA2Gsns7LaCz8dXtRi7pCvb-oLGHYIY,12739
|
112
115
|
swarms/structs/multi_agent_collab.py,sha256=odh2NQRR23LidsphCxUfAke369lDdgL__w3Xovu9jkA,7731
|
113
|
-
swarms/structs/multi_agent_exec.py,sha256=
|
116
|
+
swarms/structs/multi_agent_exec.py,sha256=Gxwr9mHADX3n29pdxor-dQDnKPSNdnicpCxBLmPwnLg,14344
|
114
117
|
swarms/structs/multi_agent_orchestrator.py,sha256=_trjXCW31ZeVR7N2hURLUPDZhYa-Wa3ADMk1wnNJdcQ,13400
|
115
118
|
swarms/structs/octotools.py,sha256=GZo0qtFM69W7vvewk6_k09vicgw0c0_v7MiPvEZCagE,31406
|
116
119
|
swarms/structs/omni_agent_types.py,sha256=RdKLfZ-lXDJrEa0aJT_Rfx9TypJQo8SISqKz4fnLkAk,230
|
117
120
|
swarms/structs/output_types.py,sha256=F1jNbDLJrubRIUyheMGMahJfGikbWZ_yNmbE9QVIz9A,280
|
118
121
|
swarms/structs/pulsar_swarm.py,sha256=4_L0GqPBgnA3AJajpNLgO4IAG6U36nIntFK9WNJScv8,15968
|
119
122
|
swarms/structs/queue_swarm.py,sha256=8vcA-rh280midcdgfA5IwJzBmMgdn71nRH6KndWu-DA,6770
|
120
|
-
swarms/structs/rearrange.py,sha256=
|
123
|
+
swarms/structs/rearrange.py,sha256=5u7HwTVVH414w9rhEQvLdltW1ACHjgwn-zS8-8JEXmA,22576
|
121
124
|
swarms/structs/round_robin.py,sha256=MGk623KiN9uSxTMG6MY_BIAkvEDh1RPwyl5Min7GLOU,7573
|
122
125
|
swarms/structs/safe_loading.py,sha256=gmYX8G9TsvAIp6OCvREBZt5mwSFc-p-t1rSnDBfhEmE,7124
|
123
|
-
swarms/structs/sequential_workflow.py,sha256=
|
126
|
+
swarms/structs/sequential_workflow.py,sha256=5jxHP-a2CzdclSXIrVWkQKXBr01VzrgOBIexR9s8diw,8492
|
124
127
|
swarms/structs/spreadsheet_swarm.py,sha256=ToX56QJjlm_nnC3MYppvKC_NTr9Zy_orkBzfxNLdwbA,14845
|
125
128
|
swarms/structs/stopping_conditions.py,sha256=Z0Jx0U2feAfQfuVV_IJGgal62DoVsGPN8K6HkkqB_bM,484
|
126
129
|
swarms/structs/swarm_arange.py,sha256=6fexCPsXRgdLbpY0p9rp_REipeXzsbv1_GOtD9B4HaI,15179
|
@@ -131,17 +134,16 @@ swarms/structs/swarm_load_balancer.py,sha256=pUCc5FEBcuJ_GmOFeTWBPfXlUdiTOjYcJqV
|
|
131
134
|
swarms/structs/swarm_matcher.py,sha256=E2KwHHEJxmW-UfTeMPWZ6VCmYdQ_I9_fwrfJbxD02GY,23322
|
132
135
|
swarms/structs/swarm_output_type.py,sha256=tW8Iqar1Jaf2Lzw66nAPc6MDk7-srQl5_XUKFvzoam4,755
|
133
136
|
swarms/structs/swarm_registry.py,sha256=P0XRrqp1qBNyt0BycqPQljUzKv9jClaQMhtaBMinhYg,5578
|
134
|
-
swarms/structs/swarm_router.py,sha256=
|
137
|
+
swarms/structs/swarm_router.py,sha256=05G0weYMUUo-20xgSeUnwCaH1lf6p1epXllI_iXo18Y,26854
|
135
138
|
swarms/structs/swarming_architectures.py,sha256=VvkSA9nQnF91V2C5-ALwSY1peZckeM1G4pPeQS7IVsE,13109
|
136
|
-
swarms/structs/swarms_api.py,sha256=f-RpvfKfRK2AaapkyPN2ihXJvIGN4JWB_A7pJu4WyiU,13735
|
137
139
|
swarms/structs/talk_hier.py,sha256=npyEuL52SCgQmMynIvGjfatNqOz4toq0EyhEtSNmQhQ,25649
|
138
140
|
swarms/structs/tree_swarm.py,sha256=AnIxrt0KhWxAQN8uGjfCcOq-XCmsuTJiH8Ex4mXy8V8,12500
|
139
141
|
swarms/structs/utils.py,sha256=Mo6wHQYOB8baWZUKnAJN5Dsgubpo81umNwJIEDitb2A,1873
|
140
142
|
swarms/structs/various_alt_swarms.py,sha256=qdBuOF31UjatlKRu-9bxwyRQzIjohRhTv_63YoUeYEY,27866
|
141
143
|
swarms/structs/workspace_manager.py,sha256=t0OgUP9dDU7xS6N3mAT2PbXvjHTsUK3nf2mxppcfZ70,5473
|
142
144
|
swarms/telemetry/__init__.py,sha256=yibtkHEbQRPUv6ir1FhDHlAO_3nwKJPQH4LjzBC2AuQ,661
|
143
|
-
swarms/telemetry/bootup.py,sha256=
|
144
|
-
swarms/telemetry/main.py,sha256=
|
145
|
+
swarms/telemetry/bootup.py,sha256=0leCNCy5rhzL19EsOsqHWSDI85KVcWO6_5hLDS0h4sY,1155
|
146
|
+
swarms/telemetry/main.py,sha256=QBQyO4JgIeMLGbdVPFaipIBasCMwuADB5wDNKQBEYDQ,9474
|
145
147
|
swarms/tools/__init__.py,sha256=pqIMcRQr4gtoNdbyI1N5k4upkYSBMxACJbxfB9yrV4c,1493
|
146
148
|
swarms/tools/base_tool.py,sha256=BiBCFHin8AyZO3FYOGA-n3M2o-F36xUeIBUiybnZYjI,15179
|
147
149
|
swarms/tools/cohere_func_call_schema.py,sha256=XJ6_yBMXCrV9KjN7v9Bk1iFj69TRlGIWYKsUTA1oGiQ,600
|
@@ -161,21 +163,19 @@ swarms/tools/tool_registry.py,sha256=ULZmIKBTx9XRCJRD9hwXfY3iQw9v94arw-VV6jcuftY
|
|
161
163
|
swarms/tools/tool_schema_base_model.py,sha256=0biTGIoibsPPP3fOrkC6WvNU5vXaalyccVKC1fpO_eg,1409
|
162
164
|
swarms/tools/tool_utils.py,sha256=yXzzqG7Ytd8ybB8bsjNUNLaXIuIp9JbbpUKCiHxQqo8,2816
|
163
165
|
swarms/utils/__init__.py,sha256=9qKE_11pxom74j3qExSm6Z_LwR5lrpC5YG17v22eLlo,975
|
164
|
-
swarms/utils/agent_ops_check.py,sha256=08UomeSv1uw_oEDlum0yG-5SsKkxqPRbeIWeKC75b08,685
|
165
166
|
swarms/utils/any_to_str.py,sha256=Qi4N9ed6LYnCs2AeFYo1zwEfYhOKUesGVFUmVUz54KI,2936
|
166
|
-
swarms/utils/auto_download_check_packages.py,sha256=
|
167
|
+
swarms/utils/auto_download_check_packages.py,sha256=mqx3jCetfkTuxTdeGLx-gGMB1xWOU5vata8lTKXLatk,4580
|
167
168
|
swarms/utils/calculate_func_metrics.py,sha256=Nb5r7rWf809m5F7mWIYXZ0H_WeyGr78A2UZD2GHtJkM,5007
|
168
169
|
swarms/utils/data_to_text.py,sha256=1PUoWokylp7MOrGNk1cmO3cJlfskdAIiImGk9ECwsKU,3427
|
169
|
-
swarms/utils/disable_logging.py,sha256
|
170
|
+
swarms/utils/disable_logging.py,sha256=KKPKQVfQqLPFgj03uveOoyeHOTlfEJt-yfLc3SA53Rk,2470
|
170
171
|
swarms/utils/file_processing.py,sha256=QjQCIPTcwicQlfy656BXBYpIzMR0s2343E7ftnok5Uo,4865
|
171
172
|
swarms/utils/formatter.py,sha256=YykmcuWXkxvQ7a2Vq6OzWuqUDiIwro6VrtSt4ITbXcU,4194
|
172
173
|
swarms/utils/function_caller_model.py,sha256=ZfgCMzOizNnuZipYLclTziECNHszH9p8RQcUq7VNr4Q,4156
|
173
|
-
swarms/utils/history_output_formatter.py,sha256=
|
174
|
+
swarms/utils/history_output_formatter.py,sha256=WHcd0xhSNRDKakXtkCjv0nW1NF-GM9SYcey3RrN5gl8,778
|
174
175
|
swarms/utils/litellm_tokenizer.py,sha256=0AAj4NffBe2eHii_3_5SpQAhSiBbunJR8MzaBTIm7hg,484
|
175
|
-
swarms/utils/litellm_wrapper.py,sha256=
|
176
|
+
swarms/utils/litellm_wrapper.py,sha256=cXZ6nUrHnGhpVgolgbpNsyKq1_TzupJs8vmw-_XtCRM,11255
|
176
177
|
swarms/utils/loguru_logger.py,sha256=hIoSK3NHLpe7eAmjHRURrEYzNXYC2gbR7_Vv63Yaydk,685
|
177
178
|
swarms/utils/markdown_message.py,sha256=RThHNnMf6ZLTlYK4vKn3yuewChaxWAYAWb0Xm_pTyIU,652
|
178
|
-
swarms/utils/pandas_utils.py,sha256=AA0wNWM05CrNovW7x9aY63Zhw7CIGMERmxvjH2Q-Jjc,2567
|
179
179
|
swarms/utils/parse_code.py,sha256=XFOLymbdP3HzMZuqsj7pwUyisvUmTm0ev9iThR_ambI,1987
|
180
180
|
swarms/utils/pdf_to_text.py,sha256=nkySOS_sJ4Jf4RP5SoDpMB5WfjJ_GGc5z8gJfn2cxOM,1311
|
181
181
|
swarms/utils/str_to_dict.py,sha256=T3Jsdjz87WIlkSo7jAW6BB80sv0Ns49WT1qXlOrdEoE,874
|
@@ -183,8 +183,8 @@ swarms/utils/swarm_reliability_checks.py,sha256=MsgUULt3HYg72D0HifZNmtCyJYpLA2UD
|
|
183
183
|
swarms/utils/try_except_wrapper.py,sha256=appEGu9Afy3TmdkNNXUgQ9yU9lj2j0uNkIoW0JhVzzY,3917
|
184
184
|
swarms/utils/visualizer.py,sha256=0ylohEk62MAS6iPRaDOV03m9qo2k5J56tWlKJk_46p4,16927
|
185
185
|
swarms/utils/wrapper_clusterop.py,sha256=PMSCVM7ZT1vgj1D_MYAe835RR3SMLYxA-si2JS02yNQ,4220
|
186
|
-
swarms-7.6.
|
187
|
-
swarms-7.6.
|
188
|
-
swarms-7.6.
|
189
|
-
swarms-7.6.
|
190
|
-
swarms-7.6.
|
186
|
+
swarms-7.6.4.dist-info/LICENSE,sha256=jwRtEmTWjLrEsvFB6QFdYs2cEeZPRMdj-UMOFkPF8_0,11363
|
187
|
+
swarms-7.6.4.dist-info/METADATA,sha256=FihAIDYyoPwxvfsXfvpCsMzdQMHvBZ7fXkp5v06DIUE,104909
|
188
|
+
swarms-7.6.4.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
189
|
+
swarms-7.6.4.dist-info/entry_points.txt,sha256=2K0rTtfO1X1WaO-waJlXIKw5Voa_EpAL_yU0HXE2Jgc,47
|
190
|
+
swarms-7.6.4.dist-info/RECORD,,
|
swarms/utils/agent_ops_check.py
DELETED
@@ -1,26 +0,0 @@
|
|
1
|
-
from swarms.utils.loguru_logger import logger
|
2
|
-
import os
|
3
|
-
|
4
|
-
|
5
|
-
def try_import_agentops(*args, **kwargs):
|
6
|
-
try:
|
7
|
-
logger.info("Trying to import agentops")
|
8
|
-
import agentops
|
9
|
-
|
10
|
-
agentops.init(os.getenv("AGENTOPS_API_KEY"), *args, **kwargs)
|
11
|
-
|
12
|
-
return "agentops imported successfully."
|
13
|
-
except ImportError:
|
14
|
-
logger.error("Could not import agentops")
|
15
|
-
|
16
|
-
|
17
|
-
def end_session_agentops():
|
18
|
-
try:
|
19
|
-
logger.info("Trying to end session")
|
20
|
-
import agentops
|
21
|
-
|
22
|
-
agentops.end_session("Success")
|
23
|
-
return "Session ended successfully."
|
24
|
-
except ImportError:
|
25
|
-
logger.error("Could not import agentops")
|
26
|
-
return "Could not end session."
|
swarms/utils/pandas_utils.py
DELETED
@@ -1,92 +0,0 @@
|
|
1
|
-
import subprocess
|
2
|
-
from typing import Any, Dict, List
|
3
|
-
|
4
|
-
from swarms.utils.loguru_logger import initialize_logger
|
5
|
-
|
6
|
-
from pydantic import BaseModel
|
7
|
-
|
8
|
-
from swarms.structs.agent import Agent
|
9
|
-
|
10
|
-
logger = initialize_logger(log_folder="pandas_utils")
|
11
|
-
|
12
|
-
|
13
|
-
def display_agents_info(agents: List[Agent]) -> None:
|
14
|
-
"""
|
15
|
-
Displays information about all agents in a list using a DataFrame.
|
16
|
-
|
17
|
-
:param agents: List of Agent instances.
|
18
|
-
"""
|
19
|
-
# Extracting relevant information from each agent
|
20
|
-
|
21
|
-
try:
|
22
|
-
import pandas as pd
|
23
|
-
except ImportError:
|
24
|
-
logger.error("Failed to import pandas")
|
25
|
-
subprocess.run(["pip", "install", "pandas"])
|
26
|
-
import pandas as pd
|
27
|
-
|
28
|
-
agent_data = []
|
29
|
-
for agent in agents:
|
30
|
-
try:
|
31
|
-
agent_info = {
|
32
|
-
"ID": agent.id,
|
33
|
-
"Name": agent.agent_name,
|
34
|
-
"Description": agent.description,
|
35
|
-
"max_loops": agent.max_loops,
|
36
|
-
# "Docs": agent.docs,
|
37
|
-
"System Prompt": agent.system_prompt,
|
38
|
-
"LLM Model": agent.llm.model_name, # type: ignore
|
39
|
-
}
|
40
|
-
agent_data.append(agent_info)
|
41
|
-
except AttributeError as e:
|
42
|
-
logger.error(
|
43
|
-
f"Failed to extract information from agent {agent}: {e}"
|
44
|
-
)
|
45
|
-
continue
|
46
|
-
|
47
|
-
# Creating a DataFrame to display the data
|
48
|
-
try:
|
49
|
-
df = pd.DataFrame(agent_data)
|
50
|
-
except Exception as e:
|
51
|
-
logger.error(f"Failed to create DataFrame: {e}")
|
52
|
-
return
|
53
|
-
|
54
|
-
# Displaying the DataFrame
|
55
|
-
try:
|
56
|
-
print(df)
|
57
|
-
except Exception as e:
|
58
|
-
logger.error(f"Failed to print DataFrame: {e}")
|
59
|
-
|
60
|
-
|
61
|
-
def dict_to_dataframe(data: Dict[str, Any]):
|
62
|
-
"""
|
63
|
-
Converts a dictionary into a pandas DataFrame.
|
64
|
-
|
65
|
-
:param data: Dictionary to convert.
|
66
|
-
:return: A pandas DataFrame representation of the dictionary.
|
67
|
-
"""
|
68
|
-
try:
|
69
|
-
import pandas as pd
|
70
|
-
except ImportError:
|
71
|
-
logger.error("Failed to import pandas")
|
72
|
-
subprocess.run(["pip", "install", "pandas"])
|
73
|
-
import pandas as pd
|
74
|
-
|
75
|
-
# Convert dictionary to DataFrame
|
76
|
-
df = pd.json_normalize(data)
|
77
|
-
return df
|
78
|
-
|
79
|
-
|
80
|
-
def pydantic_model_to_dataframe(model: BaseModel) -> any:
|
81
|
-
"""
|
82
|
-
Converts a Pydantic Base Model into a pandas DataFrame.
|
83
|
-
|
84
|
-
:param model: Pydantic Base Model to convert.
|
85
|
-
:return: A pandas DataFrame representation of the Pydantic model.
|
86
|
-
"""
|
87
|
-
# Convert Pydantic model to dictionary
|
88
|
-
model_dict = model.dict()
|
89
|
-
|
90
|
-
# Convert dictionary to DataFrame
|
91
|
-
df = dict_to_dataframe(model_dict)
|
92
|
-
return df
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|