swarms 7.6.6__tar.gz → 7.6.9__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.6 → swarms-7.6.9}/PKG-INFO +1 -2
  2. {swarms-7.6.6 → swarms-7.6.9}/pyproject.toml +1 -2
  3. {swarms-7.6.6 → swarms-7.6.9}/swarms/__init__.py +1 -0
  4. {swarms-7.6.6 → swarms-7.6.9}/swarms/structs/__init__.py +0 -1
  5. {swarms-7.6.6 → swarms-7.6.9}/swarms/structs/agent.py +81 -79
  6. {swarms-7.6.6 → swarms-7.6.9}/swarms/structs/deep_research_swarm.py +4 -4
  7. {swarms-7.6.6 → swarms-7.6.9}/swarms/structs/swarm_builder.py +0 -5
  8. {swarms-7.6.6 → swarms-7.6.9}/swarms/telemetry/main.py +20 -57
  9. {swarms-7.6.6 → swarms-7.6.9}/swarms/utils/litellm_wrapper.py +24 -10
  10. swarms-7.6.6/swarms/structs/workspace_manager.py +0 -178
  11. swarms-7.6.6/swarms/utils/swarm_reliability_checks.py +0 -81
  12. {swarms-7.6.6 → swarms-7.6.9}/LICENSE +0 -0
  13. {swarms-7.6.6 → swarms-7.6.9}/README.md +0 -0
  14. {swarms-7.6.6 → swarms-7.6.9}/swarms/agents/__init__.py +0 -0
  15. {swarms-7.6.6 → swarms-7.6.9}/swarms/agents/agent_judge.py +0 -0
  16. {swarms-7.6.6 → swarms-7.6.9}/swarms/agents/agent_print.py +0 -0
  17. {swarms-7.6.6 → swarms-7.6.9}/swarms/agents/ape_agent.py +0 -0
  18. {swarms-7.6.6 → swarms-7.6.9}/swarms/agents/auto_generate_swarm_config.py +0 -0
  19. {swarms-7.6.6 → swarms-7.6.9}/swarms/agents/consistency_agent.py +0 -0
  20. {swarms-7.6.6 → swarms-7.6.9}/swarms/agents/create_agents_from_yaml.py +0 -0
  21. {swarms-7.6.6 → swarms-7.6.9}/swarms/agents/flexion_agent.py +0 -0
  22. {swarms-7.6.6 → swarms-7.6.9}/swarms/agents/gkp_agent.py +0 -0
  23. {swarms-7.6.6 → swarms-7.6.9}/swarms/agents/i_agent.py +0 -0
  24. {swarms-7.6.6 → swarms-7.6.9}/swarms/agents/openai_assistant.py +0 -0
  25. {swarms-7.6.6 → swarms-7.6.9}/swarms/agents/reasoning_agents.py +0 -0
  26. {swarms-7.6.6 → swarms-7.6.9}/swarms/agents/reasoning_duo.py +0 -0
  27. {swarms-7.6.6 → swarms-7.6.9}/swarms/agents/tool_agent.py +0 -0
  28. {swarms-7.6.6 → swarms-7.6.9}/swarms/artifacts/__init__.py +0 -0
  29. {swarms-7.6.6 → swarms-7.6.9}/swarms/artifacts/main_artifact.py +0 -0
  30. {swarms-7.6.6 → swarms-7.6.9}/swarms/cli/__init__.py +0 -0
  31. {swarms-7.6.6 → swarms-7.6.9}/swarms/cli/create_agent.py +0 -0
  32. {swarms-7.6.6 → swarms-7.6.9}/swarms/cli/main.py +0 -0
  33. {swarms-7.6.6 → swarms-7.6.9}/swarms/cli/onboarding_process.py +0 -0
  34. {swarms-7.6.6 → swarms-7.6.9}/swarms/client/__init__.py +0 -0
  35. {swarms-7.6.6 → swarms-7.6.9}/swarms/client/main.py +0 -0
  36. {swarms-7.6.6 → swarms-7.6.9}/swarms/prompts/__init__.py +0 -0
  37. {swarms-7.6.6 → swarms-7.6.9}/swarms/prompts/accountant_swarm_prompts.py +0 -0
  38. {swarms-7.6.6 → swarms-7.6.9}/swarms/prompts/ag_prompt.py +0 -0
  39. {swarms-7.6.6 → swarms-7.6.9}/swarms/prompts/aga.py +0 -0
  40. {swarms-7.6.6 → swarms-7.6.9}/swarms/prompts/agent_judge_prompt.py +0 -0
  41. {swarms-7.6.6 → swarms-7.6.9}/swarms/prompts/agent_prompt.py +0 -0
  42. {swarms-7.6.6 → swarms-7.6.9}/swarms/prompts/agent_prompts.py +0 -0
  43. {swarms-7.6.6 → swarms-7.6.9}/swarms/prompts/agent_system_prompts.py +0 -0
  44. {swarms-7.6.6 → swarms-7.6.9}/swarms/prompts/ai_research_team.py +0 -0
  45. {swarms-7.6.6 → swarms-7.6.9}/swarms/prompts/aot_prompt.py +0 -0
  46. {swarms-7.6.6 → swarms-7.6.9}/swarms/prompts/autobloggen.py +0 -0
  47. {swarms-7.6.6 → swarms-7.6.9}/swarms/prompts/autoswarm.py +0 -0
  48. {swarms-7.6.6 → swarms-7.6.9}/swarms/prompts/chat_prompt.py +0 -0
  49. {swarms-7.6.6 → swarms-7.6.9}/swarms/prompts/code_interpreter.py +0 -0
  50. {swarms-7.6.6 → swarms-7.6.9}/swarms/prompts/code_spawner.py +0 -0
  51. {swarms-7.6.6 → swarms-7.6.9}/swarms/prompts/debate.py +0 -0
  52. {swarms-7.6.6 → swarms-7.6.9}/swarms/prompts/documentation.py +0 -0
  53. {swarms-7.6.6 → swarms-7.6.9}/swarms/prompts/education.py +0 -0
  54. {swarms-7.6.6 → swarms-7.6.9}/swarms/prompts/finance_agent_prompt.py +0 -0
  55. {swarms-7.6.6 → swarms-7.6.9}/swarms/prompts/finance_agent_sys_prompt.py +0 -0
  56. {swarms-7.6.6 → swarms-7.6.9}/swarms/prompts/growth_agent_prompt.py +0 -0
  57. {swarms-7.6.6 → swarms-7.6.9}/swarms/prompts/idea2img.py +0 -0
  58. {swarms-7.6.6 → swarms-7.6.9}/swarms/prompts/legal_agent_prompt.py +0 -0
  59. {swarms-7.6.6 → swarms-7.6.9}/swarms/prompts/logistics.py +0 -0
  60. {swarms-7.6.6 → swarms-7.6.9}/swarms/prompts/meta_system_prompt.py +0 -0
  61. {swarms-7.6.6 → swarms-7.6.9}/swarms/prompts/multi_agent_collab_prompt.py +0 -0
  62. {swarms-7.6.6 → swarms-7.6.9}/swarms/prompts/multi_modal_autonomous_instruction_prompt.py +0 -0
  63. {swarms-7.6.6 → swarms-7.6.9}/swarms/prompts/multi_modal_prompts.py +0 -0
  64. {swarms-7.6.6 → swarms-7.6.9}/swarms/prompts/multi_modal_visual_prompts.py +0 -0
  65. {swarms-7.6.6 → swarms-7.6.9}/swarms/prompts/operations_agent_prompt.py +0 -0
  66. {swarms-7.6.6 → swarms-7.6.9}/swarms/prompts/personal_stylist.py +0 -0
  67. {swarms-7.6.6 → swarms-7.6.9}/swarms/prompts/product_agent_prompt.py +0 -0
  68. {swarms-7.6.6 → swarms-7.6.9}/swarms/prompts/programming.py +0 -0
  69. {swarms-7.6.6 → swarms-7.6.9}/swarms/prompts/project_manager.py +0 -0
  70. {swarms-7.6.6 → swarms-7.6.9}/swarms/prompts/prompt.py +0 -0
  71. {swarms-7.6.6 → swarms-7.6.9}/swarms/prompts/prompt_generator.py +0 -0
  72. {swarms-7.6.6 → swarms-7.6.9}/swarms/prompts/prompt_generator_optimizer.py +0 -0
  73. {swarms-7.6.6 → swarms-7.6.9}/swarms/prompts/python.py +0 -0
  74. {swarms-7.6.6 → swarms-7.6.9}/swarms/prompts/react.py +0 -0
  75. {swarms-7.6.6 → swarms-7.6.9}/swarms/prompts/reasoning_prompt.py +0 -0
  76. {swarms-7.6.6 → swarms-7.6.9}/swarms/prompts/refiner_agent_prompt.py +0 -0
  77. {swarms-7.6.6 → swarms-7.6.9}/swarms/prompts/sales.py +0 -0
  78. {swarms-7.6.6 → swarms-7.6.9}/swarms/prompts/sales_prompts.py +0 -0
  79. {swarms-7.6.6 → swarms-7.6.9}/swarms/prompts/security_team.py +0 -0
  80. {swarms-7.6.6 → swarms-7.6.9}/swarms/prompts/self_operating_prompt.py +0 -0
  81. {swarms-7.6.6 → swarms-7.6.9}/swarms/prompts/sop_generator_agent_prompt.py +0 -0
  82. {swarms-7.6.6 → swarms-7.6.9}/swarms/prompts/summaries_prompts.py +0 -0
  83. {swarms-7.6.6 → swarms-7.6.9}/swarms/prompts/support_agent_prompt.py +0 -0
  84. {swarms-7.6.6 → swarms-7.6.9}/swarms/prompts/swarm_manager_agent.py +0 -0
  85. {swarms-7.6.6 → swarms-7.6.9}/swarms/prompts/task_assignment_prompt.py +0 -0
  86. {swarms-7.6.6 → swarms-7.6.9}/swarms/prompts/tests.py +0 -0
  87. {swarms-7.6.6 → swarms-7.6.9}/swarms/prompts/tools.py +0 -0
  88. {swarms-7.6.6 → swarms-7.6.9}/swarms/prompts/urban_planning.py +0 -0
  89. {swarms-7.6.6 → swarms-7.6.9}/swarms/prompts/visual_cot.py +0 -0
  90. {swarms-7.6.6 → swarms-7.6.9}/swarms/prompts/worker_prompt.py +0 -0
  91. {swarms-7.6.6 → swarms-7.6.9}/swarms/prompts/xray_swarm_prompt.py +0 -0
  92. {swarms-7.6.6 → swarms-7.6.9}/swarms/schemas/__init__.py +0 -0
  93. {swarms-7.6.6 → swarms-7.6.9}/swarms/schemas/agent_input_schema.py +0 -0
  94. {swarms-7.6.6 → swarms-7.6.9}/swarms/schemas/agent_step_schemas.py +0 -0
  95. {swarms-7.6.6 → swarms-7.6.9}/swarms/schemas/base_schemas.py +0 -0
  96. {swarms-7.6.6 → swarms-7.6.9}/swarms/structs/agent_builder.py +0 -0
  97. {swarms-7.6.6 → swarms-7.6.9}/swarms/structs/agent_registry.py +0 -0
  98. {swarms-7.6.6 → swarms-7.6.9}/swarms/structs/agent_roles.py +0 -0
  99. {swarms-7.6.6 → swarms-7.6.9}/swarms/structs/agent_router.py +0 -0
  100. {swarms-7.6.6 → swarms-7.6.9}/swarms/structs/agents_available.py +0 -0
  101. {swarms-7.6.6 → swarms-7.6.9}/swarms/structs/async_workflow.py +0 -0
  102. {swarms-7.6.6 → swarms-7.6.9}/swarms/structs/auto_swarm_builder.py +0 -0
  103. {swarms-7.6.6 → swarms-7.6.9}/swarms/structs/base_structure.py +0 -0
  104. {swarms-7.6.6 → swarms-7.6.9}/swarms/structs/base_swarm.py +0 -0
  105. {swarms-7.6.6 → swarms-7.6.9}/swarms/structs/base_workflow.py +0 -0
  106. {swarms-7.6.6 → swarms-7.6.9}/swarms/structs/concat.py +0 -0
  107. {swarms-7.6.6 → swarms-7.6.9}/swarms/structs/concurrent_workflow.py +0 -0
  108. {swarms-7.6.6 → swarms-7.6.9}/swarms/structs/conversation.py +0 -0
  109. {swarms-7.6.6 → swarms-7.6.9}/swarms/structs/csv_to_agent.py +0 -0
  110. {swarms-7.6.6 → swarms-7.6.9}/swarms/structs/de_hallucination_swarm.py +0 -0
  111. {swarms-7.6.6 → swarms-7.6.9}/swarms/structs/dynamic_conversational_swarm.py +0 -0
  112. {swarms-7.6.6 → swarms-7.6.9}/swarms/structs/graph_swarm.py +0 -0
  113. {swarms-7.6.6 → swarms-7.6.9}/swarms/structs/graph_workflow.py +0 -0
  114. {swarms-7.6.6 → swarms-7.6.9}/swarms/structs/groupchat.py +0 -0
  115. {swarms-7.6.6 → swarms-7.6.9}/swarms/structs/hiearchical_swarm.py +0 -0
  116. {swarms-7.6.6 → swarms-7.6.9}/swarms/structs/hybrid_hiearchical_peer_swarm.py +0 -0
  117. {swarms-7.6.6 → swarms-7.6.9}/swarms/structs/majority_voting.py +0 -0
  118. {swarms-7.6.6 → swarms-7.6.9}/swarms/structs/malt.py +0 -0
  119. {swarms-7.6.6 → swarms-7.6.9}/swarms/structs/matrix_swarm.py +0 -0
  120. {swarms-7.6.6 → swarms-7.6.9}/swarms/structs/meme_agent_persona_generator.py +0 -0
  121. {swarms-7.6.6 → swarms-7.6.9}/swarms/structs/mixture_of_agents.py +0 -0
  122. {swarms-7.6.6 → swarms-7.6.9}/swarms/structs/model_router.py +0 -0
  123. {swarms-7.6.6 → swarms-7.6.9}/swarms/structs/multi_agent_collab.py +0 -0
  124. {swarms-7.6.6 → swarms-7.6.9}/swarms/structs/multi_agent_exec.py +0 -0
  125. {swarms-7.6.6 → swarms-7.6.9}/swarms/structs/multi_agent_orchestrator.py +0 -0
  126. {swarms-7.6.6 → swarms-7.6.9}/swarms/structs/octotools.py +0 -0
  127. {swarms-7.6.6 → swarms-7.6.9}/swarms/structs/omni_agent_types.py +0 -0
  128. {swarms-7.6.6 → swarms-7.6.9}/swarms/structs/output_types.py +0 -0
  129. {swarms-7.6.6 → swarms-7.6.9}/swarms/structs/pulsar_swarm.py +0 -0
  130. {swarms-7.6.6 → swarms-7.6.9}/swarms/structs/queue_swarm.py +0 -0
  131. {swarms-7.6.6 → swarms-7.6.9}/swarms/structs/rearrange.py +0 -0
  132. {swarms-7.6.6 → swarms-7.6.9}/swarms/structs/round_robin.py +0 -0
  133. {swarms-7.6.6 → swarms-7.6.9}/swarms/structs/safe_loading.py +0 -0
  134. {swarms-7.6.6 → swarms-7.6.9}/swarms/structs/sequential_workflow.py +0 -0
  135. {swarms-7.6.6 → swarms-7.6.9}/swarms/structs/spreadsheet_swarm.py +0 -0
  136. {swarms-7.6.6 → swarms-7.6.9}/swarms/structs/stopping_conditions.py +0 -0
  137. {swarms-7.6.6 → swarms-7.6.9}/swarms/structs/swarm_arange.py +0 -0
  138. {swarms-7.6.6 → swarms-7.6.9}/swarms/structs/swarm_eval.py +0 -0
  139. {swarms-7.6.6 → swarms-7.6.9}/swarms/structs/swarm_id_generator.py +0 -0
  140. {swarms-7.6.6 → swarms-7.6.9}/swarms/structs/swarm_load_balancer.py +0 -0
  141. {swarms-7.6.6 → swarms-7.6.9}/swarms/structs/swarm_matcher.py +0 -0
  142. {swarms-7.6.6 → swarms-7.6.9}/swarms/structs/swarm_output_type.py +0 -0
  143. {swarms-7.6.6 → swarms-7.6.9}/swarms/structs/swarm_registry.py +0 -0
  144. {swarms-7.6.6 → swarms-7.6.9}/swarms/structs/swarm_router.py +0 -0
  145. {swarms-7.6.6 → swarms-7.6.9}/swarms/structs/swarming_architectures.py +0 -0
  146. {swarms-7.6.6 → swarms-7.6.9}/swarms/structs/talk_hier.py +0 -0
  147. {swarms-7.6.6 → swarms-7.6.9}/swarms/structs/tree_swarm.py +0 -0
  148. {swarms-7.6.6 → swarms-7.6.9}/swarms/structs/utils.py +0 -0
  149. {swarms-7.6.6 → swarms-7.6.9}/swarms/structs/various_alt_swarms.py +0 -0
  150. {swarms-7.6.6 → swarms-7.6.9}/swarms/telemetry/__init__.py +0 -0
  151. {swarms-7.6.6 → swarms-7.6.9}/swarms/telemetry/bootup.py +0 -0
  152. {swarms-7.6.6 → swarms-7.6.9}/swarms/tools/__init__.py +0 -0
  153. {swarms-7.6.6 → swarms-7.6.9}/swarms/tools/base_tool.py +0 -0
  154. {swarms-7.6.6 → swarms-7.6.9}/swarms/tools/cohere_func_call_schema.py +0 -0
  155. {swarms-7.6.6 → swarms-7.6.9}/swarms/tools/func_calling_utils.py +0 -0
  156. {swarms-7.6.6 → swarms-7.6.9}/swarms/tools/func_to_str.py +0 -0
  157. {swarms-7.6.6 → swarms-7.6.9}/swarms/tools/function_util.py +0 -0
  158. {swarms-7.6.6 → swarms-7.6.9}/swarms/tools/json_former.py +0 -0
  159. {swarms-7.6.6 → swarms-7.6.9}/swarms/tools/json_utils.py +0 -0
  160. {swarms-7.6.6 → swarms-7.6.9}/swarms/tools/logits_processor.py +0 -0
  161. {swarms-7.6.6 → swarms-7.6.9}/swarms/tools/mcp_integration.py +0 -0
  162. {swarms-7.6.6 → swarms-7.6.9}/swarms/tools/openai_func_calling_schema_pydantic.py +0 -0
  163. {swarms-7.6.6 → swarms-7.6.9}/swarms/tools/openai_tool_creator_decorator.py +0 -0
  164. {swarms-7.6.6 → swarms-7.6.9}/swarms/tools/py_func_to_openai_func_str.py +0 -0
  165. {swarms-7.6.6 → swarms-7.6.9}/swarms/tools/pydantic_to_json.py +0 -0
  166. {swarms-7.6.6 → swarms-7.6.9}/swarms/tools/tool_parse_exec.py +0 -0
  167. {swarms-7.6.6 → swarms-7.6.9}/swarms/tools/tool_registry.py +0 -0
  168. {swarms-7.6.6 → swarms-7.6.9}/swarms/tools/tool_schema_base_model.py +0 -0
  169. {swarms-7.6.6 → swarms-7.6.9}/swarms/tools/tool_utils.py +0 -0
  170. {swarms-7.6.6 → swarms-7.6.9}/swarms/utils/__init__.py +0 -0
  171. {swarms-7.6.6 → swarms-7.6.9}/swarms/utils/any_to_str.py +0 -0
  172. {swarms-7.6.6 → swarms-7.6.9}/swarms/utils/auto_download_check_packages.py +0 -0
  173. {swarms-7.6.6 → swarms-7.6.9}/swarms/utils/calculate_func_metrics.py +0 -0
  174. {swarms-7.6.6 → swarms-7.6.9}/swarms/utils/data_to_text.py +0 -0
  175. {swarms-7.6.6 → swarms-7.6.9}/swarms/utils/disable_logging.py +0 -0
  176. {swarms-7.6.6 → swarms-7.6.9}/swarms/utils/file_processing.py +0 -0
  177. {swarms-7.6.6 → swarms-7.6.9}/swarms/utils/formatter.py +0 -0
  178. {swarms-7.6.6 → swarms-7.6.9}/swarms/utils/function_caller_model.py +0 -0
  179. {swarms-7.6.6 → swarms-7.6.9}/swarms/utils/history_output_formatter.py +0 -0
  180. {swarms-7.6.6 → swarms-7.6.9}/swarms/utils/litellm_tokenizer.py +0 -0
  181. {swarms-7.6.6 → swarms-7.6.9}/swarms/utils/loguru_logger.py +0 -0
  182. {swarms-7.6.6 → swarms-7.6.9}/swarms/utils/markdown_message.py +0 -0
  183. {swarms-7.6.6 → swarms-7.6.9}/swarms/utils/parse_code.py +0 -0
  184. {swarms-7.6.6 → swarms-7.6.9}/swarms/utils/pdf_to_text.py +0 -0
  185. {swarms-7.6.6 → swarms-7.6.9}/swarms/utils/str_to_dict.py +0 -0
  186. {swarms-7.6.6 → swarms-7.6.9}/swarms/utils/try_except_wrapper.py +0 -0
  187. {swarms-7.6.6 → swarms-7.6.9}/swarms/utils/visualizer.py +0 -0
  188. {swarms-7.6.6 → swarms-7.6.9}/swarms/utils/vllm_wrapper.py +0 -0
  189. {swarms-7.6.6 → swarms-7.6.9}/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.6
