swarms 7.9.5__py3-none-any.whl → 7.9.7__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/agent.py +6 -21
- swarms/utils/formatter.py +4 -4
- {swarms-7.9.5.dist-info → swarms-7.9.7.dist-info}/METADATA +1 -1
- {swarms-7.9.5.dist-info → swarms-7.9.7.dist-info}/RECORD +7 -7
- {swarms-7.9.5.dist-info → swarms-7.9.7.dist-info}/LICENSE +0 -0
- {swarms-7.9.5.dist-info → swarms-7.9.7.dist-info}/WHEEL +0 -0
- {swarms-7.9.5.dist-info → swarms-7.9.7.dist-info}/entry_points.txt +0 -0
swarms/structs/agent.py
CHANGED
@@ -86,7 +86,6 @@ from swarms.utils.index import (
|
|
86
86
|
)
|
87
87
|
from swarms.schemas.conversation_schema import ConversationSchema
|
88
88
|
from swarms.utils.output_types import OutputType
|
89
|
-
from swarms.utils.retry_func import retry_function
|
90
89
|
|
91
90
|
|
92
91
|
def stop_when_repeats(response: str) -> bool:
|
@@ -605,7 +604,8 @@ class Agent:
|
|
605
604
|
|
606
605
|
# Run sequential operations after all concurrent tasks are done
|
607
606
|
# self.agent_output = self.agent_output_model()
|
608
|
-
|
607
|
+
if self.autosave is True:
|
608
|
+
log_agent_data(self.to_dict())
|
609
609
|
|
610
610
|
if exists(self.tools):
|
611
611
|
self.tool_handling()
|
@@ -1147,9 +1147,8 @@ class Agent:
|
|
1147
1147
|
|
1148
1148
|
except Exception as e:
|
1149
1149
|
|
1150
|
-
log_agent_data(self.to_dict())
|
1151
|
-
|
1152
1150
|
if self.autosave is True:
|
1151
|
+
log_agent_data(self.to_dict())
|
1153
1152
|
self.save()
|
1154
1153
|
|
1155
1154
|
logger.error(
|
@@ -1159,9 +1158,9 @@ class Agent:
|
|
1159
1158
|
|
1160
1159
|
if not success:
|
1161
1160
|
|
1162
|
-
log_agent_data(self.to_dict())
|
1163
1161
|
|
1164
1162
|
if self.autosave is True:
|
1163
|
+
log_agent_data(self.to_dict())
|
1165
1164
|
self.save()
|
1166
1165
|
|
1167
1166
|
logger.error(
|
@@ -1220,7 +1219,6 @@ class Agent:
|
|
1220
1219
|
|
1221
1220
|
self.save()
|
1222
1221
|
|
1223
|
-
log_agent_data(self.to_dict())
|
1224
1222
|
|
1225
1223
|
# Output formatting based on output_type
|
1226
1224
|
return history_output_formatter(
|
@@ -1359,8 +1357,6 @@ class Agent:
|
|
1359
1357
|
f"Structured Output - Attempting Function Call Execution [{time.strftime('%H:%M:%S')}] \n\n {format_data_structure(response)} ",
|
1360
1358
|
loop_count,
|
1361
1359
|
)
|
1362
|
-
elif self.streaming_on is True:
|
1363
|
-
pass
|
1364
1360
|
else:
|
1365
1361
|
self.pretty_print(
|
1366
1362
|
response, loop_count
|
@@ -1422,10 +1418,9 @@ class Agent:
|
|
1422
1418
|
def __handle_run_error(self, error: any):
|
1423
1419
|
import traceback
|
1424
1420
|
|
1425
|
-
log_agent_data(self.to_dict())
|
1426
|
-
|
1427
1421
|
if self.autosave is True:
|
1428
1422
|
self.save()
|
1423
|
+
log_agent_data(self.to_dict())
|
1429
1424
|
|
1430
1425
|
# Get detailed error information
|
1431
1426
|
error_type = type(error).__name__
|
@@ -3011,14 +3006,10 @@ class Agent:
|
|
3011
3006
|
|
3012
3007
|
def pretty_print(self, response: str, loop_count: int):
|
3013
3008
|
"""Print the response in a formatted panel"""
|
3014
|
-
# Skip printing if streaming is already handling output
|
3015
|
-
if self.streaming_on is True:
|
3016
|
-
return
|
3017
|
-
|
3018
3009
|
# Handle None response
|
3019
3010
|
if response is None:
|
3020
3011
|
response = "No response generated"
|
3021
|
-
|
3012
|
+
|
3022
3013
|
if self.print_on:
|
3023
3014
|
formatter.print_panel(
|
3024
3015
|
response,
|
@@ -3426,9 +3417,3 @@ class Agent:
|
|
3426
3417
|
f"Full traceback: {traceback.format_exc()}. "
|
3427
3418
|
f"Attempting to retry tool execution with 3 attempts"
|
3428
3419
|
)
|
3429
|
-
retry_function(
|
3430
|
-
self.execute_tools,
|
3431
|
-
response=response,
|
3432
|
-
loop_count=loop_count,
|
3433
|
-
max_retries=self.tool_retry_attempts,
|
3434
|
-
)
|
swarms/utils/formatter.py
CHANGED
@@ -128,7 +128,7 @@ class Formatter:
|
|
128
128
|
style: str = "bold blue",
|
129
129
|
) -> None:
|
130
130
|
"""Print content in a panel with a title and style.
|
131
|
-
|
131
|
+
|
132
132
|
Args:
|
133
133
|
content (str): The content to display in the panel
|
134
134
|
title (str): The title of the panel
|
@@ -137,14 +137,14 @@ class Formatter:
|
|
137
137
|
# Handle None content
|
138
138
|
if content is None:
|
139
139
|
content = "No content to display"
|
140
|
-
|
140
|
+
|
141
141
|
# Convert non-string content to string
|
142
142
|
if not isinstance(content, str):
|
143
143
|
content = str(content)
|
144
|
-
|
144
|
+
|
145
145
|
try:
|
146
146
|
self._print_panel(content, title, style)
|
147
|
-
except Exception
|
147
|
+
except Exception:
|
148
148
|
# Fallback to basic printing if panel fails
|
149
149
|
print(f"\n{title}:")
|
150
150
|
print(content)
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.3
|
2
2
|
Name: swarms
|
3
|
-
Version: 7.9.
|
3
|
+
Version: 7.9.7
|
4
4
|
Summary: Swarms - TGSC
|
5
5
|
License: MIT
|
6
6
|
Keywords: artificial intelligence,deep learning,optimizers,Prompt Engineering,swarms,agents,llms,transformers,multi-agent,swarms of agents,Enterprise-Grade Agents,Production-Grade Agents,Agents,Multi-Grade-Agents,Swarms,Transformers,LLMs,Prompt Engineering,Agents,Generative Agents,Generative AI,Agent Marketplace,Agent Store,quant,finance,algorithmic trading,portfolio optimization,risk management,financial modeling,machine learning for finance,natural language processing for finance
|
@@ -106,7 +106,7 @@ swarms/schemas/mcp_schemas.py,sha256=XZJ4HyiY_cv8Gvj-53ddjzXuqT9hBU2f0cHbhIKs_jY
|
|
106
106
|
swarms/schemas/swarms_api_schemas.py,sha256=uKqleW_7hNpqHi06yoba9jS2i9yzZp-SBV944MnkN68,6233
|
107
107
|
swarms/schemas/tool_schema_base_model.py,sha256=0biTGIoibsPPP3fOrkC6WvNU5vXaalyccVKC1fpO_eg,1409
|
108
108
|
swarms/structs/__init__.py,sha256=8_CG2mct9cS-TQlpKlC5-240kSjmoooy9bfYXRuB9oQ,4552
|
109
|
-
swarms/structs/agent.py,sha256=
|
109
|
+
swarms/structs/agent.py,sha256=rcRsJzuHWyZn65xkEdcTBtXajJG58aqgflqAzuAWbh8,126214
|
110
110
|
swarms/structs/agent_builder.py,sha256=tYNpfO4_8cgfMHfgA5DAOWffHnt70p6CLt59esqfVCY,12133
|
111
111
|
swarms/structs/agent_rag_handler.py,sha256=g17YRrNmf16TLvyFCCcsitVk3d-QNZmck_XYmjSN_YM,21372
|
112
112
|
swarms/structs/agent_registry.py,sha256=il507cO1NF-d4ChyANVLuWrN8bXsEAi8_7bLJ_sTU6A,12112
|
@@ -192,7 +192,7 @@ swarms/utils/check_all_model_max_tokens.py,sha256=ZHIKlrU-L-OM2IJAbYkCoVyBKe2d0J
|
|
192
192
|
swarms/utils/data_to_text.py,sha256=1PUoWokylp7MOrGNk1cmO3cJlfskdAIiImGk9ECwsKU,3427
|
193
193
|
swarms/utils/disable_logging.py,sha256=KKPKQVfQqLPFgj03uveOoyeHOTlfEJt-yfLc3SA53Rk,2470
|
194
194
|
swarms/utils/file_processing.py,sha256=QjQCIPTcwicQlfy656BXBYpIzMR0s2343E7ftnok5Uo,4865
|
195
|
-
swarms/utils/formatter.py,sha256=
|
195
|
+
swarms/utils/formatter.py,sha256=vJSuW4F69COuyuKYP-M_3EpAUMWnI8iGuFRdPe1TYQo,15227
|
196
196
|
swarms/utils/function_caller_model.py,sha256=ZfgCMzOizNnuZipYLclTziECNHszH9p8RQcUq7VNr4Q,4156
|
197
197
|
swarms/utils/generate_keys.py,sha256=o5zp_8rwu5sgQnItWS1xAuIIRIkahwm02qy1vsV6DSQ,997
|
198
198
|
swarms/utils/history_output_formatter.py,sha256=whjfk4N5SjMo3mtrafNny_alNiAhQcGza3l1dCyg7Nw,1388
|
@@ -208,8 +208,8 @@ swarms/utils/str_to_dict.py,sha256=T3Jsdjz87WIlkSo7jAW6BB80sv0Ns49WT1qXlOrdEoE,8
|
|
208
208
|
swarms/utils/try_except_wrapper.py,sha256=uvDZDZJcH986EF0Ej6zZBLcqHJ58NHizPsAH5olrE7Q,3919
|
209
209
|
swarms/utils/vllm_wrapper.py,sha256=sNkm4EbeMrqqmHidnvq5zTnofQAaARy3HIrNBu11lKs,5072
|
210
210
|
swarms/utils/xml_utils.py,sha256=D4nEdo1nkHqSoTKrWylXBXjcHFhGaOYvvfGNQQoYV5o,2514
|
211
|
-
swarms-7.9.
|
212
|
-
swarms-7.9.
|
213
|
-
swarms-7.9.
|
214
|
-
swarms-7.9.
|
215
|
-
swarms-7.9.
|
211
|
+
swarms-7.9.7.dist-info/LICENSE,sha256=jwRtEmTWjLrEsvFB6QFdYs2cEeZPRMdj-UMOFkPF8_0,11363
|
212
|
+
swarms-7.9.7.dist-info/METADATA,sha256=uqHRzlFy3bD9SSoBhilTbBWpkT_a_exSTpzSTGN7btg,32138
|
213
|
+
swarms-7.9.7.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
|
214
|
+
swarms-7.9.7.dist-info/entry_points.txt,sha256=2K0rTtfO1X1WaO-waJlXIKw5Voa_EpAL_yU0HXE2Jgc,47
|
215
|
+
swarms-7.9.7.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|