swarms 7.6.7__tar.gz → 7.7.0__tar.gz

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.
Files changed (189) hide show
  1. {swarms-7.6.7 → swarms-7.7.0}/PKG-INFO +1 -2
  2. {swarms-7.6.7 → swarms-7.7.0}/pyproject.toml +1 -2
  3. {swarms-7.6.7 → swarms-7.7.0}/swarms/__init__.py +1 -0
  4. {swarms-7.6.7 → swarms-7.7.0}/swarms/structs/agent.py +81 -79
  5. {swarms-7.6.7 → swarms-7.7.0}/swarms/structs/deep_research_swarm.py +4 -4
  6. {swarms-7.6.7 → swarms-7.7.0}/swarms/structs/swarm_builder.py +0 -5
  7. {swarms-7.6.7 → swarms-7.7.0}/swarms/telemetry/main.py +103 -65
  8. {swarms-7.6.7 → swarms-7.7.0}/swarms/utils/litellm_wrapper.py +24 -10
  9. swarms-7.6.7/swarms/structs/workspace_manager.py +0 -178
  10. swarms-7.6.7/swarms/utils/swarm_reliability_checks.py +0 -81
  11. {swarms-7.6.7 → swarms-7.7.0}/LICENSE +0 -0
  12. {swarms-7.6.7 → swarms-7.7.0}/README.md +0 -0
  13. {swarms-7.6.7 → swarms-7.7.0}/swarms/agents/__init__.py +0 -0
  14. {swarms-7.6.7 → swarms-7.7.0}/swarms/agents/agent_judge.py +0 -0
  15. {swarms-7.6.7 → swarms-7.7.0}/swarms/agents/agent_print.py +0 -0
  16. {swarms-7.6.7 → swarms-7.7.0}/swarms/agents/ape_agent.py +0 -0
  17. {swarms-7.6.7 → swarms-7.7.0}/swarms/agents/auto_generate_swarm_config.py +0 -0
  18. {swarms-7.6.7 → swarms-7.7.0}/swarms/agents/consistency_agent.py +0 -0
  19. {swarms-7.6.7 → swarms-7.7.0}/swarms/agents/create_agents_from_yaml.py +0 -0
  20. {swarms-7.6.7 → swarms-7.7.0}/swarms/agents/flexion_agent.py +0 -0
  21. {swarms-7.6.7 → swarms-7.7.0}/swarms/agents/gkp_agent.py +0 -0
  22. {swarms-7.6.7 → swarms-7.7.0}/swarms/agents/i_agent.py +0 -0
  23. {swarms-7.6.7 → swarms-7.7.0}/swarms/agents/openai_assistant.py +0 -0
  24. {swarms-7.6.7 → swarms-7.7.0}/swarms/agents/reasoning_agents.py +0 -0
  25. {swarms-7.6.7 → swarms-7.7.0}/swarms/agents/reasoning_duo.py +0 -0
  26. {swarms-7.6.7 → swarms-7.7.0}/swarms/agents/tool_agent.py +0 -0
  27. {swarms-7.6.7 → swarms-7.7.0}/swarms/artifacts/__init__.py +0 -0
  28. {swarms-7.6.7 → swarms-7.7.0}/swarms/artifacts/main_artifact.py +0 -0
  29. {swarms-7.6.7 → swarms-7.7.0}/swarms/cli/__init__.py +0 -0
  30. {swarms-7.6.7 → swarms-7.7.0}/swarms/cli/create_agent.py +0 -0
  31. {swarms-7.6.7 → swarms-7.7.0}/swarms/cli/main.py +0 -0
  32. {swarms-7.6.7 → swarms-7.7.0}/swarms/cli/onboarding_process.py +0 -0
  33. {swarms-7.6.7 → swarms-7.7.0}/swarms/client/__init__.py +0 -0
  34. {swarms-7.6.7 → swarms-7.7.0}/swarms/client/main.py +0 -0
  35. {swarms-7.6.7 → swarms-7.7.0}/swarms/prompts/__init__.py +0 -0
  36. {swarms-7.6.7 → swarms-7.7.0}/swarms/prompts/accountant_swarm_prompts.py +0 -0
  37. {swarms-7.6.7 → swarms-7.7.0}/swarms/prompts/ag_prompt.py +0 -0
  38. {swarms-7.6.7 → swarms-7.7.0}/swarms/prompts/aga.py +0 -0
  39. {swarms-7.6.7 → swarms-7.7.0}/swarms/prompts/agent_judge_prompt.py +0 -0
  40. {swarms-7.6.7 → swarms-7.7.0}/swarms/prompts/agent_prompt.py +0 -0
  41. {swarms-7.6.7 → swarms-7.7.0}/swarms/prompts/agent_prompts.py +0 -0
  42. {swarms-7.6.7 → swarms-7.7.0}/swarms/prompts/agent_system_prompts.py +0 -0
  43. {swarms-7.6.7 → swarms-7.7.0}/swarms/prompts/ai_research_team.py +0 -0
  44. {swarms-7.6.7 → swarms-7.7.0}/swarms/prompts/aot_prompt.py +0 -0
  45. {swarms-7.6.7 → swarms-7.7.0}/swarms/prompts/autobloggen.py +0 -0
  46. {swarms-7.6.7 → swarms-7.7.0}/swarms/prompts/autoswarm.py +0 -0
  47. {swarms-7.6.7 → swarms-7.7.0}/swarms/prompts/chat_prompt.py +0 -0
  48. {swarms-7.6.7 → swarms-7.7.0}/swarms/prompts/code_interpreter.py +0 -0
  49. {swarms-7.6.7 → swarms-7.7.0}/swarms/prompts/code_spawner.py +0 -0
  50. {swarms-7.6.7 → swarms-7.7.0}/swarms/prompts/debate.py +0 -0
  51. {swarms-7.6.7 → swarms-7.7.0}/swarms/prompts/documentation.py +0 -0
  52. {swarms-7.6.7 → swarms-7.7.0}/swarms/prompts/education.py +0 -0
  53. {swarms-7.6.7 → swarms-7.7.0}/swarms/prompts/finance_agent_prompt.py +0 -0
  54. {swarms-7.6.7 → swarms-7.7.0}/swarms/prompts/finance_agent_sys_prompt.py +0 -0
  55. {swarms-7.6.7 → swarms-7.7.0}/swarms/prompts/growth_agent_prompt.py +0 -0
  56. {swarms-7.6.7 → swarms-7.7.0}/swarms/prompts/idea2img.py +0 -0
  57. {swarms-7.6.7 → swarms-7.7.0}/swarms/prompts/legal_agent_prompt.py +0 -0
  58. {swarms-7.6.7 → swarms-7.7.0}/swarms/prompts/logistics.py +0 -0
  59. {swarms-7.6.7 → swarms-7.7.0}/swarms/prompts/meta_system_prompt.py +0 -0
  60. {swarms-7.6.7 → swarms-7.7.0}/swarms/prompts/multi_agent_collab_prompt.py +0 -0
  61. {swarms-7.6.7 → swarms-7.7.0}/swarms/prompts/multi_modal_autonomous_instruction_prompt.py +0 -0
  62. {swarms-7.6.7 → swarms-7.7.0}/swarms/prompts/multi_modal_prompts.py +0 -0
  63. {swarms-7.6.7 → swarms-7.7.0}/swarms/prompts/multi_modal_visual_prompts.py +0 -0
  64. {swarms-7.6.7 → swarms-7.7.0}/swarms/prompts/operations_agent_prompt.py +0 -0
  65. {swarms-7.6.7 → swarms-7.7.0}/swarms/prompts/personal_stylist.py +0 -0
  66. {swarms-7.6.7 → swarms-7.7.0}/swarms/prompts/product_agent_prompt.py +0 -0
  67. {swarms-7.6.7 → swarms-7.7.0}/swarms/prompts/programming.py +0 -0
  68. {swarms-7.6.7 → swarms-7.7.0}/swarms/prompts/project_manager.py +0 -0
  69. {swarms-7.6.7 → swarms-7.7.0}/swarms/prompts/prompt.py +0 -0
  70. {swarms-7.6.7 → swarms-7.7.0}/swarms/prompts/prompt_generator.py +0 -0
  71. {swarms-7.6.7 → swarms-7.7.0}/swarms/prompts/prompt_generator_optimizer.py +0 -0
  72. {swarms-7.6.7 → swarms-7.7.0}/swarms/prompts/python.py +0 -0
  73. {swarms-7.6.7 → swarms-7.7.0}/swarms/prompts/react.py +0 -0
  74. {swarms-7.6.7 → swarms-7.7.0}/swarms/prompts/reasoning_prompt.py +0 -0
  75. {swarms-7.6.7 → swarms-7.7.0}/swarms/prompts/refiner_agent_prompt.py +0 -0
  76. {swarms-7.6.7 → swarms-7.7.0}/swarms/prompts/sales.py +0 -0
  77. {swarms-7.6.7 → swarms-7.7.0}/swarms/prompts/sales_prompts.py +0 -0
  78. {swarms-7.6.7 → swarms-7.7.0}/swarms/prompts/security_team.py +0 -0
  79. {swarms-7.6.7 → swarms-7.7.0}/swarms/prompts/self_operating_prompt.py +0 -0
  80. {swarms-7.6.7 → swarms-7.7.0}/swarms/prompts/sop_generator_agent_prompt.py +0 -0
  81. {swarms-7.6.7 → swarms-7.7.0}/swarms/prompts/summaries_prompts.py +0 -0
  82. {swarms-7.6.7 → swarms-7.7.0}/swarms/prompts/support_agent_prompt.py +0 -0
  83. {swarms-7.6.7 → swarms-7.7.0}/swarms/prompts/swarm_manager_agent.py +0 -0
  84. {swarms-7.6.7 → swarms-7.7.0}/swarms/prompts/task_assignment_prompt.py +0 -0
  85. {swarms-7.6.7 → swarms-7.7.0}/swarms/prompts/tests.py +0 -0
  86. {swarms-7.6.7 → swarms-7.7.0}/swarms/prompts/tools.py +0 -0
  87. {swarms-7.6.7 → swarms-7.7.0}/swarms/prompts/urban_planning.py +0 -0
  88. {swarms-7.6.7 → swarms-7.7.0}/swarms/prompts/visual_cot.py +0 -0
  89. {swarms-7.6.7 → swarms-7.7.0}/swarms/prompts/worker_prompt.py +0 -0
  90. {swarms-7.6.7 → swarms-7.7.0}/swarms/prompts/xray_swarm_prompt.py +0 -0
  91. {swarms-7.6.7 → swarms-7.7.0}/swarms/schemas/__init__.py +0 -0
  92. {swarms-7.6.7 → swarms-7.7.0}/swarms/schemas/agent_input_schema.py +0 -0
  93. {swarms-7.6.7 → swarms-7.7.0}/swarms/schemas/agent_step_schemas.py +0 -0
  94. {swarms-7.6.7 → swarms-7.7.0}/swarms/schemas/base_schemas.py +0 -0
  95. {swarms-7.6.7 → swarms-7.7.0}/swarms/structs/__init__.py +0 -0
  96. {swarms-7.6.7 → swarms-7.7.0}/swarms/structs/agent_builder.py +0 -0
  97. {swarms-7.6.7 → swarms-7.7.0}/swarms/structs/agent_registry.py +0 -0
  98. {swarms-7.6.7 → swarms-7.7.0}/swarms/structs/agent_roles.py +0 -0
  99. {swarms-7.6.7 → swarms-7.7.0}/swarms/structs/agent_router.py +0 -0
  100. {swarms-7.6.7 → swarms-7.7.0}/swarms/structs/agents_available.py +0 -0
  101. {swarms-7.6.7 → swarms-7.7.0}/swarms/structs/async_workflow.py +0 -0
  102. {swarms-7.6.7 → swarms-7.7.0}/swarms/structs/auto_swarm_builder.py +0 -0
  103. {swarms-7.6.7 → swarms-7.7.0}/swarms/structs/base_structure.py +0 -0
  104. {swarms-7.6.7 → swarms-7.7.0}/swarms/structs/base_swarm.py +0 -0
  105. {swarms-7.6.7 → swarms-7.7.0}/swarms/structs/base_workflow.py +0 -0
  106. {swarms-7.6.7 → swarms-7.7.0}/swarms/structs/concat.py +0 -0
  107. {swarms-7.6.7 → swarms-7.7.0}/swarms/structs/concurrent_workflow.py +0 -0
  108. {swarms-7.6.7 → swarms-7.7.0}/swarms/structs/conversation.py +0 -0
  109. {swarms-7.6.7 → swarms-7.7.0}/swarms/structs/csv_to_agent.py +0 -0
  110. {swarms-7.6.7 → swarms-7.7.0}/swarms/structs/de_hallucination_swarm.py +0 -0
  111. {swarms-7.6.7 → swarms-7.7.0}/swarms/structs/dynamic_conversational_swarm.py +0 -0
  112. {swarms-7.6.7 → swarms-7.7.0}/swarms/structs/graph_swarm.py +0 -0
  113. {swarms-7.6.7 → swarms-7.7.0}/swarms/structs/graph_workflow.py +0 -0
  114. {swarms-7.6.7 → swarms-7.7.0}/swarms/structs/groupchat.py +0 -0
  115. {swarms-7.6.7 → swarms-7.7.0}/swarms/structs/hiearchical_swarm.py +0 -0
  116. {swarms-7.6.7 → swarms-7.7.0}/swarms/structs/hybrid_hiearchical_peer_swarm.py +0 -0
  117. {swarms-7.6.7 → swarms-7.7.0}/swarms/structs/majority_voting.py +0 -0
  118. {swarms-7.6.7 → swarms-7.7.0}/swarms/structs/malt.py +0 -0
  119. {swarms-7.6.7 → swarms-7.7.0}/swarms/structs/matrix_swarm.py +0 -0
  120. {swarms-7.6.7 → swarms-7.7.0}/swarms/structs/meme_agent_persona_generator.py +0 -0
  121. {swarms-7.6.7 → swarms-7.7.0}/swarms/structs/mixture_of_agents.py +0 -0
  122. {swarms-7.6.7 → swarms-7.7.0}/swarms/structs/model_router.py +0 -0
  123. {swarms-7.6.7 → swarms-7.7.0}/swarms/structs/multi_agent_collab.py +0 -0
  124. {swarms-7.6.7 → swarms-7.7.0}/swarms/structs/multi_agent_exec.py +0 -0
  125. {swarms-7.6.7 → swarms-7.7.0}/swarms/structs/multi_agent_orchestrator.py +0 -0
  126. {swarms-7.6.7 → swarms-7.7.0}/swarms/structs/octotools.py +0 -0
  127. {swarms-7.6.7 → swarms-7.7.0}/swarms/structs/omni_agent_types.py +0 -0
  128. {swarms-7.6.7 → swarms-7.7.0}/swarms/structs/output_types.py +0 -0
  129. {swarms-7.6.7 → swarms-7.7.0}/swarms/structs/pulsar_swarm.py +0 -0
  130. {swarms-7.6.7 → swarms-7.7.0}/swarms/structs/queue_swarm.py +0 -0
  131. {swarms-7.6.7 → swarms-7.7.0}/swarms/structs/rearrange.py +0 -0
  132. {swarms-7.6.7 → swarms-7.7.0}/swarms/structs/round_robin.py +0 -0
  133. {swarms-7.6.7 → swarms-7.7.0}/swarms/structs/safe_loading.py +0 -0
  134. {swarms-7.6.7 → swarms-7.7.0}/swarms/structs/sequential_workflow.py +0 -0
  135. {swarms-7.6.7 → swarms-7.7.0}/swarms/structs/spreadsheet_swarm.py +0 -0
  136. {swarms-7.6.7 → swarms-7.7.0}/swarms/structs/stopping_conditions.py +0 -0
  137. {swarms-7.6.7 → swarms-7.7.0}/swarms/structs/swarm_arange.py +0 -0
  138. {swarms-7.6.7 → swarms-7.7.0}/swarms/structs/swarm_eval.py +0 -0
  139. {swarms-7.6.7 → swarms-7.7.0}/swarms/structs/swarm_id_generator.py +0 -0
  140. {swarms-7.6.7 → swarms-7.7.0}/swarms/structs/swarm_load_balancer.py +0 -0
  141. {swarms-7.6.7 → swarms-7.7.0}/swarms/structs/swarm_matcher.py +0 -0
  142. {swarms-7.6.7 → swarms-7.7.0}/swarms/structs/swarm_output_type.py +0 -0
  143. {swarms-7.6.7 → swarms-7.7.0}/swarms/structs/swarm_registry.py +0 -0
  144. {swarms-7.6.7 → swarms-7.7.0}/swarms/structs/swarm_router.py +0 -0
  145. {swarms-7.6.7 → swarms-7.7.0}/swarms/structs/swarming_architectures.py +0 -0
  146. {swarms-7.6.7 → swarms-7.7.0}/swarms/structs/talk_hier.py +0 -0
  147. {swarms-7.6.7 → swarms-7.7.0}/swarms/structs/tree_swarm.py +0 -0
  148. {swarms-7.6.7 → swarms-7.7.0}/swarms/structs/utils.py +0 -0
  149. {swarms-7.6.7 → swarms-7.7.0}/swarms/structs/various_alt_swarms.py +0 -0
  150. {swarms-7.6.7 → swarms-7.7.0}/swarms/telemetry/__init__.py +0 -0
  151. {swarms-7.6.7 → swarms-7.7.0}/swarms/telemetry/bootup.py +0 -0
  152. {swarms-7.6.7 → swarms-7.7.0}/swarms/tools/__init__.py +0 -0
  153. {swarms-7.6.7 → swarms-7.7.0}/swarms/tools/base_tool.py +0 -0
  154. {swarms-7.6.7 → swarms-7.7.0}/swarms/tools/cohere_func_call_schema.py +0 -0
  155. {swarms-7.6.7 → swarms-7.7.0}/swarms/tools/func_calling_utils.py +0 -0
  156. {swarms-7.6.7 → swarms-7.7.0}/swarms/tools/func_to_str.py +0 -0
  157. {swarms-7.6.7 → swarms-7.7.0}/swarms/tools/function_util.py +0 -0
  158. {swarms-7.6.7 → swarms-7.7.0}/swarms/tools/json_former.py +0 -0
  159. {swarms-7.6.7 → swarms-7.7.0}/swarms/tools/json_utils.py +0 -0
  160. {swarms-7.6.7 → swarms-7.7.0}/swarms/tools/logits_processor.py +0 -0
  161. {swarms-7.6.7 → swarms-7.7.0}/swarms/tools/mcp_integration.py +0 -0
  162. {swarms-7.6.7 → swarms-7.7.0}/swarms/tools/openai_func_calling_schema_pydantic.py +0 -0
  163. {swarms-7.6.7 → swarms-7.7.0}/swarms/tools/openai_tool_creator_decorator.py +0 -0
  164. {swarms-7.6.7 → swarms-7.7.0}/swarms/tools/py_func_to_openai_func_str.py +0 -0
  165. {swarms-7.6.7 → swarms-7.7.0}/swarms/tools/pydantic_to_json.py +0 -0
  166. {swarms-7.6.7 → swarms-7.7.0}/swarms/tools/tool_parse_exec.py +0 -0
  167. {swarms-7.6.7 → swarms-7.7.0}/swarms/tools/tool_registry.py +0 -0
  168. {swarms-7.6.7 → swarms-7.7.0}/swarms/tools/tool_schema_base_model.py +0 -0
  169. {swarms-7.6.7 → swarms-7.7.0}/swarms/tools/tool_utils.py +0 -0
  170. {swarms-7.6.7 → swarms-7.7.0}/swarms/utils/__init__.py +0 -0
  171. {swarms-7.6.7 → swarms-7.7.0}/swarms/utils/any_to_str.py +0 -0
  172. {swarms-7.6.7 → swarms-7.7.0}/swarms/utils/auto_download_check_packages.py +0 -0
  173. {swarms-7.6.7 → swarms-7.7.0}/swarms/utils/calculate_func_metrics.py +0 -0
  174. {swarms-7.6.7 → swarms-7.7.0}/swarms/utils/data_to_text.py +0 -0
  175. {swarms-7.6.7 → swarms-7.7.0}/swarms/utils/disable_logging.py +0 -0
  176. {swarms-7.6.7 → swarms-7.7.0}/swarms/utils/file_processing.py +0 -0
  177. {swarms-7.6.7 → swarms-7.7.0}/swarms/utils/formatter.py +0 -0
  178. {swarms-7.6.7 → swarms-7.7.0}/swarms/utils/function_caller_model.py +0 -0
  179. {swarms-7.6.7 → swarms-7.7.0}/swarms/utils/history_output_formatter.py +0 -0
  180. {swarms-7.6.7 → swarms-7.7.0}/swarms/utils/litellm_tokenizer.py +0 -0
  181. {swarms-7.6.7 → swarms-7.7.0}/swarms/utils/loguru_logger.py +0 -0
  182. {swarms-7.6.7 → swarms-7.7.0}/swarms/utils/markdown_message.py +0 -0
  183. {swarms-7.6.7 → swarms-7.7.0}/swarms/utils/parse_code.py +0 -0
  184. {swarms-7.6.7 → swarms-7.7.0}/swarms/utils/pdf_to_text.py +0 -0
  185. {swarms-7.6.7 → swarms-7.7.0}/swarms/utils/str_to_dict.py +0 -0
  186. {swarms-7.6.7 → swarms-7.7.0}/swarms/utils/try_except_wrapper.py +0 -0
  187. {swarms-7.6.7 → swarms-7.7.0}/swarms/utils/visualizer.py +0 -0
  188. {swarms-7.6.7 → swarms-7.7.0}/swarms/utils/vllm_wrapper.py +0 -0
  189. {swarms-7.6.7 → swarms-7.7.0}/swarms/utils/wrapper_clusterop.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: swarms