3
+ Version: 7.6.9
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.6"
8
+ version = "7.6.9"
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
@@ -2,7 +2,6 @@ from swarms.structs.agent import Agent
2
2
  from swarms.structs.agent_builder import AgentsBuilder
3
3
  from swarms.structs.agents_available import showcase_available_agents
4
4
  from swarms.structs.async_workflow import AsyncWorkflow
5
- from experimental.auto_swarm import AutoSwarm, AutoSwarmRouter
6
5
  from swarms.structs.base_structure import BaseStructure
7
6
  from swarms.structs.base_swarm import BaseSwarm
8
7
  from swarms.structs.base_workflow import BaseWorkflow
@@ -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={
@@ -3,12 +3,9 @@ import hashlib
3
3
  import platform
4
4
  import socket
5
5
  import subprocess
6
- import threading
7
6
  import uuid
8
7
  from typing import Dict
9
8
 
10
- import aiohttp
11
- import httpx
12
9
  import pkg_resources
13
10
  import psutil
14
11
  import requests
@@ -263,11 +260,11 @@ def capture_system_data() -> Dict[str, str]:
263
260
  except Exception as e:
264
261
  # logger.error("Failed to capture system data: {}", e)
265
262
  print(f"Failed to capture system data: {e}")
266
- return {}
267
263
 
268
264
 
269
- def _log_agent_data(data_dict: dict) -> dict | None:
265
+ def log_agent_data(data_dict: dict):
270
266
  """
267
+ Silently logs agent data to the Swarms database with retry logic.
271
268
 
272
269
  Args:
273
270
  data_dict (dict): The dictionary containing the agent data to be logged.
@@ -276,67 +273,33 @@ def _log_agent_data(data_dict: dict) -> dict | None:
276
273
  dict | None: The JSON response from the server if successful, otherwise None.
277
274
  """
278
275
  if not data_dict:
279
- return None
276
+ return None # Immediately exit if the input is empty
280
277
 
281
278
  url = "https://swarms.world/api/get-agents/log-agents"
282
279
  headers = {
283
280
  "Content-Type": "application/json",
284
- "Authorization": "sk-xxx", # replace with actual
281
+ "Authorization": "Bearer sk-33979fd9a4e8e6b670090e4900a33dbe7452a15ccc705745f4eca2a70c88ea24",
285
282
  }
286
283
 
284
+ system_data = get_user_device_data()
287
285
  payload = {
288
286
  "data": data_dict,
289
- "system_data": get_user_device_data(),
287
+ "system_data": system_data,
290
288
  "timestamp": datetime.datetime.now(datetime.UTC).isoformat(),
291
289
  }
292
290
 
293
291
  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:
310
- """
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.
317
- """
318
- if not data_dict:
319
- return None # Immediately exit if the input is empty
320
-
321
- url = "https://swarms.world/api/get-agents/log-agents"
322
- headers = {
323
- "Content-Type": "application/json",
324
- "Authorization": "sk-33979fd9a4e8e6b670090e4900a33dbe7452a15ccc705745f4eca2a70c88ea24",
325
- }
326
-
327
- data_input = {
328
- "data": data_dict,
329
- "system_data": get_user_device_data(),
330
- "timestamp": datetime.datetime.now(datetime.UTC).isoformat(),
331
- }
332
-
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
292
+ response = requests.post(
293
+ url, json=payload, headers=headers, timeout=10
294
+ )
295
+ if (
296
+ response.ok and response.text.strip()
297
+ ): # Check if response is valid and non-empty
298
+ return (
299
+ response.json()
300
+ ) # Parse and return the JSON response
301
+ except (
302
+ requests.exceptions.RequestException,
303
+ requests.exceptions.JSONDecodeError,
304
+ ):
305
+ return None # Return None if anything goes wrong
@@ -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(
@@ -1,178 +0,0 @@
1
- import os
2
- from pathlib import Path
3
- from typing import Optional
4
- from swarms.utils.loguru_logger import initialize_logger
5
-
6
-
7
- logger = initialize_logger("workspace-manager")
8
-
9
-
10
- class WorkspaceManager:
11
- """
12
- Manages the workspace directory and settings for the application.
13
- This class is responsible for setting up the workspace directory, logging configuration,
14
- and retrieving environment variables for telemetry and API key.
15
- """
16
-
17
- def __init__(
18
- self,
19
- workspace_dir: Optional[str] = "agent_workspace",
20
- use_telemetry: Optional[bool] = True,
21
- api_key: Optional[str] = None,
22
- ):
23
- """
24
- Initializes the WorkspaceManager with optional parameters for workspace directory,
25
- telemetry usage, and API key.
26
-
27
- Args:
28
- workspace_dir (Optional[str]): The path to the workspace directory.
29
- use_telemetry (Optional[bool]): A flag indicating whether to use telemetry.
30
- api_key (Optional[str]): The API key for the application.
31
- """
32
- self.workspace_dir = workspace_dir
33
- self.use_telemetry = use_telemetry
34
- self.api_key = api_key
35
-
36
- def _create_env_file(self, env_file_path: Path) -> None:
37
- """
38
- Create a new .env file with default WORKSPACE_DIR.
39
-
40
- Args:
41
- env_file_path (Path): The path to the .env file.
42
- """
43
- with env_file_path.open("w") as file:
44
- file.write(f"WORKSPACE_DIR={self.workspace_dir}\n")
45
- logger.info(
46
- "Created a new .env file with default WORKSPACE_DIR."
47
- )
48
-
49
- def _append_to_env_file(self, env_file_path: Path) -> None:
50
- """
51
- Append WORKSPACE_DIR to .env if it doesn't exist.
52
-
53
- Args:
54
- env_file_path (Path): The path to the .env file.
55
- """
56
- with env_file_path.open("r+") as file:
57
- content = file.read()
58
- if "WORKSPACE_DIR" not in content:
59
- file.seek(0, os.SEEK_END)
60
- file.write(f"WORKSPACE_DIR={self.workspace_dir}\n")
61
- logger.info("Appended WORKSPACE_DIR to .env file.")
62
-
63
- def _get_workspace_dir(
64
- self, workspace_dir: Optional[str] = None
65
- ) -> str:
66
- """
67
- Get the workspace directory from environment variable or default.
68
-
69
- Args:
70
- workspace_dir (Optional[str]): The path to the workspace directory.
71
-
72
- Returns:
73
- str: The path to the workspace directory.
74
- """
75
- return workspace_dir or os.getenv(
76
- "WORKSPACE_DIR", "agent_workspace"
77
- )
78
-
79
- def _get_telemetry_status(
80
- self, use_telemetry: Optional[bool] = None
81
- ) -> bool:
82
- """
83
- Get telemetry status from environment variable or default.
84
-
85
- Args:
86
- use_telemetry (Optional[bool]): A flag indicating whether to use telemetry.
87
-
88
- Returns:
89
- bool: The status of telemetry usage.
90
- """
91
- return (
92
- use_telemetry
93
- if use_telemetry is not None
94
- else os.getenv("USE_TELEMETRY", "true").lower() == "true"
95
- )
96
-
97
- def _get_api_key(
98
- self, api_key: Optional[str] = None
99
- ) -> Optional[str]:
100
- """
101
- Get API key from environment variable or default.
102
-
103
- Args:
104
- api_key (Optional[str]): The API key for the application.
105
-
106
- Returns:
107
- Optional[str]: The API key or None if not set.
108
- """
109
- return api_key or os.getenv("SWARMS_API_KEY")
110
-
111
- def _init_workspace(self) -> None:
112
- """
113
- Initialize the workspace directory if it doesn't exist.
114
- """
115
- if not self.workspace_path.exists():
116
- self.workspace_path.mkdir(parents=True, exist_ok=True)
117
- logger.info("Workspace directory initialized.")
118
-
119
- @property
120
- def get_workspace_path(self) -> Path:
121
- """
122
- Get the workspace path.
123
-
124
- Returns:
125
- Path: The path to the workspace directory.
126
- """
127
- return self.workspace_path
128
-
129
- @property
130
- def get_telemetry_status(self) -> bool:
131
- """
132
- Get telemetry status.
133
-
134
- Returns:
135
- bool: The status of telemetry usage.
136
- """
137
- return self.use_telemetry
138
-
139
- @property
140
- def get_api_key(self) -> Optional[str]:
141
- """
142
- Get API key.
143
-
144
- Returns:
145
- Optional[str]: The API key or None if not set.
146
- """
147
- return self.api_key
148
-
149
- def run(self) -> None:
150
- try:
151
- # Check if .env file exists and create it if it doesn't
152
- env_file_path = Path(".env")
153
-
154
- # If the .env file doesn't exist, create it
155
- if not env_file_path.exists():
156
- self._create_env_file(env_file_path)
157
- else:
158
- # Append WORKSPACE_DIR to .env if it doesn't exist
159
- self._append_to_env_file(env_file_path)
160
-
161
- # Set workspace directory
162
- self.workspace_dir = self._get_workspace_dir(
163
- self.workspace_dir
164
- )
165
- self.workspace_path = Path(self.workspace_dir)
166
-
167
- # Set telemetry preference
168
- self.use_telemetry = self._get_telemetry_status(
169
- self.use_telemetry
170
- )
171
-
172
- # Set API key
173
- self.api_key = self._get_api_key(self.api_key)
174
-
175
- # Initialize workspace
176
- self._init_workspace()
177
- except Exception as e:
178
- logger.error(f"Error initializing WorkspaceManager: {e}")