swarms 7.9.8__tar.gz → 8.0.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 (223) hide show
  1. {swarms-7.9.8 → swarms-8.0.0}/PKG-INFO +20 -16
  2. {swarms-7.9.8 → swarms-8.0.0}/README.md +21 -17
  3. {swarms-7.9.8 → swarms-8.0.0}/pyproject.toml +2 -2
  4. swarms-8.0.0/swarms/agents/agent_judge.py +408 -0
  5. {swarms-7.9.8 → swarms-8.0.0}/swarms/agents/reasoning_agents.py +62 -72
  6. {swarms-7.9.8 → swarms-8.0.0}/swarms/agents/reasoning_duo.py +77 -24
  7. {swarms-7.9.8 → swarms-8.0.0}/swarms/structs/__init__.py +2 -0
  8. {swarms-7.9.8 → swarms-8.0.0}/swarms/structs/agent.py +21 -15
  9. swarms-8.0.0/swarms/structs/election_swarm.py +270 -0
  10. swarms-8.0.0/swarms/structs/heavy_swarm.py +1701 -0
  11. swarms-8.0.0/swarms/structs/qa_swarm.py +253 -0
  12. {swarms-7.9.8 → swarms-8.0.0}/swarms/structs/swarm_router.py +61 -21
  13. swarms-8.0.0/swarms/telemetry/log_executions.py +292 -0
  14. swarms-8.0.0/swarms/utils/agent_cache.py +675 -0
  15. swarms-8.0.0/swarms/utils/concurrent_wrapper.py +520 -0
  16. swarms-7.9.8/swarms/agents/agent_judge.py +0 -119
  17. swarms-7.9.8/swarms/telemetry/log_executions.py +0 -43
  18. {swarms-7.9.8 → swarms-8.0.0}/LICENSE +0 -0
  19. {swarms-7.9.8 → swarms-8.0.0}/swarms/__init__.py +0 -0
  20. {swarms-7.9.8 → swarms-8.0.0}/swarms/agents/__init__.py +0 -0
  21. {swarms-7.9.8 → swarms-8.0.0}/swarms/agents/agent_print.py +0 -0
  22. {swarms-7.9.8 → swarms-8.0.0}/swarms/agents/ape_agent.py +0 -0
  23. {swarms-7.9.8 → swarms-8.0.0}/swarms/agents/auto_generate_swarm_config.py +0 -0
  24. {swarms-7.9.8 → swarms-8.0.0}/swarms/agents/consistency_agent.py +0 -0
  25. {swarms-7.9.8 → swarms-8.0.0}/swarms/agents/cort_agent.py +0 -0
  26. {swarms-7.9.8 → swarms-8.0.0}/swarms/agents/create_agents_from_yaml.py +0 -0
  27. {swarms-7.9.8 → swarms-8.0.0}/swarms/agents/flexion_agent.py +0 -0
  28. {swarms-7.9.8 → swarms-8.0.0}/swarms/agents/gkp_agent.py +0 -0
  29. {swarms-7.9.8 → swarms-8.0.0}/swarms/agents/i_agent.py +0 -0
  30. {swarms-7.9.8 → swarms-8.0.0}/swarms/agents/openai_assistant.py +0 -0
  31. {swarms-7.9.8 → swarms-8.0.0}/swarms/agents/react_agent.py +0 -0
  32. {swarms-7.9.8 → swarms-8.0.0}/swarms/agents/self_agent_builder.py +0 -0
  33. {swarms-7.9.8 → swarms-8.0.0}/swarms/agents/tool_agent.py +0 -0
  34. {swarms-7.9.8 → swarms-8.0.0}/swarms/artifacts/__init__.py +0 -0
  35. {swarms-7.9.8 → swarms-8.0.0}/swarms/artifacts/main_artifact.py +0 -0
  36. {swarms-7.9.8 → swarms-8.0.0}/swarms/cli/__init__.py +0 -0
  37. {swarms-7.9.8 → swarms-8.0.0}/swarms/cli/create_agent.py +0 -0
  38. {swarms-7.9.8 → swarms-8.0.0}/swarms/cli/main.py +0 -0
  39. {swarms-7.9.8 → swarms-8.0.0}/swarms/cli/onboarding_process.py +0 -0
  40. {swarms-7.9.8 → swarms-8.0.0}/swarms/communication/__init__.py +0 -0
  41. {swarms-7.9.8 → swarms-8.0.0}/swarms/communication/base_communication.py +0 -0
  42. {swarms-7.9.8 → swarms-8.0.0}/swarms/communication/duckdb_wrap.py +0 -0
  43. {swarms-7.9.8 → swarms-8.0.0}/swarms/communication/pulsar_struct.py +0 -0
  44. {swarms-7.9.8 → swarms-8.0.0}/swarms/communication/redis_wrap.py +0 -0
  45. {swarms-7.9.8 → swarms-8.0.0}/swarms/communication/sqlite_wrap.py +0 -0
  46. {swarms-7.9.8 → swarms-8.0.0}/swarms/communication/supabase_wrap.py +0 -0
  47. {swarms-7.9.8 → swarms-8.0.0}/swarms/prompts/__init__.py +0 -0
  48. {swarms-7.9.8 → swarms-8.0.0}/swarms/prompts/accountant_swarm_prompts.py +0 -0
  49. {swarms-7.9.8 → swarms-8.0.0}/swarms/prompts/ag_prompt.py +0 -0
  50. {swarms-7.9.8 → swarms-8.0.0}/swarms/prompts/aga.py +0 -0
  51. {swarms-7.9.8 → swarms-8.0.0}/swarms/prompts/agent_conversation_aggregator.py +0 -0
  52. {swarms-7.9.8 → swarms-8.0.0}/swarms/prompts/agent_judge_prompt.py +0 -0
  53. {swarms-7.9.8 → swarms-8.0.0}/swarms/prompts/agent_prompt.py +0 -0
  54. {swarms-7.9.8 → swarms-8.0.0}/swarms/prompts/agent_prompts.py +0 -0
  55. {swarms-7.9.8 → swarms-8.0.0}/swarms/prompts/agent_self_builder_prompt.py +0 -0
  56. {swarms-7.9.8 → swarms-8.0.0}/swarms/prompts/agent_system_prompts.py +0 -0
  57. {swarms-7.9.8 → swarms-8.0.0}/swarms/prompts/ai_research_team.py +0 -0
  58. {swarms-7.9.8 → swarms-8.0.0}/swarms/prompts/aot_prompt.py +0 -0
  59. {swarms-7.9.8 → swarms-8.0.0}/swarms/prompts/autobloggen.py +0 -0
  60. {swarms-7.9.8 → swarms-8.0.0}/swarms/prompts/autoswarm.py +0 -0
  61. {swarms-7.9.8 → swarms-8.0.0}/swarms/prompts/chat_prompt.py +0 -0
  62. {swarms-7.9.8 → swarms-8.0.0}/swarms/prompts/code_interpreter.py +0 -0
  63. {swarms-7.9.8 → swarms-8.0.0}/swarms/prompts/code_spawner.py +0 -0
  64. {swarms-7.9.8 → swarms-8.0.0}/swarms/prompts/collaborative_prompts.py +0 -0
  65. {swarms-7.9.8 → swarms-8.0.0}/swarms/prompts/debate.py +0 -0
  66. {swarms-7.9.8 → swarms-8.0.0}/swarms/prompts/documentation.py +0 -0
  67. {swarms-7.9.8 → swarms-8.0.0}/swarms/prompts/education.py +0 -0
  68. {swarms-7.9.8 → swarms-8.0.0}/swarms/prompts/finance_agent_prompt.py +0 -0
  69. {swarms-7.9.8 → swarms-8.0.0}/swarms/prompts/finance_agent_sys_prompt.py +0 -0
  70. {swarms-7.9.8 → swarms-8.0.0}/swarms/prompts/growth_agent_prompt.py +0 -0
  71. {swarms-7.9.8 → swarms-8.0.0}/swarms/prompts/hiearchical_system_prompt.py +0 -0
  72. {swarms-7.9.8 → swarms-8.0.0}/swarms/prompts/idea2img.py +0 -0
  73. {swarms-7.9.8 → swarms-8.0.0}/swarms/prompts/legal_agent_prompt.py +0 -0
  74. {swarms-7.9.8 → swarms-8.0.0}/swarms/prompts/logistics.py +0 -0
  75. {swarms-7.9.8 → swarms-8.0.0}/swarms/prompts/max_loop_prompt.py +0 -0
  76. {swarms-7.9.8 → swarms-8.0.0}/swarms/prompts/meta_system_prompt.py +0 -0
  77. {swarms-7.9.8 → swarms-8.0.0}/swarms/prompts/multi_agent_collab_prompt.py +0 -0
  78. {swarms-7.9.8 → swarms-8.0.0}/swarms/prompts/multi_modal_autonomous_instruction_prompt.py +0 -0
  79. {swarms-7.9.8 → swarms-8.0.0}/swarms/prompts/multi_modal_prompts.py +0 -0
  80. {swarms-7.9.8 → swarms-8.0.0}/swarms/prompts/multi_modal_visual_prompts.py +0 -0
  81. {swarms-7.9.8 → swarms-8.0.0}/swarms/prompts/operations_agent_prompt.py +0 -0
  82. {swarms-7.9.8 → swarms-8.0.0}/swarms/prompts/paper_idea_agent.py +0 -0
  83. {swarms-7.9.8 → swarms-8.0.0}/swarms/prompts/personal_stylist.py +0 -0
  84. {swarms-7.9.8 → swarms-8.0.0}/swarms/prompts/product_agent_prompt.py +0 -0
  85. {swarms-7.9.8 → swarms-8.0.0}/swarms/prompts/programming.py +0 -0
  86. {swarms-7.9.8 → swarms-8.0.0}/swarms/prompts/project_manager.py +0 -0
  87. {swarms-7.9.8 → swarms-8.0.0}/swarms/prompts/prompt.py +0 -0
  88. {swarms-7.9.8 → swarms-8.0.0}/swarms/prompts/prompt_generator.py +0 -0
  89. {swarms-7.9.8 → swarms-8.0.0}/swarms/prompts/prompt_generator_optimizer.py +0 -0
  90. {swarms-7.9.8 → swarms-8.0.0}/swarms/prompts/python.py +0 -0
  91. {swarms-7.9.8 → swarms-8.0.0}/swarms/prompts/react.py +0 -0
  92. {swarms-7.9.8 → swarms-8.0.0}/swarms/prompts/react_base_prompt.py +0 -0
  93. {swarms-7.9.8 → swarms-8.0.0}/swarms/prompts/reasoning_prompt.py +0 -0
  94. {swarms-7.9.8 → swarms-8.0.0}/swarms/prompts/refiner_agent_prompt.py +0 -0
  95. {swarms-7.9.8 → swarms-8.0.0}/swarms/prompts/safety_prompt.py +0 -0
  96. {swarms-7.9.8 → swarms-8.0.0}/swarms/prompts/sales.py +0 -0
  97. {swarms-7.9.8 → swarms-8.0.0}/swarms/prompts/sales_prompts.py +0 -0
  98. {swarms-7.9.8 → swarms-8.0.0}/swarms/prompts/security_team.py +0 -0
  99. {swarms-7.9.8 → swarms-8.0.0}/swarms/prompts/self_operating_prompt.py +0 -0
  100. {swarms-7.9.8 → swarms-8.0.0}/swarms/prompts/sop_generator_agent_prompt.py +0 -0
  101. {swarms-7.9.8 → swarms-8.0.0}/swarms/prompts/summaries_prompts.py +0 -0
  102. {swarms-7.9.8 → swarms-8.0.0}/swarms/prompts/support_agent_prompt.py +0 -0
  103. {swarms-7.9.8 → swarms-8.0.0}/swarms/prompts/swarm_manager_agent.py +0 -0
  104. {swarms-7.9.8 → swarms-8.0.0}/swarms/prompts/task_assignment_prompt.py +0 -0
  105. {swarms-7.9.8 → swarms-8.0.0}/swarms/prompts/tests.py +0 -0
  106. {swarms-7.9.8 → swarms-8.0.0}/swarms/prompts/tools.py +0 -0
  107. {swarms-7.9.8 → swarms-8.0.0}/swarms/prompts/urban_planning.py +0 -0
  108. {swarms-7.9.8 → swarms-8.0.0}/swarms/prompts/visual_cot.py +0 -0
  109. {swarms-7.9.8 → swarms-8.0.0}/swarms/prompts/worker_prompt.py +0 -0
  110. {swarms-7.9.8 → swarms-8.0.0}/swarms/prompts/xray_swarm_prompt.py +0 -0
  111. {swarms-7.9.8 → swarms-8.0.0}/swarms/schemas/__init__.py +0 -0
  112. {swarms-7.9.8 → swarms-8.0.0}/swarms/schemas/agent_class_schema.py +0 -0
  113. {swarms-7.9.8 → swarms-8.0.0}/swarms/schemas/agent_completion_response.py +0 -0
  114. {swarms-7.9.8 → swarms-8.0.0}/swarms/schemas/agent_mcp_errors.py +0 -0
  115. {swarms-7.9.8 → swarms-8.0.0}/swarms/schemas/agent_rag_schema.py +0 -0
  116. {swarms-7.9.8 → swarms-8.0.0}/swarms/schemas/agent_step_schemas.py +0 -0
  117. {swarms-7.9.8 → swarms-8.0.0}/swarms/schemas/agent_tool_schema.py +0 -0
  118. {swarms-7.9.8 → swarms-8.0.0}/swarms/schemas/base_schemas.py +0 -0
  119. {swarms-7.9.8 → swarms-8.0.0}/swarms/schemas/conversation_schema.py +0 -0
  120. {swarms-7.9.8 → swarms-8.0.0}/swarms/schemas/llm_agent_schema.py +0 -0
  121. {swarms-7.9.8 → swarms-8.0.0}/swarms/schemas/mcp_schemas.py +0 -0
  122. {swarms-7.9.8 → swarms-8.0.0}/swarms/schemas/swarms_api_schemas.py +0 -0
  123. {swarms-7.9.8 → swarms-8.0.0}/swarms/schemas/tool_schema_base_model.py +0 -0
  124. {swarms-7.9.8 → swarms-8.0.0}/swarms/structs/agent_builder.py +0 -0
  125. {swarms-7.9.8 → swarms-8.0.0}/swarms/structs/agent_rag_handler.py +0 -0
  126. {swarms-7.9.8 → swarms-8.0.0}/swarms/structs/agent_registry.py +0 -0
  127. {swarms-7.9.8 → swarms-8.0.0}/swarms/structs/agent_roles.py +0 -0
  128. {swarms-7.9.8 → swarms-8.0.0}/swarms/structs/agent_router.py +0 -0
  129. {swarms-7.9.8 → swarms-8.0.0}/swarms/structs/aop.py +0 -0
  130. {swarms-7.9.8 → swarms-8.0.0}/swarms/structs/auto_swarm_builder.py +0 -0
  131. {swarms-7.9.8 → swarms-8.0.0}/swarms/structs/base_structure.py +0 -0
  132. {swarms-7.9.8 → swarms-8.0.0}/swarms/structs/base_swarm.py +0 -0
  133. {swarms-7.9.8 → swarms-8.0.0}/swarms/structs/base_workflow.py +0 -0
  134. {swarms-7.9.8 → swarms-8.0.0}/swarms/structs/batch_agent_execution.py +0 -0
  135. {swarms-7.9.8 → swarms-8.0.0}/swarms/structs/concat.py +0 -0
  136. {swarms-7.9.8 → swarms-8.0.0}/swarms/structs/concurrent_workflow.py +0 -0
  137. {swarms-7.9.8 → swarms-8.0.0}/swarms/structs/conversation.py +0 -0
  138. {swarms-7.9.8 → swarms-8.0.0}/swarms/structs/council_judge.py +0 -0
  139. {swarms-7.9.8 → swarms-8.0.0}/swarms/structs/csv_to_agent.py +0 -0
  140. {swarms-7.9.8 → swarms-8.0.0}/swarms/structs/de_hallucination_swarm.py +0 -0
  141. {swarms-7.9.8 → swarms-8.0.0}/swarms/structs/deep_research_swarm.py +0 -0
  142. {swarms-7.9.8 → swarms-8.0.0}/swarms/structs/dynamic_conversational_swarm.py +0 -0
  143. {swarms-7.9.8 → swarms-8.0.0}/swarms/structs/graph_workflow.py +0 -0
  144. {swarms-7.9.8 → swarms-8.0.0}/swarms/structs/groupchat.py +0 -0
  145. {swarms-7.9.8 → swarms-8.0.0}/swarms/structs/hiearchical_swarm.py +0 -0
  146. {swarms-7.9.8 → swarms-8.0.0}/swarms/structs/hybrid_hiearchical_peer_swarm.py +0 -0
  147. {swarms-7.9.8 → swarms-8.0.0}/swarms/structs/image_batch_processor.py +0 -0
  148. {swarms-7.9.8 → swarms-8.0.0}/swarms/structs/interactive_groupchat.py +0 -0
  149. {swarms-7.9.8 → swarms-8.0.0}/swarms/structs/long_agent.py +0 -0
  150. {swarms-7.9.8 → swarms-8.0.0}/swarms/structs/ma_blocks.py +0 -0
  151. {swarms-7.9.8 → swarms-8.0.0}/swarms/structs/ma_utils.py +0 -0
  152. {swarms-7.9.8 → swarms-8.0.0}/swarms/structs/majority_voting.py +0 -0
  153. {swarms-7.9.8 → swarms-8.0.0}/swarms/structs/malt.py +0 -0
  154. {swarms-7.9.8 → swarms-8.0.0}/swarms/structs/matrix_swarm.py +0 -0
  155. {swarms-7.9.8 → swarms-8.0.0}/swarms/structs/meme_agent_persona_generator.py +0 -0
  156. {swarms-7.9.8 → swarms-8.0.0}/swarms/structs/mixture_of_agents.py +0 -0
  157. {swarms-7.9.8 → swarms-8.0.0}/swarms/structs/model_router.py +0 -0
  158. {swarms-7.9.8 → swarms-8.0.0}/swarms/structs/multi_agent_exec.py +0 -0
  159. {swarms-7.9.8 → swarms-8.0.0}/swarms/structs/multi_agent_router.py +0 -0
  160. {swarms-7.9.8 → swarms-8.0.0}/swarms/structs/multi_model_gpu_manager.py +0 -0
  161. {swarms-7.9.8 → swarms-8.0.0}/swarms/structs/omni_agent_types.py +0 -0
  162. {swarms-7.9.8 → swarms-8.0.0}/swarms/structs/rearrange.py +0 -0
  163. {swarms-7.9.8 → swarms-8.0.0}/swarms/structs/round_robin.py +0 -0
  164. {swarms-7.9.8 → swarms-8.0.0}/swarms/structs/safe_loading.py +0 -0
  165. {swarms-7.9.8 → swarms-8.0.0}/swarms/structs/sequential_workflow.py +0 -0
  166. {swarms-7.9.8 → swarms-8.0.0}/swarms/structs/spreadsheet_swarm.py +0 -0
  167. {swarms-7.9.8 → swarms-8.0.0}/swarms/structs/stopping_conditions.py +0 -0
  168. {swarms-7.9.8 → swarms-8.0.0}/swarms/structs/swarm_arange.py +0 -0
  169. {swarms-7.9.8 → swarms-8.0.0}/swarms/structs/swarm_eval.py +0 -0
  170. {swarms-7.9.8 → swarms-8.0.0}/swarms/structs/swarm_id_generator.py +0 -0
  171. {swarms-7.9.8 → swarms-8.0.0}/swarms/structs/swarm_matcher.py +0 -0
  172. {swarms-7.9.8 → swarms-8.0.0}/swarms/structs/swarm_registry.py +0 -0
  173. {swarms-7.9.8 → swarms-8.0.0}/swarms/structs/swarming_architectures.py +0 -0
  174. {swarms-7.9.8 → swarms-8.0.0}/swarms/structs/tree_swarm.py +0 -0
  175. {swarms-7.9.8 → swarms-8.0.0}/swarms/structs/utils.py +0 -0
  176. {swarms-7.9.8 → swarms-8.0.0}/swarms/structs/various_alt_swarms.py +0 -0
  177. {swarms-7.9.8 → swarms-8.0.0}/swarms/telemetry/__init__.py +0 -0
  178. {swarms-7.9.8 → swarms-8.0.0}/swarms/telemetry/bootup.py +0 -0
  179. {swarms-7.9.8 → swarms-8.0.0}/swarms/telemetry/main.py +0 -0
  180. {swarms-7.9.8 → swarms-8.0.0}/swarms/tools/__init__.py +0 -0
  181. {swarms-7.9.8 → swarms-8.0.0}/swarms/tools/base_tool.py +0 -0
  182. {swarms-7.9.8 → swarms-8.0.0}/swarms/tools/cohere_func_call_schema.py +0 -0
  183. {swarms-7.9.8 → swarms-8.0.0}/swarms/tools/create_agent_tool.py +0 -0
  184. {swarms-7.9.8 → swarms-8.0.0}/swarms/tools/func_calling_utils.py +0 -0
  185. {swarms-7.9.8 → swarms-8.0.0}/swarms/tools/func_to_str.py +0 -0
  186. {swarms-7.9.8 → swarms-8.0.0}/swarms/tools/function_util.py +0 -0
  187. {swarms-7.9.8 → swarms-8.0.0}/swarms/tools/json_former.py +0 -0
  188. {swarms-7.9.8 → swarms-8.0.0}/swarms/tools/json_utils.py +0 -0
  189. {swarms-7.9.8 → swarms-8.0.0}/swarms/tools/logits_processor.py +0 -0
  190. {swarms-7.9.8 → swarms-8.0.0}/swarms/tools/mcp_client_call.py +0 -0
  191. {swarms-7.9.8 → swarms-8.0.0}/swarms/tools/openai_func_calling_schema_pydantic.py +0 -0
  192. {swarms-7.9.8 → swarms-8.0.0}/swarms/tools/openai_tool_creator_decorator.py +0 -0
  193. {swarms-7.9.8 → swarms-8.0.0}/swarms/tools/py_func_to_openai_func_str.py +0 -0
  194. {swarms-7.9.8 → swarms-8.0.0}/swarms/tools/pydantic_to_json.py +0 -0
  195. {swarms-7.9.8 → swarms-8.0.0}/swarms/tools/tool_parse_exec.py +0 -0
  196. {swarms-7.9.8 → swarms-8.0.0}/swarms/tools/tool_registry.py +0 -0
  197. {swarms-7.9.8 → swarms-8.0.0}/swarms/tools/tool_utils.py +0 -0
  198. {swarms-7.9.8 → swarms-8.0.0}/swarms/utils/__init__.py +0 -0
  199. {swarms-7.9.8 → swarms-8.0.0}/swarms/utils/any_to_str.py +0 -0
  200. {swarms-7.9.8 → swarms-8.0.0}/swarms/utils/audio_processing.py +0 -0
  201. {swarms-7.9.8 → swarms-8.0.0}/swarms/utils/auto_download_check_packages.py +0 -0
  202. {swarms-7.9.8 → swarms-8.0.0}/swarms/utils/calculate_func_metrics.py +0 -0
  203. {swarms-7.9.8 → swarms-8.0.0}/swarms/utils/check_all_model_max_tokens.py +0 -0
  204. {swarms-7.9.8 → swarms-8.0.0}/swarms/utils/data_to_text.py +0 -0
  205. {swarms-7.9.8 → swarms-8.0.0}/swarms/utils/disable_logging.py +0 -0
  206. {swarms-7.9.8 → swarms-8.0.0}/swarms/utils/file_processing.py +0 -0
  207. {swarms-7.9.8 → swarms-8.0.0}/swarms/utils/formatter.py +0 -0
  208. {swarms-7.9.8 → swarms-8.0.0}/swarms/utils/function_caller_model.py +0 -0
  209. {swarms-7.9.8 → swarms-8.0.0}/swarms/utils/generate_keys.py +0 -0
  210. {swarms-7.9.8 → swarms-8.0.0}/swarms/utils/history_output_formatter.py +0 -0
  211. {swarms-7.9.8 → swarms-8.0.0}/swarms/utils/index.py +0 -0
  212. {swarms-7.9.8 → swarms-8.0.0}/swarms/utils/lite_utils.py +0 -0
  213. {swarms-7.9.8 → swarms-8.0.0}/swarms/utils/litellm_tokenizer.py +0 -0
  214. {swarms-7.9.8 → swarms-8.0.0}/swarms/utils/litellm_wrapper.py +0 -0
  215. {swarms-7.9.8 → swarms-8.0.0}/swarms/utils/loguru_logger.py +0 -0
  216. {swarms-7.9.8 → swarms-8.0.0}/swarms/utils/output_types.py +0 -0
  217. {swarms-7.9.8 → swarms-8.0.0}/swarms/utils/parse_code.py +0 -0
  218. {swarms-7.9.8 → swarms-8.0.0}/swarms/utils/pdf_to_text.py +0 -0
  219. {swarms-7.9.8 → swarms-8.0.0}/swarms/utils/retry_func.py +0 -0
  220. {swarms-7.9.8 → swarms-8.0.0}/swarms/utils/str_to_dict.py +0 -0
  221. {swarms-7.9.8 → swarms-8.0.0}/swarms/utils/try_except_wrapper.py +0 -0
  222. {swarms-7.9.8 → swarms-8.0.0}/swarms/utils/vllm_wrapper.py +0 -0
  223. {swarms-7.9.8 → swarms-8.0.0}/swarms/utils/xml_utils.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: swarms