3
- Version: 7.6.7
3
+ Version: 7.7.0
4
4
  Summary: Swarms - TGSC
5
5
  Home-page: https://github.com/kyegomez/swarms
6
6
  License: MIT
@@ -23,7 +23,6 @@ Requires-Dist: docstring_parser (==0.16)
23
23
  Requires-Dist: httpx
24
24
  Requires-Dist: litellm
25
25
  Requires-Dist: loguru
26
- Requires-Dist: mcp
27
26
  Requires-Dist: networkx
28
27
  Requires-Dist: numpy
29
28
  Requires-Dist: psutil
@@ -5,7 +5,7 @@ build-backend = "poetry.core.masonry.api"
5
5
 
6
6
  [tool.poetry]
7
7
  name = "swarms"
8
- version = "7.6.7"
8
+ version = "7.7.0"
9
9
  description = "Swarms - TGSC"
10
10
  license = "MIT"
11
11
  authors = ["Kye Gomez <kye@apac.ai>"]
@@ -77,7 +77,6 @@ numpy = "*"
77
77
  litellm = "*"
78
78
  torch = "*"
79
79
  httpx = "*"
80
- mcp = "*"
81
80
 
82
81
  [tool.poetry.scripts]
83
82
  swarms = "swarms.cli.main:main"
