swarms 7.9.4__py3-none-any.whl → 7.9.6__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 +11 -33
- swarms/structs/interactive_groupchat.py +1 -1
- swarms/utils/formatter.py +21 -6
- {swarms-7.9.4.dist-info → swarms-7.9.6.dist-info}/METADATA +1 -1
- {swarms-7.9.4.dist-info → swarms-7.9.6.dist-info}/RECORD +8 -8
- {swarms-7.9.4.dist-info → swarms-7.9.6.dist-info}/LICENSE +0 -0
- {swarms-7.9.4.dist-info → swarms-7.9.6.dist-info}/WHEEL +0 -0
- {swarms-7.9.4.dist-info → swarms-7.9.6.dist-info}/entry_points.txt +0 -0
swarms/structs/agent.py
CHANGED
@@ -433,7 +433,7 @@ class Agent:
|
|
433
433
|
output_raw_json_from_tool_call: bool = False,
|
434
434
|
summarize_multiple_images: bool = False,
|
435
435
|
tool_retry_attempts: int = 3,
|
436
|
-
speed_mode: str =
|
436
|
+
speed_mode: str = None,
|
437
437
|
*args,
|
438
438
|
**kwargs,
|
439
439
|
):
|
@@ -1359,8 +1359,6 @@ class Agent:
|
|
1359
1359
|
f"Structured Output - Attempting Function Call Execution [{time.strftime('%H:%M:%S')}] \n\n {format_data_structure(response)} ",
|
1360
1360
|
loop_count,
|
1361
1361
|
)
|
1362
|
-
elif self.streaming_on is True:
|
1363
|
-
pass
|
1364
1362
|
else:
|
1365
1363
|
self.pretty_print(
|
1366
1364
|
response, loop_count
|
@@ -2864,13 +2862,6 @@ class Agent:
|
|
2864
2862
|
*args,
|
2865
2863
|
**kwargs,
|
2866
2864
|
)
|
2867
|
-
elif self.speed_mode == "fast":
|
2868
|
-
output = self._run_fast(
|
2869
|
-
task=task,
|
2870
|
-
img=img,
|
2871
|
-
*args,
|
2872
|
-
**kwargs,
|
2873
|
-
)
|
2874
2865
|
else:
|
2875
2866
|
output = self._run(
|
2876
2867
|
task=task,
|
@@ -3017,23 +3008,16 @@ class Agent:
|
|
3017
3008
|
return self.role
|
3018
3009
|
|
3019
3010
|
def pretty_print(self, response: str, loop_count: int):
|
3020
|
-
|
3021
|
-
#
|
3022
|
-
|
3023
|
-
|
3024
|
-
|
3025
|
-
|
3026
|
-
|
3027
|
-
|
3028
|
-
|
3029
|
-
|
3030
|
-
# response,
|
3031
|
-
# f"Agent Name {self.agent_name} [Max Loops: {loop_count} ]",
|
3032
|
-
# )
|
3033
|
-
formatter.print_panel(
|
3034
|
-
response,
|
3035
|
-
f"Agent Name {self.agent_name} [Max Loops: {loop_count} ]",
|
3036
|
-
)
|
3011
|
+
"""Print the response in a formatted panel"""
|
3012
|
+
# Handle None response
|
3013
|
+
if response is None:
|
3014
|
+
response = "No response generated"
|
3015
|
+
|
3016
|
+
if self.print_on:
|
3017
|
+
formatter.print_panel(
|
3018
|
+
response,
|
3019
|
+
f"Agent Name {self.agent_name} [Max Loops: {loop_count} ]",
|
3020
|
+
)
|
3037
3021
|
|
3038
3022
|
def parse_llm_output(self, response: Any):
|
3039
3023
|
"""Parse and standardize the output from the LLM.
|
@@ -3436,9 +3420,3 @@ class Agent:
|
|
3436
3420
|
f"Full traceback: {traceback.format_exc()}. "
|
3437
3421
|
f"Attempting to retry tool execution with 3 attempts"
|
3438
3422
|
)
|
3439
|
-
retry_function(
|
3440
|
-
self.execute_tools,
|
3441
|
-
response=response,
|
3442
|
-
loop_count=loop_count,
|
3443
|
-
max_retries=self.tool_retry_attempts,
|
3444
|
-
)
|
@@ -962,7 +962,7 @@ Remember: You are part of a team. Your response should reflect that you've read,
|
|
962
962
|
if "@" in task:
|
963
963
|
mentioned_agents = self._extract_mentions(task)
|
964
964
|
else:
|
965
|
-
|
965
|
+
mentioned_agents = list(self.agent_map.keys())
|
966
966
|
|
967
967
|
# Add user task to conversation
|
968
968
|
self.conversation.add(role="User", content=task)
|
swarms/utils/formatter.py
CHANGED
@@ -127,12 +127,27 @@ class Formatter:
|
|
127
127
|
title: str = "",
|
128
128
|
style: str = "bold blue",
|
129
129
|
) -> None:
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
130
|
+
"""Print content in a panel with a title and style.
|
131
|
+
|
132
|
+
Args:
|
133
|
+
content (str): The content to display in the panel
|
134
|
+
title (str): The title of the panel
|
135
|
+
style (str): The style to apply to the panel
|
136
|
+
"""
|
137
|
+
# Handle None content
|
138
|
+
if content is None:
|
139
|
+
content = "No content to display"
|
140
|
+
|
141
|
+
# Convert non-string content to string
|
142
|
+
if not isinstance(content, str):
|
143
|
+
content = str(content)
|
144
|
+
|
145
|
+
try:
|
146
|
+
self._print_panel(content, title, style)
|
147
|
+
except Exception:
|
148
|
+
# Fallback to basic printing if panel fails
|
149
|
+
print(f"\n{title}:")
|
150
|
+
print(content)
|
136
151
|
|
137
152
|
def print_table(
|
138
153
|
self, title: str, data: Dict[str, List[str]]
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.3
|
2
2
|
Name: swarms
|
3
|
-
Version: 7.9.
|
3
|
+
Version: 7.9.6
|
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=XFLzI5UThDsod3C67GUxKMnmNpXBUmjAxA7GJTwPHUI,126260
|
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
|
@@ -131,7 +131,7 @@ swarms/structs/groupchat.py,sha256=jjH0BqU9Nrd_3jl9QzrcvbSce527SFpUaepawaRiw2o,1
|
|
131
131
|
swarms/structs/hiearchical_swarm.py,sha256=6JwYWlsmwsVtOr2xlzl2q0IRsGvr-RFzDG9ClIJWTQo,33400
|
132
132
|
swarms/structs/hybrid_hiearchical_peer_swarm.py,sha256=0BrmzSVit-I_04DFfrs7onLblLA6PSPa0JE3-4j05FA,9316
|
133
133
|
swarms/structs/image_batch_processor.py,sha256=31Z8vTVL4dw18QxGwb0Jg1nvp0YzX8lwVgGj_-KrkhY,8207
|
134
|
-
swarms/structs/interactive_groupchat.py,sha256=
|
134
|
+
swarms/structs/interactive_groupchat.py,sha256=ZPbQWykxhaL9inlqGw1lGxPn-PKJINyTh26GkwC7mnM,40412
|
135
135
|
swarms/structs/long_agent.py,sha256=KFjE2uUI8ONTkeJO43Sh3y5-Ec0kga28BECGklic-S4,15049
|
136
136
|
swarms/structs/ma_blocks.py,sha256=04dF3DOSHXxNwrcl9QUloKgNDkI9yLRv6UbyyiKsIb0,4551
|
137
137
|
swarms/structs/ma_utils.py,sha256=-7wTLVq9PHbXxt3QP9ngFA4mHV8H4dIOmhrXml4Iwcc,5933
|
@@ -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.6.dist-info/LICENSE,sha256=jwRtEmTWjLrEsvFB6QFdYs2cEeZPRMdj-UMOFkPF8_0,11363
|
212
|
+
swarms-7.9.6.dist-info/METADATA,sha256=2WjpqWQuTllW22h5vMVctltb3LDHObC8U9PFVCCQJ-w,32138
|
213
|
+
swarms-7.9.6.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
|
214
|
+
swarms-7.9.6.dist-info/entry_points.txt,sha256=2K0rTtfO1X1WaO-waJlXIKw5Voa_EpAL_yU0HXE2Jgc,47
|
215
|
+
swarms-7.9.6.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|