3
- Version: 7.9.8
3
+ Version: 8.0.0
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
@@ -280,20 +280,26 @@ A `SequentialWorkflow` executes tasks in a strict order, forming a pipeline wher
280
280
  ```python
281
281
  from swarms import Agent, SequentialWorkflow
282
282
 
283
- # Initialize agents for a 3-step process
284
- # 1. Generate an idea
285
- idea_generator = Agent(agent_name="IdeaGenerator", system_prompt="Generate a unique startup idea.", model_name="gpt-4o-mini")
286
- # 2. Validate the idea
287
- validator = Agent(agent_name="Validator", system_prompt="Take this startup idea and analyze its market viability.", model_name="gpt-4o-mini")
288
- # 3. Create a pitch
289
- pitch_creator = Agent(agent_name="PitchCreator", system_prompt="Write a 3-sentence elevator pitch for this validated startup idea.", model_name="gpt-4o-mini")
283
+ # Agent 1: The Researcher
284
+ researcher = Agent(
285
+ agent_name="Researcher",
286
+ system_prompt="Your job is to research the provided topic and provide a detailed summary.",
287
+ model_name="gpt-4o-mini",
288
+ )
290
289
 
291
- # Create the sequential workflow
292
- workflow = SequentialWorkflow(agents=[idea_generator, validator, pitch_creator])
290
+ # Agent 2: The Writer
291
+ writer = Agent(
292
+ agent_name="Writer",
293
+ system_prompt="Your job is to take the research summary and write a beautiful, engaging blog post about it.",
294
+ model_name="gpt-4o-mini",
295
+ )
296
+
297
+ # Create a sequential workflow where the researcher's output feeds into the writer's input
298
+ workflow = SequentialWorkflow(agents=[researcher, writer])
293
299
 
294
- # Run the workflow
295
- elevator_pitch = workflow.run()
296
- print(elevator_pitch)
300
+ # Run the workflow on a task
301
+ final_post = workflow.run("The history and future of artificial intelligence")
302
+ print(final_post)
297
303
  ```