@@ -7,6 +7,7 @@ from swarms.telemetry.bootup import bootup # noqa: E402, F403
7
7
  bootup()
8
8
 
9
9
  from swarms.agents import * # noqa: E402, F403
10
+
10
11
  from swarms.artifacts import * # noqa: E402, F403
11
12
  from swarms.prompts import * # noqa: E402, F403
12
13
  from swarms.schemas import * # noqa: E402, F403
@@ -46,11 +46,12 @@ from swarms.structs.safe_loading import (
46
46
  )
47
47
  from swarms.telemetry.main import log_agent_data
48
48
  from swarms.tools.base_tool import BaseTool
49
- from swarms.tools.mcp_integration import (
50
- MCPServerSseParams,
51
- batch_mcp_flow,
52
- mcp_flow_get_tool_schema,
53
- )
49
+
50
+ # from swarms.tools.mcp_integration import (
51
+ # MCPServerSseParams,
52
+ # batch_mcp_flow,
53
+ # mcp_flow_get_tool_schema,
54
+ # )
54
55
  from swarms.tools.tool_parse_exec import parse_and_execute_json
55
56
  from swarms.utils.any_to_str import any_to_str
56
57
  from swarms.utils.data_to_text import data_to_text
@@ -62,7 +63,6 @@ from swarms.utils.history_output_formatter import (
62
63
  from swarms.utils.litellm_tokenizer import count_tokens
63
64
  from swarms.utils.litellm_wrapper import LiteLLM
64
65
  from swarms.utils.pdf_to_text import pdf_to_text
65
- from swarms.utils.str_to_dict import str_to_dict
66
66
 
67
67
 
68
68
  # Utils
@@ -403,7 +403,7 @@ class Agent:
403
403
  role: agent_roles = "worker",
404
404
  no_print: bool = False,
405
405
  tools_list_dictionary: Optional[List[Dict[str, Any]]] = None,
406
- mcp_servers: List[MCPServerSseParams] = [],
406
+ # mcp_servers: List[MCPServerSseParams] = [],
407
407
  *args,
408
408
  **kwargs,
409
409
  ):
@@ -523,7 +523,7 @@ class Agent:
523
523
  self.role = role
524
524
  self.no_print = no_print
525
525
  self.tools_list_dictionary = tools_list_dictionary
526
- self.mcp_servers = mcp_servers
526
+ # self.mcp_servers = mcp_servers
527
527
  self._cached_llm = (
528
528
  None # Add this line to cache the LLM instance
529
529
  )
@@ -643,11 +643,11 @@ class Agent:
643
643
  if self.llm is None:
644
644
  self.llm = self.llm_handling()
645
645
 
646
- if (
647
- self.tools_list_dictionary is None
648
- and self.mcp_servers is not None
649
- ):
650
- self.tools_list_dictionary = self.mcp_tool_handling()
646
+ # if (
647
+ # self.tools_list_dictionary is None
648
+ # and self.mcp_servers is not None
649
+ # ):
650
+ # self.tools_list_dictionary = self.mcp_tool_handling()
651
651
 
652
652
  def llm_handling(self):
653
653
  # Use cached instance if available
@@ -695,68 +695,68 @@ class Agent:
695
695
  )
696
696
  return None
697
697
 
698
- def mcp_execution_flow(self, response: any):
699
- """
700
- Executes the MCP (Model Context Protocol) flow based on the provided response.
701
-
702
- This method takes a response, converts it from a string to a dictionary format,
703
- and checks for the presence of a tool name or a name in the response. If either
704
- is found, it retrieves the tool name and proceeds to call the batch_mcp_flow
705
- function to execute the corresponding tool actions.
706
-
707
- Args:
708
- response (any): The response to be processed, which can be in string format
709
- that represents a dictionary.
710
-
711
- Returns:
712
- The output from the batch_mcp_flow function, which contains the results of
713
- the tool execution. If an error occurs during processing, it logs the error
714
- and returns None.
715
-
716
- Raises:
717
- Exception: Logs any exceptions that occur during the execution flow.
718
- """
719
- try:
720
- response = str_to_dict(response)
721
-
722
- tool_output = batch_mcp_flow(
723
- self.mcp_servers,
724
- function_call=response,
725
- )
726
-
727
- return tool_output
728
- except Exception as e:
729
- logger.error(f"Error in mcp_execution_flow: {e}")
730
- return None
731
-
732
- def mcp_tool_handling(self):
733
- """
734
- Handles the retrieval of tool schemas from the MCP servers.
735
-
736
- This method iterates over the list of MCP servers, retrieves the tool schema
737
- for each server using the mcp_flow_get_tool_schema function, and compiles
738
- these schemas into a list. The resulting list is stored in the
739
- tools_list_dictionary attribute.
740
-
741
- Returns:
742
- list: A list of tool schemas retrieved from the MCP servers. If an error
743
- occurs during the retrieval process, it logs the error and returns None.
744
-
745
- Raises:
746
- Exception: Logs any exceptions that occur during the tool handling process.
747
- """
748
- try:
749
- self.tools_list_dictionary = []
750
-
751
- for mcp_server in self.mcp_servers:
752
- tool_schema = mcp_flow_get_tool_schema(mcp_server)
753
- self.tools_list_dictionary.append(tool_schema)
754
-
755
- print(self.tools_list_dictionary)
756
- return self.tools_list_dictionary
757
- except Exception as e:
758
- logger.error(f"Error in mcp_tool_handling: {e}")
759
- return None
698
+ # def mcp_execution_flow(self, response: any):
699
+ # """
700
+ # Executes the MCP (Model Context Protocol) flow based on the provided response.
701
+
702
+ # This method takes a response, converts it from a string to a dictionary format,
703
+ # and checks for the presence of a tool name or a name in the response. If either
704
+ # is found, it retrieves the tool name and proceeds to call the batch_mcp_flow
705
+ # function to execute the corresponding tool actions.
706
+
707
+ # Args:
708
+ # response (any): The response to be processed, which can be in string format
709
+ # that represents a dictionary.
710
+
711
+ # Returns:
712
+ # The output from the batch_mcp_flow function, which contains the results of
713
+ # the tool execution. If an error occurs during processing, it logs the error
714
+ # and returns None.
715
+
716
+ # Raises:
717
+ # Exception: Logs any exceptions that occur during the execution flow.
718
+ # """
719
+ # try:
720
+ # response = str_to_dict(response)
721
+
722
+ # tool_output = batch_mcp_flow(
723
+ # self.mcp_servers,
724
+ # function_call=response,
725
+ # )
726
+
727
+ # return tool_output
728
+ # except Exception as e:
729
+ # logger.error(f"Error in mcp_execution_flow: {e}")
730
+ # return None
731
+
732
+ # def mcp_tool_handling(self):
733
+ # """
734
+ # Handles the retrieval of tool schemas from the MCP servers.
735
+
736
+ # This method iterates over the list of MCP servers, retrieves the tool schema
737
+ # for each server using the mcp_flow_get_tool_schema function, and compiles
738
+ # these schemas into a list. The resulting list is stored in the
739
+ # tools_list_dictionary attribute.
740
+
741
+ # Returns:
742
+ # list: A list of tool schemas retrieved from the MCP servers. If an error
743
+ # occurs during the retrieval process, it logs the error and returns None.
744
+
745
+ # Raises:
746
+ # Exception: Logs any exceptions that occur during the tool handling process.
747
+ # """
748
+ # try:
749
+ # self.tools_list_dictionary = []
750
+
751
+ # for mcp_server in self.mcp_servers:
752
+ # tool_schema = mcp_flow_get_tool_schema(mcp_server)
753
+ # self.tools_list_dictionary.append(tool_schema)
754
+
755
+ # print(self.tools_list_dictionary)
756
+ # return self.tools_list_dictionary
757
+ # except Exception as e:
758
+ # logger.error(f"Error in mcp_tool_handling: {e}")
759
+ # return None
760
760
 