298
304
 
299
305
  -----
@@ -356,9 +362,7 @@ rearrange_system = AgentRearrange(
356
362
  flow=flow,
357
363
  )
358
364
 
359
- # Run the system
360
- # The researcher will generate content, and then both the writer and editor
361
- # will process that content in parallel.
365
+ # Run the swarm
362
366
  outputs = rearrange_system.run("Analyze the impact of AI on modern cinema.")
363
367
  print(outputs)
364
368
  ```
@@ -237,20 +237,26 @@ A `SequentialWorkflow` executes tasks in a strict order, forming a pipeline wher
237
237
  ```python
238
238
  from swarms import Agent, SequentialWorkflow
239
239
 
240
- # Initialize agents for a 3-step process
241
- # 1. Generate an idea
242
- idea_generator = Agent(agent_name="IdeaGenerator", system_prompt="Generate a unique startup idea.", model_name="gpt-4o-mini")
243
- # 2. Validate the idea
244
- validator = Agent(agent_name="Validator", system_prompt="Take this startup idea and analyze its market viability.", model_name="gpt-4o-mini")
245
- # 3. Create a pitch
246
- pitch_creator = Agent(agent_name="PitchCreator", system_prompt="Write a 3-sentence elevator pitch for this validated startup idea.", model_name="gpt-4o-mini")
247
-
248
- # Create the sequential workflow
249
- workflow = SequentialWorkflow(agents=[idea_generator, validator, pitch_creator])
250
-
251
- # Run the workflow
252
- elevator_pitch = workflow.run()
253
- print(elevator_pitch)
240
+ # Agent 1: The Researcher
241
+ researcher = Agent(
242
+ agent_name="Researcher",
243
+ system_prompt="Your job is to research the provided topic and provide a detailed summary.",
244
+ model_name="gpt-4o-mini",
245
+ )
246
+
247
+ # Agent 2: The Writer
248
+ writer = Agent(
249
+ agent_name="Writer",
250
+ system_prompt="Your job is to take the research summary and write a beautiful, engaging blog post about it.",
251
+ model_name="gpt-4o-mini",
252
+ )
253
+
254
+ # Create a sequential workflow where the researcher's output feeds into the writer's input
255
+ workflow = SequentialWorkflow(agents=[researcher, writer])
256
+
257
+ # Run the workflow on a task
258
+ final_post = workflow.run("The history and future of artificial intelligence")
259
+ print(final_post)
254
260
  ```
255
261
 
256
262
  -----
@@ -313,9 +319,7 @@ rearrange_system = AgentRearrange(
313
319
  flow=flow,
314
320
  )
315
321
 
316
- # Run the system
317
- # The researcher will generate content, and then both the writer and editor
318
- # will process that content in parallel.
322
+ # Run the swarm
319
323
  outputs = rearrange_system.run("Analyze the impact of AI on modern cinema.")
320
324
  print(outputs)
321
325
  ```
@@ -5,7 +5,7 @@ build-backend = "poetry.core.masonry.api"
5
5
 
6
6
  [tool.poetry]
7
7
  name = "swarms"
8
- version = "7.9.8"
8
+ version = "8.0.0"
9
9
  description = "Swarms - TGSC"
10
10
  license = "MIT"
11
11
  authors = ["Kye Gomez <kye@apac.ai>"]
@@ -86,7 +86,7 @@ swarms = "swarms.cli.main:main"
86
86
 
87
87
  [tool.poetry.group.lint.dependencies]
88
88
  black = ">=23.1,<26.0"
89
- ruff = ">=0.5.1,<0.12.3"
89
+ ruff = ">=0.5.1,<0.12.4"
90
90
  types-toml = "^0.10.8.1"
91
91
  types-pytz = ">=2023.3,<2026.0"
92
92
  types-chardet = "^5.0.4.6"
@@ -0,0 +1,408 @@
1
+ import traceback
2
+ from typing import List, Optional, Union
3
+ import uuid
4
+
5
+ from swarms.prompts.agent_judge_prompt import AGENT_JUDGE_PROMPT
6
+ from swarms.structs.agent import Agent
7
+ from swarms.structs.conversation import Conversation
8
+ from swarms.utils.any_to_str import any_to_str
9
+
10
+
11
+ class AgentJudgeInitializationError(Exception):
12
+ """
13
+ Exception raised when there is an error initializing the AgentJudge.
14
+ """
15
+
16
+ pass
17
+
18
+
19
+ class AgentJudgeExecutionError(Exception):
20
+ """
21
+ Exception raised when there is an error executing the AgentJudge.
22
+ """
23
+
24
+ pass
25
+
26
+
27
+ class AgentJudgeFeedbackCycleError(Exception):
28
+ """
29
+ Exception raised when there is an error in the feedback cycle.
30
+ """
31
+
32
+ pass
33
+
34
+
35
+ class AgentJudge:
36
+ """
37
+ A specialized agent designed to evaluate and judge outputs from other agents or systems.
38
+
39
+ The AgentJudge acts as a quality control mechanism, providing objective assessments
40
+ and feedback on various types of content, decisions, or outputs. It's based on research
41
+ in LLM-based evaluation systems and can maintain context across multiple evaluations.
42
+
43
+ This implementation supports both single task evaluation and batch processing with
44
+ iterative refinement capabilities.
45
+
46
+ Attributes:
47
+ id (str): Unique identifier for the judge agent instance.
48
+ agent_name (str): The name of the agent judge.
49
+ system_prompt (str): The system prompt for the agent containing evaluation instructions.
50
+ model_name (str): The model name used for generating evaluations (e.g., "openai/o1", "gpt-4").
51
+ conversation (Conversation): An instance of the Conversation class to manage conversation history.
52
+ max_loops (int): The maximum number of evaluation iterations to run.
53
+ verbose (bool): Whether to enable verbose logging.
54
+ agent (Agent): An instance of the Agent class that performs the evaluation execution.
55
+
56
+ Example:
57
+ Basic usage for evaluating agent outputs:
58
+
59
+ ```python
60
+ from swarms import AgentJudge
61
+
62
+ # Initialize the judge
63
+ judge = AgentJudge(
64
+ agent_name="quality-judge",
65
+ model_name="gpt-4",
66
+ max_loops=1
67
+ )
68
+
69
+ # Evaluate a single output
70
+ output = "The capital of France is Paris."
71
+ evaluation = judge.step(task=output)
72
+ print(evaluation)
73
+
74
+ # Evaluate multiple outputs with context building
75
+ outputs = [
76
+ "Agent response 1: The calculation is 2+2=4",
77
+ "Agent response 2: The weather is sunny today"
78
+ ]
79
+ evaluations = judge.run(tasks=outputs)
80
+ ```
81
+
82
+ Methods:
83
+ step(task: str = None, tasks: List[str] = None, img: str = None) -> str:
84
+ Processes a single task or list of tasks and returns the agent's evaluation.
85
+
86
+ run(task: str = None, tasks: List[str] = None, img: str = None) -> List[str]:
87
+ Executes evaluation in a loop with context building, collecting responses.
88
+
89
+ run_batched(tasks: List[str] = None, imgs: List[str] = None) -> List[str]:
90
+ Executes batch evaluation of tasks with corresponding images.
91
+ """
92
+
93
+ def __init__(
94
+ self,
95
+ id: str = str(uuid.uuid4()),
96
+ agent_name: str = "Agent Judge",
97
+ description: str = "You're an expert AI agent judge. Carefully review the following output(s) generated by another agent. Your job is to provide a detailed, constructive, and actionable critique that will help the agent improve its future performance.",
98
+ system_prompt: str = AGENT_JUDGE_PROMPT,
99
+ model_name: str = "openai/o1",
100
+ max_loops: int = 1,
101
+ verbose: bool = False,
102
+ *args,
103
+ **kwargs,
104
+ ):
105
+ self.id = id
106
+ self.agent_name = agent_name
107
+ self.system_prompt = system_prompt
108
+ self.model_name = model_name
109
+ self.conversation = Conversation(time_enabled=False)
110
+ self.max_loops = max_loops
111
+ self.verbose = verbose
112
+
113
+ self.agent = Agent(
114
+ agent_name=agent_name,
115
+ agent_description=description,
116
+ system_prompt=AGENT_JUDGE_PROMPT,
117
+ model_name=model_name,
118
+ max_loops=1,
119
+ *args,
120
+ **kwargs,
121
+ )
122
+
123
+ def feedback_cycle_step(
124
+ self,
125
+ agent: Union[Agent, callable],
126
+ task: str,
127
+ img: Optional[str] = None,
128
+ ):
129
+ try:
130
+ # First run the main agent
131
+ agent_output = agent.run(task=task, img=img)
132
+
133
+ # Then run the judge agent
134
+ judge_output = self.run(task=agent_output, img=img)
135
+
136
+ # Run the main agent again with the judge's feedback, using a much improved prompt
137
+ improved_prompt = (
138
+ f"You have received the following detailed feedback from the expert agent judge ({self.agent_name}):\n\n"
139
+ f"--- FEEDBACK START ---\n{judge_output}\n--- FEEDBACK END ---\n\n"
140
+ f"Your task is to thoughtfully revise and enhance your previous output based on this critique. "
141
+ f"Carefully address all identified weaknesses, incorporate the suggestions, and strive to maximize the strengths noted. "
142
+ f"Be specific, accurate, and actionable in your improvements. "
143
+ f"Here is the original task for reference:\n\n"
144
+ f"--- TASK ---\n{task}\n--- END TASK ---\n\n"
145
+ f"Please provide your improved and fully revised output below."
146
+ )
147
+ return agent.run(task=improved_prompt, img=img)
148
+ except Exception as e:
149
+ raise AgentJudgeFeedbackCycleError(
150
+ f"Error In Agent Judge Feedback Cycle: {e} Traceback: {traceback.format_exc()}"
151
+ )
152
+
153
+ def feedback_cycle(
154
+ self,
155
+ agent: Union[Agent, callable],
156
+ task: str,
157
+ img: Optional[str] = None,
158
+ loops: int = 1,
159
+ ):
160
+ loop = 0
161
+ original_task = task # Preserve the original task
162
+ current_output = None # Track the current output
163
+ all_outputs = [] # Collect all outputs from each iteration
164
+
165
+ while loop < loops:
166
+ # First iteration: run the standard feedback cycle step
167
+ current_output = self.feedback_cycle_step(
168
+ agent, original_task, img
169
+ )
170
+
171
+ # Add the current output to our collection
172
+ all_outputs.append(current_output)
173
+ loop += 1
174
+
175
+ return all_outputs
176
+
177
+ def step(
178
+ self,
179
+ task: str = None,
180
+ tasks: Optional[List[str]] = None,
181
+ img: Optional[str] = None,
182
+ ) -> str:
183
+ """
184
+ Processes a single task or list of tasks and returns the agent's evaluation.
185
+
186
+ This method performs a one-shot evaluation of the provided content. It takes
187
+ either a single task string or a list of tasks and generates a comprehensive
188
+ evaluation with strengths, weaknesses, and improvement suggestions.
189
+
190
+ Args:
191
+ task (str, optional): A single task/output to be evaluated.
192
+ tasks (List[str], optional): A list of tasks/outputs to be evaluated.
193
+ img (str, optional): Path to an image file for multimodal evaluation.
194
+
195
+ Returns:
196
+ str: A detailed evaluation response from the agent including:
197
+ - Strengths: What the agent/output did well
198
+ - Weaknesses: Areas that need improvement
199
+ - Suggestions: Specific recommendations for improvement
200
+ - Factual accuracy assessment
201
+
202
+ Raises:
203
+ ValueError: If neither task nor tasks are provided.
204
+
205
+ Example:
206
+ ```python
207
+ # Single task evaluation
208
+ evaluation = judge.step(task="The answer is 42.")
209
+
210
+ # Multiple tasks evaluation
211
+ evaluation = judge.step(tasks=[
212
+ "Response 1: Paris is the capital of France",
213
+ "Response 2: 2 + 2 = 5" # Incorrect
214
+ ])
215
+
216
+ # Multimodal evaluation
217
+ evaluation = judge.step(
218
+ task="Describe this image",
219
+ img="path/to/image.jpg"
220
+ )
221
+ ```
222
+ """
223
+ try:
224
+ prompt = ""
225
+ if tasks:
226
+ prompt = any_to_str(tasks)
227
+ elif task:
228
+ prompt = task
229
+ else:
230
+ raise ValueError("No tasks or task provided")
231
+
232
+ response = self.agent.run(
233
+ task=(
234
+ "You are an expert AI agent judge. Carefully review the following output(s) generated by another agent. "
235
+ "Your job is to provide a detailed, constructive, and actionable critique that will help the agent improve its future performance. "
236
+ "Your feedback should address the following points:\n"
237
+ "1. Strengths: What did the agent do well? Highlight any correct reasoning, clarity, or effective problem-solving.\n"
238
+ "2. Weaknesses: Identify any errors, omissions, unclear reasoning, or areas where the output could be improved.\n"
239
+ "3. Suggestions: Offer specific, practical recommendations for how the agent can improve its next attempt. "
240
+ "This may include advice on reasoning, structure, completeness, or style.\n"
241
+ "4. If relevant, point out any factual inaccuracies or logical inconsistencies.\n"
242
+ "Be thorough, objective, and professional. Your goal is to help the agent learn and produce better results in the future.\n\n"
243
+ f"Output(s) to evaluate:\n{prompt}\n"
244
+ ),
245
+ img=img,
246
+ )
247
+
248
+ return response
249
+ except Exception as e:
250
+ error_message = (
251
+ f"AgentJudge encountered an error: {e}\n"
252
+ f"Traceback:\n{traceback.format_exc()}\n\n"
253
+ "If this issue persists, please:\n"
254
+ "- Open a GitHub issue: https://github.com/swarms-ai/swarms/issues\n"
255
+ "- Join our Discord for real-time support: swarms.ai\n"
256
+ "- Or book a call: https://cal.com/swarms\n"
257
+ )
258
+ raise AgentJudgeExecutionError(error_message)
259
+
260
+ def run(
261
+ self,
262
+ task: str = None,
263
+ tasks: Optional[List[str]] = None,
264
+ img: Optional[str] = None,
265
+ ):
266
+ """
267
+ Executes evaluation in multiple iterations with context building and refinement.
268
+
269
+ This method runs the evaluation process for the specified number of max_loops,
270
+ where each iteration builds upon the previous context. This allows for iterative
271
+ refinement of evaluations and deeper analysis over multiple passes.
272
+
273
+ Args:
274
+ task (str, optional): A single task/output to be evaluated.
275
+ tasks (List[str], optional): A list of tasks/outputs to be evaluated.
276
+ img (str, optional): Path to an image file for multimodal evaluation.
277
+
278
+ Returns:
279
+ List[str]: A list of evaluation responses, one for each iteration.
280
+ Each subsequent evaluation includes context from previous iterations.
281
+
282
+ Example:
283
+ ```python
284
+ # Single task with iterative refinement
285
+ judge = AgentJudge(max_loops=3)
286
+ evaluations = judge.run(task="Agent output to evaluate")
287
+ # Returns 3 evaluations, each building on the previous
288
+
289
+ # Multiple tasks with context building
290
+ evaluations = judge.run(tasks=[
291
+ "First agent response",
292
+ "Second agent response"
293
+ ])
294
+
295
+ # With image analysis
296
+ evaluations = judge.run(
297
+ task="Analyze this chart",
298
+ img="chart.png"
299
+ )
300
+ ```
301
+
302
+ Note:
303
+ - The first iteration evaluates the original task(s)
304
+ - Subsequent iterations include context from previous evaluations
305
+ - This enables deeper analysis and refinement of judgments
306
+ - Useful for complex evaluations requiring multiple perspectives
307
+ """
308
+ try:
309
+ responses = []
310
+ context = ""
311
+
312
+ # Convert single task to list for consistent processing
313
+ if task and not tasks:
314
+ tasks = [task]
315
+ task = None # Clear to avoid confusion in step method
316
+
317
+ for _ in range(self.max_loops):
318
+ # Add context to the tasks if available
319
+ if context and tasks:
320
+ contextualized_tasks = [
321
+ f"Previous context: {context}\nTask: {t}"
322
+ for t in tasks
323
+ ]
324
+ else:
325
+ contextualized_tasks = tasks
326
+
327
+ # Get response for current iteration
328
+ current_response = self.step(
329
+ task=task,
330
+ tasks=contextualized_tasks,
331
+ img=img,
332
+ )
333
+ responses.append(current_response)
334
+
335
+ # Update context for next iteration
336
+ context = current_response
337
+
338
+ return responses
339
+ except Exception as e:
340
+ error_message = (
341
+ f"AgentJudge encountered an error: {e}\n"
342
+ f"Traceback:\n{traceback.format_exc()}\n\n"
343
+ "If this issue persists, please:\n"
344
+ "- Open a GitHub issue: https://github.com/swarms-ai/swarms/issues\n"
345
+ "- Join our Discord for real-time support: swarms.ai\n"
346
+ "- Or book a call: https://cal.com/swarms\n"
347
+ )
348
+ raise AgentJudgeExecutionError(error_message)
349
+
350
+ def run_batched(
351
+ self,
352
+ tasks: Optional[List[str]] = None,
353
+ imgs: Optional[List[str]] = None,
354
+ ):
355
+ """
356
+ Executes batch evaluation of multiple tasks with corresponding images.
357
+
358
+ This method processes multiple task-image pairs independently, where each
359
+ task can be evaluated with its corresponding image. Unlike the run() method,
360
+ this doesn't build context between different tasks - each is evaluated
361
+ independently.
362
+
363
+ Args:
364
+ tasks (List[str], optional): A list of tasks/outputs to be evaluated.
365
+ imgs (List[str], optional): A list of image paths corresponding to each task.
366
+ Must be the same length as tasks if provided.
367
+
368
+ Returns:
369
+ List[List[str]]: A list of evaluation responses for each task. Each inner
370
+ list contains the responses from all iterations (max_loops)
371
+ for that particular task.
372
+
373
+ Example:
374
+ ```python
375
+ # Batch evaluation with images
376
+ tasks = [
377
+ "Describe what you see in this image",
378
+ "What's wrong with this chart?",
379
+ "Analyze the trends shown"
380
+ ]
381
+ images = [
382
+ "photo1.jpg",
383
+ "chart1.png",
384
+ "graph1.png"
385
+ ]
386
+
387
+ evaluations = judge.run_batched(tasks=tasks, imgs=images)
388
+ # Returns evaluations for each task-image pair
389
+
390
+ # Batch evaluation without images
391
+ evaluations = judge.run_batched(tasks=[
392
+ "Agent response 1",
393
+ "Agent response 2",
394
+ "Agent response 3"
395
+ ])
396
+ ```
397
+
398
+ Note:
399
+ - Each task is processed independently
400
+ - If imgs is provided, it must have the same length as tasks
401
+ - Each task goes through max_loops iterations independently
402
+ - No context is shared between different tasks in the batch
403
+ """
404
+ responses = []
405
+ for task, img in zip(tasks, imgs):
406
+ response = self.run(task=task, img=img)
407
+ responses.append(response)
408
+ return responses