761
761
  def setup_config(self):
762
762
  # The max_loops will be set dynamically if the dynamic_loop
@@ -2490,10 +2490,12 @@ class Agent:
2490
2490
  **kwargs,
2491
2491
  )
2492
2492
 
2493
- if self.tools_list_dictionary is not None:
2494
- return str_to_dict(output)
2495
- else:
2496
- return output
2493
+ return output
2494
+
2495
+ # if self.tools_list_dictionary is not None:
2496
+ # return str_to_dict(output)
2497
+ # else:
2498
+ # return output
2497
2499
 
2498
2500
  except ValueError as e:
2499
2501
  self._handle_run_error(e)
@@ -176,20 +176,20 @@ tools = [
176
176
  "type": "function",
177
177
  "function": {
178
178
  "name": "search_topic",
179
- "description": "Conduct an in-depth search on a specified topic or subtopic, generating a comprehensive array of highly detailed search queries tailored to the input parameters.",
179
+ "description": "Conduct a thorough search on a specified topic or subtopic, generating a precise array of highly detailed search queries tailored to the input parameters.",
180
180
  "parameters": {
181
181
  "type": "object",
182
182
  "properties": {
183
183
  "depth": {
184
184
  "type": "integer",
185
- "description": "Indicates the level of thoroughness for the search. Values range from 1 to 3, where 1 represents a superficial search and 3 signifies an exploration of the topic.",
185
+ "description": "Indicates the level of thoroughness for the search. Values range from 1 to 3, where 1 signifies a superficial search and 3 indicates an in-depth exploration of the topic.",
186
186
  },
187
187
  "detailed_queries": {
188
188
  "type": "array",
189
- "description": "An array of highly specific search queries that are generated based on the input query and the specified depth. Each query should be designed to elicit detailed and relevant information from various sources.",
189
+ "description": "An array of specific search queries generated based on the input query and the specified depth. Each query must be crafted to elicit detailed and relevant information from various sources.",
190
190
  "items": {
191
191
  "type": "string",
192
- "description": "Each item in this array should represent a unique search query that targets a specific aspect of the main topic, ensuring a comprehensive exploration of the subject matter.",
192
+ "description": "Each item in this array must represent a unique search query targeting a specific aspect of the main topic, ensuring a comprehensive exploration of the subject matter.",
193
193
  },
194
194
  },
195
195
  },
@@ -177,11 +177,6 @@ class AutoSwarmBuilder:
177
177
  swarm_type=swarm_type,
178
178
  )
179
179
 
180
- if not self.api_key:
181
- raise ValueError(
182
- "OpenAI API key must be provided either through initialization or environment variable"
183
- )
184
-
185
180
  logger.info(
186
181
  "Initialized AutoSwarmBuilder",
187
182
  extra={
@@ -1,18 +1,25 @@
1
+ # Add these imports at the top
2
+ import asyncio
3
+
4
+
1
5
  import datetime
2
6
  import hashlib
3
7
  import platform
4
8
  import socket
5
9
  import subprocess
6
- import threading
7
10
  import uuid
11
+ from concurrent.futures import ThreadPoolExecutor
12
+ from functools import lru_cache
13
+ from threading import Lock
8
14
  from typing import Dict
9
15
 
10
16
  import aiohttp
11
- import httpx
12
17
  import pkg_resources
13
18
  import psutil
14
- import requests
15
19
  import toml
20
+ from requests import Session
21
+ from requests.adapters import HTTPAdapter
22
+ from urllib3.util.retry import Retry
16
23
 
17
24
 
18
25
  # Helper functions
@@ -251,92 +258,123 @@ def capture_system_data() -> Dict[str, str]:
251
258
  "architecture": platform.architecture()[0],
252
259
  }
253
260
 
254
- # Get external IP address
255
- try:
256
- system_data["external_ip"] = requests.get(
257
- "https://api.ipify.org"
258
- ).text
259
- except Exception:
260
- system_data["external_ip"] = "N/A"
261
-
262
261
  return system_data
263
262
  except Exception as e:
264
263
  # logger.error("Failed to capture system data: {}", e)
265
264
  print(f"Failed to capture system data: {e}")
266
- return {}
267
265
 
268
266
 
269
- def _log_agent_data(data_dict: dict) -> dict | None:
270
- """
271
267
 
272
- Args:
273
- data_dict (dict): The dictionary containing the agent data to be logged.
268
+ # Global variables
269
+ _session = None
270
+ _session_lock = Lock()
271
+ _executor = ThreadPoolExecutor(max_workers=10)
272
+ _aiohttp_session = None
273
+
274
+ def get_session() -> Session:
275
+ """Thread-safe session getter with optimized connection pooling"""
276
+ global _session
277
+ if _session is None:
278
+ with _session_lock:
279
+ if _session is None: # Double-check pattern
280
+ _session = Session()
281
+ adapter = HTTPAdapter(
282
+ pool_connections=1000, # Increased pool size
283
+ pool_maxsize=1000, # Increased max size
284
+ max_retries=Retry(
285
+ total=3,
286
+ backoff_factor=0.1,
287
+ status_forcelist=[500, 502, 503, 504]
288
+ ),
289
+ pool_block=False # Non-blocking pool
290
+ )
291
+ _session.mount('http://', adapter)
292
+ _session.mount('https://', adapter)
293
+ _session.headers.update({
294
+ "Content-Type": "application/json",
295
+ "Authorization": "Bearer sk-33979fd9a4e8e6b670090e4900a33dbe7452a15ccc705745f4eca2a70c88ea24",
296
+ "Connection": "keep-alive" # Enable keep-alive
297
+ })
298
+ return _session
299
+
300
+ @lru_cache(maxsize=2048, typed=True)
301
+ def get_user_device_data_cached():
302
+ """Cached version with increased cache size"""
303
+ return get_user_device_data()
304
+
305
+ async def get_aiohttp_session():
306
+ """Get or create aiohttp session for async requests"""
307
+ global _aiohttp_session
308
+ if _aiohttp_session is None or _aiohttp_session.closed:
309
+ timeout = aiohttp.ClientTimeout(total=10)
310
+ connector = aiohttp.TCPConnector(
311
+ limit=1000, # Connection limit
312
+ ttl_dns_cache=300, # DNS cache TTL
313
+ use_dns_cache=True, # Enable DNS caching
314
+ keepalive_timeout=60 # Keep-alive timeout
315
+ )
316
+ _aiohttp_session = aiohttp.ClientSession(
317
+ timeout=timeout,
318
+ connector=connector,
319
+ headers={
320
+ "Content-Type": "application/json",
321
+ "Authorization": "Bearer sk-33979fd9a4e8e6b670090e4900a33dbe7452a15ccc705745f4eca2a70c88ea24",
322
+ }
323
+ )
324
+ return _aiohttp_session
274
325
 
275
- Returns:
276
- dict | None: The JSON response from the server if successful, otherwise None.
277
- """
326
+ async def log_agent_data_async(data_dict: dict):
327
+ """Asynchronous version of log_agent_data"""
278
328
  if not data_dict:
279
329
  return None
280
330
 
281
331
  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
332
  payload = {
288
333
  "data": data_dict,
289
- "system_data": get_user_device_data(),
290
- "timestamp": datetime.datetime.now(datetime.UTC).isoformat(),
334
+ "system_data": get_user_device_data_cached(),
335
+ "timestamp": datetime.datetime.now(datetime.timezone.utc).isoformat(),
291
336
  }
292
337
 
338
+ session = await get_aiohttp_session()
293
339
  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()
340
+ async with session.post(url, json=payload) as response:
341
+ if response.status == 200:
342
+ return await response.json()
298
343
  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
-
344
+ return None
308
345
 
309
- async def async_log_agent_data(data_dict: dict) -> dict | None:
346
+ def log_agent_data(data_dict: dict):
310
347
  """
311
-
312
- Args:
313
- data_dict (dict): The dictionary containing the agent data to be logged.
314
-
315
- Returns:
316
- dict | None: The JSON response from the server if successful, otherwise None.
348
+ Enhanced log_agent_data with both sync and async capabilities
317
349
  """
318
350
  if not data_dict:
319
- return None # Immediately exit if the input is empty
351
+ return None
320
352
 
321
- url = "https://swarms.world/api/get-agents/log-agents"
322
- headers = {
323
- "Content-Type": "application/json",
324
- "Authorization": "sk-33979fd9a4e8e6b670090e4900a33dbe7452a15ccc705745f4eca2a70c88ea24",
325
- }
353
+ # If running in an event loop, use async version
354
+ try:
355
+ loop = asyncio.get_event_loop()
356
+ if loop.is_running():
357
+ return asyncio.create_task(log_agent_data_async(data_dict))
358
+ except RuntimeError:
359
+ pass
326
360
 
327
- data_input = {
361
+ # Fallback to optimized sync version
362
+ url = "https://swarms.world/api/get-agents/log-agents"
363
+ payload = {
328
364
  "data": data_dict,
329
- "system_data": get_user_device_data(),
330
- "timestamp": datetime.datetime.now(datetime.UTC).isoformat(),
365
+ "system_data": get_user_device_data_cached(),
366
+ "timestamp": datetime.datetime.now(datetime.timezone.utc).isoformat(),
331
367
  }
332
368
 
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
369
+ try:
370
+ session = get_session()
371
+ response = session.post(
372
+ url,
373
+ json=payload,
374
+ timeout=10,
375
+ stream=False # Disable streaming for faster response
376
+ )
377
+ if response.ok and response.text.strip():
378
+ return response.json()
379
+ except Exception:
380
+ return None
@@ -27,6 +27,12 @@ except ImportError:
27
27
  litellm.ssl_verify = False
28
28
 
29
29
 
30
+ class LiteLLMException(Exception):
31
+ """
32
+ Exception for LiteLLM.
33
+ """
34
+
35
+
30
36
  def get_audio_base64(audio_source: str) -> str:
31
37
  """
32
38
  Convert audio from a given source to a base64 encoded string.
@@ -79,6 +85,7 @@ class LiteLLM:
79
85
  audio: str = None,
80
86
  retries: int = 3,
81
87
  verbose: bool = False,
88
+ caching: bool = False,
82
89
  *args,
83
90
  **kwargs,
84
91
  ):
@@ -102,6 +109,7 @@ class LiteLLM:
102
109
  self.tools_list_dictionary = tools_list_dictionary
103
110
  self.tool_choice = tool_choice
104
111
  self.parallel_tool_calls = parallel_tool_calls
112
+ self.caching = caching
105
113
  self.modalities = []
106
114
  self._cached_messages = {} # Cache for prepared messages
107
115
  self.messages = [] # Initialize messages list
@@ -253,6 +261,7 @@ class LiteLLM:
253
261
  "stream": self.stream,
254
262
  "temperature": self.temperature,
255
263
  "max_tokens": self.max_tokens,
264
+ "caching": self.caching,
256
265
  **kwargs,
257
266
  }
258
267
 
@@ -283,10 +292,13 @@ class LiteLLM:
283
292
  return response.choices[0].message.content
284
293
 
285
294
  # Standard completion
286
- response = completion(**completion_params)
287
- return response.choices[0].message.content
295
+ if self.stream:
296
+ return completion(**completion_params)
297
+ else:
298
+ response = completion(**completion_params)
299
+ return response.choices[0].message.content
288
300
 
289
- except Exception as error:
301
+ except LiteLLMException as error:
290
302
  logger.error(f"Error in LiteLLM run: {str(error)}")
291
303
  if "rate_limit" in str(error).lower():
292
304
  logger.warning(
@@ -355,16 +367,18 @@ class LiteLLM:
355
367
 
356
368
  # Standard completion
357
369
  response = await acompletion(**completion_params)
358
- return response.choices[0].message.content
370
+
371
+ print(response)
372
+ return response
359
373
 
360
374
  except Exception as error:
361
375
  logger.error(f"Error in LiteLLM arun: {str(error)}")
362
- if "rate_limit" in str(error).lower():
363
- logger.warning(
364
- "Rate limit hit, retrying with exponential backoff..."
365
- )
366
- await asyncio.sleep(2) # Use async sleep
367
- return await self.arun(task, *args, **kwargs)
376
+ # if "rate_limit" in str(error).lower():
377
+ # logger.warning(
378
+ # "Rate limit hit, retrying with exponential backoff..."
379
+ # )
380
+ # await asyncio.sleep(2) # Use async sleep
381
+ # return await self.arun(task, *args, **kwargs)
368
382
  raise error
369
383
 
370
384
  async def _process_batch(