swarms 7.8.4__py3-none-any.whl → 7.8.7__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (58) hide show
  1. swarms/agents/ape_agent.py +5 -22
  2. swarms/agents/consistency_agent.py +1 -1
  3. swarms/agents/i_agent.py +1 -1
  4. swarms/agents/reasoning_agents.py +99 -3
  5. swarms/agents/reasoning_duo.py +1 -1
  6. swarms/cli/main.py +1 -1
  7. swarms/communication/__init__.py +1 -0
  8. swarms/communication/duckdb_wrap.py +32 -2
  9. swarms/communication/pulsar_struct.py +45 -19
  10. swarms/communication/redis_wrap.py +56 -11
  11. swarms/communication/supabase_wrap.py +1659 -0
  12. swarms/prompts/prompt.py +0 -3
  13. swarms/schemas/agent_completion_response.py +71 -0
  14. swarms/schemas/agent_rag_schema.py +7 -0
  15. swarms/schemas/conversation_schema.py +9 -0
  16. swarms/schemas/llm_agent_schema.py +99 -81
  17. swarms/schemas/swarms_api_schemas.py +164 -0
  18. swarms/structs/__init__.py +14 -11
  19. swarms/structs/agent.py +219 -199
  20. swarms/structs/agent_rag_handler.py +685 -0
  21. swarms/structs/base_swarm.py +2 -1
  22. swarms/structs/conversation.py +608 -87
  23. swarms/structs/csv_to_agent.py +153 -100
  24. swarms/structs/deep_research_swarm.py +197 -193
  25. swarms/structs/dynamic_conversational_swarm.py +18 -7
  26. swarms/structs/hiearchical_swarm.py +1 -1
  27. swarms/structs/hybrid_hiearchical_peer_swarm.py +2 -18
  28. swarms/structs/image_batch_processor.py +261 -0
  29. swarms/structs/interactive_groupchat.py +356 -0
  30. swarms/structs/ma_blocks.py +75 -0
  31. swarms/structs/majority_voting.py +1 -1
  32. swarms/structs/mixture_of_agents.py +1 -1
  33. swarms/structs/multi_agent_router.py +3 -2
  34. swarms/structs/rearrange.py +3 -3
  35. swarms/structs/sequential_workflow.py +3 -3
  36. swarms/structs/swarm_matcher.py +500 -411
  37. swarms/structs/swarm_router.py +15 -97
  38. swarms/structs/swarming_architectures.py +1 -1
  39. swarms/tools/mcp_client_call.py +3 -0
  40. swarms/utils/__init__.py +10 -2
  41. swarms/utils/check_all_model_max_tokens.py +43 -0
  42. swarms/utils/generate_keys.py +0 -27
  43. swarms/utils/history_output_formatter.py +5 -20
  44. swarms/utils/litellm_wrapper.py +208 -60
  45. swarms/utils/output_types.py +24 -0
  46. swarms/utils/vllm_wrapper.py +5 -6
  47. swarms/utils/xml_utils.py +37 -2
  48. {swarms-7.8.4.dist-info → swarms-7.8.7.dist-info}/METADATA +31 -55
  49. {swarms-7.8.4.dist-info → swarms-7.8.7.dist-info}/RECORD +53 -48
  50. swarms/structs/multi_agent_collab.py +0 -242
  51. swarms/structs/output_types.py +0 -6
  52. swarms/utils/markdown_message.py +0 -21
  53. swarms/utils/visualizer.py +0 -510
  54. swarms/utils/wrapper_clusterop.py +0 -127
  55. /swarms/{tools → schemas}/tool_schema_base_model.py +0 -0
  56. {swarms-7.8.4.dist-info → swarms-7.8.7.dist-info}/LICENSE +0 -0
  57. {swarms-7.8.4.dist-info → swarms-7.8.7.dist-info}/WHEEL +0 -0
  58. {swarms-7.8.4.dist-info → swarms-7.8.7.dist-info}/entry_points.txt +0 -0
@@ -2,32 +2,33 @@ swarms/__init__.py,sha256=0tc5msh0Sfk6V_KIwen_4p2kwkHBLjLxZVoAsFE-b80,513
2
2
  swarms/agents/__init__.py,sha256=hEp16SuPhlcLX84HAlaK_9RNf6JB0JQ27YTrTnvak04,1171
3
3
  swarms/agents/agent_judge.py,sha256=xT242CX5mV64cq2B-3RGkuEHiV5aD04P_Zq8_s64iMQ,3967
4
4
  swarms/agents/agent_print.py,sha256=SXqWA2ZzXwRFdv8hkuYwOPMTasvaGTG6U29413qRCAA,918
5
- swarms/agents/ape_agent.py,sha256=1kz_65LJgjLlY1yv2WLBeVMs7sP9BgEVWk0w1f67YLc,1563
5
+ swarms/agents/ape_agent.py,sha256=Ws7PmfCL5ctxIdLjQ-lkTWoYMGMjnqqDuo4chPpsF0w,1046
6
6
  swarms/agents/auto_generate_swarm_config.py,sha256=7eJ873xS7PJmyreMaa5Uub8qFu-qIinuyMuogB2Ehjc,8474
7
- swarms/agents/consistency_agent.py,sha256=41h0yvnjzmKsE8-q4UsN0ckHP7WWmB5E_z64ec9QaJM,7414
7
+ swarms/agents/consistency_agent.py,sha256=kN7FEaf_HvQP99gJNGWRobFuuF56oArGjWkmxhpRNew,7412
8
8
  swarms/agents/cort_agent.py,sha256=cTorrAcdI46Zvf4RfTouVl4J2vdPSur5CHDWTTMgujU,8002
9
9
  swarms/agents/create_agents_from_yaml.py,sha256=PgFIpuYZehxEl79BAK6TolSZwydDQzvGMAKhLsHuBbc,13008
10
10
  swarms/agents/flexion_agent.py,sha256=Agjq1rvTzboE8lT26-mcjp0tKQEjlUj_eVYsFjLIvN0,21468
11
11
  swarms/agents/gkp_agent.py,sha256=5Jms3zHQ2qwJ6-PHDh9X-cFtAlH4dSUoDgRqN-xZzog,21067
12
- swarms/agents/i_agent.py,sha256=_eKUcgPfiVqQpF5Q-Sv1tT-JZxIeNl9Fp7OrnjVUtz8,12276
12
+ swarms/agents/i_agent.py,sha256=_kqGt3a4SGB21_GP-KcV8A5p_9wneShs6eJUJYFdluw,12274
13
13
  swarms/agents/openai_assistant.py,sha256=mTSEtj26J0mc5pCeWrmMY0EXzTRYQfyfw_BtOqtcCHc,11044
14
14
  swarms/agents/react_agent.py,sha256=yM8lQoRsqJZicqtmgBrC7RHv0aKEb5oZHh4q5aAA_xs,5804
15
- swarms/agents/reasoning_agents.py,sha256=tF7K710lj-VZQVc2VjqxMWGLNGMsEWRarXcJnXz1wkc,5741
16
- swarms/agents/reasoning_duo.py,sha256=s9SnXoproQaBrShLtiruGJituy8sJlZJATc5Vy_FdwI,3875
15
+ swarms/agents/reasoning_agents.py,sha256=Z_YETF-hzG7qL-h6WB1qNR6QU4g784M9NzO5C0_kWtA,9639
16
+ swarms/agents/reasoning_duo.py,sha256=4qw9RtwmWkWnDWjEtJqYFVLh--EV9YQd24-fQa0lMfM,3873
17
17
  swarms/agents/self_agent_builder.py,sha256=bX7xSwak6HiyK901VdeE8OlT4yqE0n7jyHcWJrkMeew,1104
18
18
  swarms/agents/tool_agent.py,sha256=G7rhBACsHsGUMT4H9eF5aY7e3Gx-5jOmJkhCF1jm9mU,5087
19
19
  swarms/artifacts/__init__.py,sha256=M111xTw7IVVt8gLDwW7Kau5n1YdwkL3vbCJPVeEWktI,83
20
20
  swarms/artifacts/main_artifact.py,sha256=bu2TcsTR81ttJEjVJ3NzT7D4x7uuM57okC92QuigV9I,11139
21
21
  swarms/cli/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
22
22
  swarms/cli/create_agent.py,sha256=o2V6EDQN477MxUOm0wShlr4uNyPpPzqpJhGM5tiuWUU,1128
23
- swarms/cli/main.py,sha256=T9YsCrNIzvbQA8h5qlke-TbRP498Wu6R_KkAxRiabvs,15319
23
+ swarms/cli/main.py,sha256=gyq8rnYn94kD302lAkFnWTI-_ZSp_1pMJfhdjQHJ2K8,15309
24
24
  swarms/cli/onboarding_process.py,sha256=3-2LKoLhjnaPbX9iiasqXPZZpqmwm-ZrXawH88M4BIU,6940
25
- swarms/communication/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
25
+ swarms/communication/__init__.py,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
26
26
  swarms/communication/base_communication.py,sha256=0aQavvEQv24MHvulZ2mGVmQ9hkqROSIW608wfo8-P9s,8559
27
- swarms/communication/duckdb_wrap.py,sha256=cdVG6-V5R4xV_503yFO--QtIfkx35hkzppK8MTJEeNY,44549
28
- swarms/communication/pulsar_struct.py,sha256=hsP-CA88KB578_3Gc4kOF3z5DILckZxjlcz7xSzjxXY,23758
29
- swarms/communication/redis_wrap.py,sha256=f-NvlnJQ1PhUpZLDamNrvQ4rl0ykof8Di5H8ZQ_IFbA,47331
27
+ swarms/communication/duckdb_wrap.py,sha256=1_uC1DFsy0rHqgCCT5ZdzGM9hf9iko3BruA3vwajXlw,45563
28
+ swarms/communication/pulsar_struct.py,sha256=jOSNdWSDO-eqtXL9x77TG3AU2eR7lxlT2xkcTKExx3Q,24684
29
+ swarms/communication/redis_wrap.py,sha256=qMiqVmTk0Zs-8zqe6p8EPSKbjyAsBws0apbALvB8wHs,48631
30
30
  swarms/communication/sqlite_wrap.py,sha256=PD7p5bdTjK6a7yqdlAJtgduO9WdAb_wJpQlCSH6gbG0,43604
31
+ swarms/communication/supabase_wrap.py,sha256=NRdaZ-TIU95sCuGYBGn0zwNsGealepKyZAYqc62nBs4,63917
31
32
  swarms/prompts/__init__.py,sha256=ZFcghAs4b0Rsjcc_DIFssiztZub5tJ66rxmJD2_tXpQ,747
32
33
  swarms/prompts/accountant_swarm_prompts.py,sha256=swceN1B0fZCOedd3-y3gjNOHDmR-3H5YK17ytp7tTDM,11320
33
34
  swarms/prompts/ag_prompt.py,sha256=mMeqC84SMNrCjQcBeejroSXLuF_wWrVRebHU1MrEQko,4577
@@ -66,7 +67,7 @@ swarms/prompts/personal_stylist.py,sha256=_14TSdWdHs6WCnBSK5--1QXcHv5qK466O6A781
66
67
  swarms/prompts/product_agent_prompt.py,sha256=RN24ZeXA-QEVYWFoobJRtpXzQJ0shPhcUpCbNLkArTc,8333
67
68
  swarms/prompts/programming.py,sha256=Bg_PV5CexJFLqadJjjliU6t89q8IeQTEp2ZyEF9kO0g,10144
68
69
  swarms/prompts/project_manager.py,sha256=EfJGlH4YNX8kbFz-vAJXEEhBOD5QKvl7TPjU7aoapec,2128
69
- swarms/prompts/prompt.py,sha256=Q-psHFcBTNUTiS6yTsV4CKxKKnu27Zbzzpcqh38B0-k,9506
70
+ swarms/prompts/prompt.py,sha256=ktlZkk5wMLqE9YMtb2Y3Gdg2ahPaIetoyEfgbge4-yg,9414
70
71
  swarms/prompts/prompt_generator.py,sha256=56xRcy9J86c-Z18HGKExsArVff2AdmmSDs7C8nPkA_w,4412
71
72
  swarms/prompts/prompt_generator_optimizer.py,sha256=ODhXgN4cIHbuuSOPrt1iTzntKeQm71hNUiZsqf-gj1M,3823
72
73
  swarms/prompts/python.py,sha256=JgykzeNYLHHVvjoTR5FhZEVWJFc3SWCMgf-mRN3yMEo,13215
@@ -92,64 +93,70 @@ swarms/prompts/worker_prompt.py,sha256=f6qPN24vEciGRTHyYjNDguhzCFPZqa2u05rEHIPcJ
92
93
  swarms/prompts/xray_swarm_prompt.py,sha256=AfV_y8GVuEodznOGQ9Q8QlInoLE5Px3Nl9GS_EpsDxg,2349
93
94
  swarms/schemas/__init__.py,sha256=G2PKMJONzT3x6_edNqNjTgCgpTyul4UKhpC5cSe8Zjw,247
94
95
  swarms/schemas/agent_class_schema.py,sha256=SG04rPZEHE4XWwC402qvfRMRJpyhQ0AvsHF-_B-e2Cg,4581
96
+ swarms/schemas/agent_completion_response.py,sha256=-CcDrSj9DtyTWpX8LbCAgazVLoXRX3Drzpb9lshKRl8,2232
95
97
  swarms/schemas/agent_mcp_errors.py,sha256=2BDsZAt9Pgmfh_D5DKY5vc9psw4Wl0FevL60yfiQvKk,266
98
+ swarms/schemas/agent_rag_schema.py,sha256=8KZYDJkecg24rqOaeKAlDKLoYlw31m_S0k-ra_ilz_w,124
96
99
  swarms/schemas/agent_step_schemas.py,sha256=a14gb58vR0xOwB_fwSJQbN6yb9HddEaT30E6hUrzEQA,2573
97
100
  swarms/schemas/agent_tool_schema.py,sha256=XdaKie6R0WhNXlnEl9f5T3hHmMedFbVwG17fdHP_U3E,385
98
101
  swarms/schemas/base_schemas.py,sha256=UvBLVWg2qRen4tK5GJz50v42SiX95EQ5qK7hfyAHTEU,3267
99
- swarms/schemas/llm_agent_schema.py,sha256=om3tPSjwbkIj2Hr38mKMLJvWs0E2BaE1jw2kzzd0Www,3020
102
+ swarms/schemas/conversation_schema.py,sha256=eOJhaRBJw4Z0PWXx9ljRIL0byR_pFIU-6k3UIWli8JA,325
103
+ swarms/schemas/llm_agent_schema.py,sha256=S5ZIF21q-I9EUtQpgKYZc361o5FGFOnrW_6YTKNYlMY,3568
100
104
  swarms/schemas/mcp_schemas.py,sha256=XZJ4HyiY_cv8Gvj-53ddjzXuqT9hBU2f0cHbhIKs_jY,1330
101
- swarms/structs/__init__.py,sha256=plgl4yHp-4guyP6dk32KGFFU_Kc9G3bOY6wkFc8WBWw,4296
102
- swarms/structs/agent.py,sha256=MsPTIbIeOCa43eU6hIIp1pd8VSm07SjWB0he19msoyQ,100435
105
+ swarms/schemas/swarms_api_schemas.py,sha256=uKqleW_7hNpqHi06yoba9jS2i9yzZp-SBV944MnkN68,6233
106
+ swarms/schemas/tool_schema_base_model.py,sha256=0biTGIoibsPPP3fOrkC6WvNU5vXaalyccVKC1fpO_eg,1409
107
+ swarms/structs/__init__.py,sha256=XbUK6MSivL9qHNFlcoGcAVRYPupQssD3dG_-yAqrycw,4345
108
+ swarms/structs/agent.py,sha256=dwCuxBLpPEvJCREfsMbp_Imiz_VtFiZTuXZMrWduIAE,102867
103
109
  swarms/structs/agent_builder.py,sha256=tYNpfO4_8cgfMHfgA5DAOWffHnt70p6CLt59esqfVCY,12133
110
+ swarms/structs/agent_rag_handler.py,sha256=g17YRrNmf16TLvyFCCcsitVk3d-QNZmck_XYmjSN_YM,21372
104
111
  swarms/structs/agent_registry.py,sha256=il507cO1NF-d4ChyANVLuWrN8bXsEAi8_7bLJ_sTU6A,12112
105
112
  swarms/structs/agent_roles.py,sha256=8XEw6RjOOZelaZaWt4gXaYQm5WMLEhSO7W6Z8sQjmFg,582
106
113
  swarms/structs/agent_router.py,sha256=YZw5AaK2yTvxkOA7ouED_4MoYgn0XZggvo1wrglp-4E,13017
107
114
  swarms/structs/aop.py,sha256=VQS1oDtg4cXVBxRaxMSYSM5X4nzVFy7u7mLmiOqDWZo,17408
108
115
  swarms/structs/auto_swarm_builder.py,sha256=79hd-3GpEyCGgS6tj4FvGFyM8768McQZJQXbGGj9XMk,12973
109
116
  swarms/structs/base_structure.py,sha256=GDu4QJQQmhU7IyuFJHIh9UVThACCva-L7uoMbVD9l4s,15901
110
- swarms/structs/base_swarm.py,sha256=LSGJDPJdyUCcK6698mNtjxoC1OU3s_J2NxC2k_ccGUs,23779
117
+ swarms/structs/base_swarm.py,sha256=bO5olk16je7aJ_XmJxiD6y4nVlbvOySZpc5JX6Rdpvg,23807
111
118
  swarms/structs/base_workflow.py,sha256=DTfFwX3AdFYxACDYwUDqhsbcDZnITlg5TeEYyxmJBCc,11414
112
119
  swarms/structs/batch_agent_execution.py,sha256=d85DzeCq4uTbbPqLhAXFqFx_cxXUS5yRnJ1-gJkwU5w,1871
113
120
  swarms/structs/concat.py,sha256=utezSxNyh1mIwXgdf8-dJ803NDPyEy79WE8zJHuooGk,732
114
121
  swarms/structs/concurrent_workflow.py,sha256=OqXI-X-9a0hG2a7aLzobwd7CVF2ez0rgLj3ZHqri5bg,12952
115
- swarms/structs/conversation.py,sha256=fnzBYzMt-Zk7bRwOeV41m7_IQz1YGFNqACzX4nmAXsY,30051
122
+ swarms/structs/conversation.py,sha256=EagQYlcLoa4Kukb5oQnLDQqpM7-HnIeLNepubIk8ono,49225
116
123
  swarms/structs/council_judge.py,sha256=siYDKiHMvFmShUTXxdo4R6vXiQhKt7bEBI205oC3kU4,19639
117
- swarms/structs/csv_to_agent.py,sha256=ug9JqQFPguXeU9JQpSUXuVtOpHYdJhlpKJUJBovo694,9443
124
+ swarms/structs/csv_to_agent.py,sha256=PVSbLdWqt6VnnekwqcnWQ8-Am3bhNFsIkUK5GliZV18,11178
118
125
  swarms/structs/de_hallucination_swarm.py,sha256=9cC0rSSXGwYu6SRDwpeMbCcQ40C1WI1RE9SNapKRLOQ,10309
119
- swarms/structs/deep_research_swarm.py,sha256=3f8T_t-gIg5wbfU2JrMmZ9Ob4Qn153zXdzt5ZpydmXk,16777
120
- swarms/structs/dynamic_conversational_swarm.py,sha256=n_d1jDCzBwiGb0QjJpW_MlXxqEkhGEhC1ttaebH7f3Q,8098
126
+ swarms/structs/deep_research_swarm.py,sha256=cNLDI7_lT47q4bCRlMJO4IAO3Fu_iF3nPi3jgtg6CJQ,17026
127
+ swarms/structs/dynamic_conversational_swarm.py,sha256=xm8x_0OCI4ijatgVt8dzHhLNUyMzqG2U_XQL14kcIS8,8354
121
128
  swarms/structs/graph_workflow.py,sha256=TAaUG_J3898hhghPOp0WEAV3Zf0in6s48ZSVbSTX-vQ,8629
122
129
  swarms/structs/groupchat.py,sha256=jjH0BqU9Nrd_3jl9QzrcvbSce527SFpUaepawaRiw2o,15391
123
- swarms/structs/hiearchical_swarm.py,sha256=2x3InS4HJg4T9Y195l_ANTGu6DYcllqCdJcR3v5Xuro,33402
124
- swarms/structs/hybrid_hiearchical_peer_swarm.py,sha256=D1iBtNNee_mxPoOWS5WGTqcci5FQKtt38mW-J42GvfM,9494
130
+ swarms/structs/hiearchical_swarm.py,sha256=6JwYWlsmwsVtOr2xlzl2q0IRsGvr-RFzDG9ClIJWTQo,33400
131
+ swarms/structs/hybrid_hiearchical_peer_swarm.py,sha256=0BrmzSVit-I_04DFfrs7onLblLA6PSPa0JE3-4j05FA,9316
132
+ swarms/structs/image_batch_processor.py,sha256=31Z8vTVL4dw18QxGwb0Jg1nvp0YzX8lwVgGj_-KrkhY,8207
133
+ swarms/structs/interactive_groupchat.py,sha256=tt5JCqYsLK-omFz-eG-HBEttvu3zMLAprbLEahVWb6M,12937
125
134
  swarms/structs/long_agent.py,sha256=KFjE2uUI8ONTkeJO43Sh3y5-Ec0kga28BECGklic-S4,15049
126
- swarms/structs/ma_blocks.py,sha256=dT7kzTp3MMyypPrGKR_OfurjNfcqjful0mEoIrT0z0A,2478
135
+ swarms/structs/ma_blocks.py,sha256=04dF3DOSHXxNwrcl9QUloKgNDkI9yLRv6UbyyiKsIb0,4551
127
136
  swarms/structs/ma_utils.py,sha256=s8uTCplQtiFvxyqyTTTUCnJDMwNLJEuxbdGZyOURjLg,3244
128
- swarms/structs/majority_voting.py,sha256=F_t_MOC3YCRyMw5N6qKdFThpaXZxwixRw592Ku5Uhto,10122
137
+ swarms/structs/majority_voting.py,sha256=7RGMTNX-ulH5McV0LPkpGEOkwYgsBdzTzHk5G_g_YUY,10120
129
138
  swarms/structs/malt.py,sha256=uLofKBWHkP3uNhyCkkgEyE4Z7qnOHTtcg-OTiR19x_Y,19572
130
139
  swarms/structs/matrix_swarm.py,sha256=qHuhOYrTyOv6ujHMe8PrQT-h-WmaCPCfX4ghv5L8UFI,9765
131
140
  swarms/structs/meme_agent_persona_generator.py,sha256=b3kKlumhsV4KV88-GS3CUnGO1UfKTU3fT8SAMj0ZlwQ,10645
132
- swarms/structs/mixture_of_agents.py,sha256=Ix2YTdrzISPQJLrQ5vrZtYOpZwIYDx0vUaNmvBwDDVM,7762
141
+ swarms/structs/mixture_of_agents.py,sha256=UtEwfv0GY-RU32AwVKU1j9XJvBZx8IioTgGxaIki4qU,7760
133
142
  swarms/structs/model_router.py,sha256=V5pZHYlxSmCvAA2Gsns7LaCz8dXtRi7pCvb-oLGHYIY,12739
134
- swarms/structs/multi_agent_collab.py,sha256=odh2NQRR23LidsphCxUfAke369lDdgL__w3Xovu9jkA,7731
135
143
  swarms/structs/multi_agent_exec.py,sha256=3hIGgwJ_mQwgD16N096jN48-DEIZWFPoetR2nCxIe6I,14203
136
- swarms/structs/multi_agent_router.py,sha256=21PfswEuxMHqlWDBCyritj9UuHTShYVQRaK0o23eia8,10999
144
+ swarms/structs/multi_agent_router.py,sha256=A4MDd4_QAoarrLaxClnCxnEP62bSMFvyq77ttqeq3u8,11049
137
145
  swarms/structs/multi_model_gpu_manager.py,sha256=gHC6MmVia4etMD6RlpEdbqZtV7ng4f-6jVMH0Zrt8y4,47356
138
146
  swarms/structs/omni_agent_types.py,sha256=RdKLfZ-lXDJrEa0aJT_Rfx9TypJQo8SISqKz4fnLkAk,230
139
- swarms/structs/output_types.py,sha256=gbZfmogjcnx0jDWZecSX2yPuNXHkgWU-feHeQ1fuvmM,191
140
- swarms/structs/rearrange.py,sha256=5u7HwTVVH414w9rhEQvLdltW1ACHjgwn-zS8-8JEXmA,22576
147
+ swarms/structs/rearrange.py,sha256=x8dU19blC2ED8xEi1NPF5_GMgsupKbZ08nVVEQEGmaQ,22598
141
148
  swarms/structs/round_robin.py,sha256=MGk623KiN9uSxTMG6MY_BIAkvEDh1RPwyl5Min7GLOU,7573
142
149
  swarms/structs/safe_loading.py,sha256=gmYX8G9TsvAIp6OCvREBZt5mwSFc-p-t1rSnDBfhEmE,7124
143
- swarms/structs/sequential_workflow.py,sha256=5jxHP-a2CzdclSXIrVWkQKXBr01VzrgOBIexR9s8diw,8492
150
+ swarms/structs/sequential_workflow.py,sha256=CP-MmxSEJpQCJFivegQyK0GTff5k3jFZbso3t3bSu00,8524
144
151
  swarms/structs/spreadsheet_swarm.py,sha256=ToX56QJjlm_nnC3MYppvKC_NTr9Zy_orkBzfxNLdwbA,14845
145
152
  swarms/structs/stopping_conditions.py,sha256=JHHwqgPoUvjX897ofW2gpPZH_cqEWmv5lDTqb2GtA6M,1382
146
153
  swarms/structs/swarm_arange.py,sha256=5ewEfL52Y4gh-a0lRjFcleHWlsCBuc5XR1nVEEGh07w,15481
147
154
  swarms/structs/swarm_eval.py,sha256=148E2R2zaCmt_LZYx15nmdFjybXHiQ2CZbl6pk77jNs,11635
148
155
  swarms/structs/swarm_id_generator.py,sha256=Wly7AtGM9e6VgzhYmfg8_gSOdxAdsOvWHJFK81cpQNQ,68
149
- swarms/structs/swarm_matcher.py,sha256=cV3xkoab9FiKTVL4C9Po6akNlWCMM4DFFj6xhINAqEM,23318
156
+ swarms/structs/swarm_matcher.py,sha256=HUCxTWRnxT5Rix3CMKEuJCqNleqPA9xGrWFGw6rjcTw,26821
150
157
  swarms/structs/swarm_registry.py,sha256=P0XRrqp1qBNyt0BycqPQljUzKv9jClaQMhtaBMinhYg,5578
151
- swarms/structs/swarm_router.py,sha256=5zMhcWiNTTdQKH1D0oi8zsR0vH3AMESeNtsT57ArPgY,30673
152
- swarms/structs/swarming_architectures.py,sha256=q2XrY2lOqFhVckA8oin65Dz1VPUe-lfbEJHlP1Z8aTE,28278
158
+ swarms/structs/swarm_router.py,sha256=2ytmiQH-slqtQts0JPju52jTLTHRDNgdV-tjp0-TtAg,27813
159
+ swarms/structs/swarming_architectures.py,sha256=guNQU2N7Ofuk01fZbU3tmBJymnZ9zdGULpPZAdaqCeA,28276
153
160
  swarms/structs/tree_swarm.py,sha256=AnIxrt0KhWxAQN8uGjfCcOq-XCmsuTJiH8Ex4mXy8V8,12500
154
161
  swarms/structs/utils.py,sha256=Mo6wHQYOB8baWZUKnAJN5Dsgubpo81umNwJIEDitb2A,1873
155
162
  swarms/structs/various_alt_swarms.py,sha256=qdBuOF31UjatlKRu-9bxwyRQzIjohRhTv_63YoUeYEY,27866
@@ -166,42 +173,40 @@ swarms/tools/function_util.py,sha256=DAnAPO0Ik__TAqL7IJzFmkukHnhpsW_QtALl3yj837g
166
173
  swarms/tools/json_former.py,sha256=4ugLQ_EZpghhuhFsVKsy-ehin9K64pqVE2gLU7BTO_M,14376
167
174
  swarms/tools/json_utils.py,sha256=WKMZjcJ0Vt6lgIjiTBenslcfjgRSLX4UWs4uDkKFMQI,1316
168
175
  swarms/tools/logits_processor.py,sha256=NifZZ5w9yemWGJAJ5nHFrphtZVX1XlyesgvYZTxK1GM,2965
169
- swarms/tools/mcp_client_call.py,sha256=4iYDpMT_v0Kk_RTgL0bfQruxJJJuXNPmZQalHL1vm6c,15287
176
+ swarms/tools/mcp_client_call.py,sha256=8cLwtOAYSRGdCRYq_RujuyLHcApQXmNp6K9vYtv1N6U,15362
170
177
  swarms/tools/openai_func_calling_schema_pydantic.py,sha256=6BAH9kuaVTvJIbjgSSJ5XvHhWvWszPxgarkfUuE5Ads,978
171
178
  swarms/tools/openai_tool_creator_decorator.py,sha256=SYZjHnARjWvnH9cBdj7Kc_Yy1muvNxMT3RQz8KkA2SE,2578
172
179
  swarms/tools/py_func_to_openai_func_str.py,sha256=sjoNutRZ11-0kYFDalUTxZxQ0TEDyn5R8EXMdS4gsgw,17091
173
180
  swarms/tools/pydantic_to_json.py,sha256=sd5uWwjSHsu7M8wCBrPv0uje05-K4xcfbvKQ_zOaww8,3399
174
181
  swarms/tools/tool_parse_exec.py,sha256=FW5XzkuNEs2YrroybjKChbCzDvaCs7ypknSDpYhfkd4,8717
175
182
  swarms/tools/tool_registry.py,sha256=ULZmIKBTx9XRCJRD9hwXfY3iQw9v94arw-VV6jcuftY,7992
176
- swarms/tools/tool_schema_base_model.py,sha256=0biTGIoibsPPP3fOrkC6WvNU5vXaalyccVKC1fpO_eg,1409
177
183
  swarms/tools/tool_utils.py,sha256=yXzzqG7Ytd8ybB8bsjNUNLaXIuIp9JbbpUKCiHxQqo8,2816
178
- swarms/utils/__init__.py,sha256=9qKE_11pxom74j3qExSm6Z_LwR5lrpC5YG17v22eLlo,975
184
+ swarms/utils/__init__.py,sha256=tpbhE-BTISDMXemSRSRJz-Rz7m_C05Q5Pre3d9H9SN4,1195
179
185
  swarms/utils/any_to_str.py,sha256=Qi4N9ed6LYnCs2AeFYo1zwEfYhOKUesGVFUmVUz54KI,2936
180
186
  swarms/utils/audio_processing.py,sha256=Y3KaWG9WJrgquWCeaty20HWPIXfeuPAhcJFzoSBIQjE,9893
181
187
  swarms/utils/auto_download_check_packages.py,sha256=mqx3jCetfkTuxTdeGLx-gGMB1xWOU5vata8lTKXLatk,4580
182
188
  swarms/utils/calculate_func_metrics.py,sha256=Nb5r7rWf809m5F7mWIYXZ0H_WeyGr78A2UZD2GHtJkM,5007
189
+ swarms/utils/check_all_model_max_tokens.py,sha256=ZHIKlrU-L-OM2IJAbYkCoVyBKe2d0JrGhDC9QNppGIs,1519
183
190
  swarms/utils/data_to_text.py,sha256=1PUoWokylp7MOrGNk1cmO3cJlfskdAIiImGk9ECwsKU,3427
184
191
  swarms/utils/disable_logging.py,sha256=KKPKQVfQqLPFgj03uveOoyeHOTlfEJt-yfLc3SA53Rk,2470
185
192
  swarms/utils/file_processing.py,sha256=QjQCIPTcwicQlfy656BXBYpIzMR0s2343E7ftnok5Uo,4865
186
193
  swarms/utils/formatter.py,sha256=e15FsyTIIkyRreMUApkkZCzJC1Sm67w5Zd6EQcUkMwA,4533
187
194
  swarms/utils/function_caller_model.py,sha256=ZfgCMzOizNnuZipYLclTziECNHszH9p8RQcUq7VNr4Q,4156
188
- swarms/utils/generate_keys.py,sha256=i0Ewm1LCTLaqp7qm7B7MgNolaI9IZyJcxNVRLUZklt4,1700
189
- swarms/utils/history_output_formatter.py,sha256=d4J-TF63ENCjsQXU36MGR2pvx59y0qBFuBlOrJt_K8M,1487
195
+ swarms/utils/generate_keys.py,sha256=o5zp_8rwu5sgQnItWS1xAuIIRIkahwm02qy1vsV6DSQ,997
196
+ swarms/utils/history_output_formatter.py,sha256=hxRVeusMxcwIPcbPpsmWgxd7PGxBv2eJzUDITbyFvKE,1309
190
197
  swarms/utils/index.py,sha256=iYVlMiuSpBuKHF34uSrxDUuSYmS26bbYoAqyz_VIyvY,6902
191
198
  swarms/utils/litellm_tokenizer.py,sha256=PqzAY4C5lJ3P-K9SL-dCNtxmHHlZvAw1UohT-ob9lxY,3389
192
- swarms/utils/litellm_wrapper.py,sha256=dZ9KCR_Rxlm3VZWWVfhpTb4Y6KM_xHipynueJUeU_Jc,15023
199
+ swarms/utils/litellm_wrapper.py,sha256=moSaVYIViCSib2r1kS2h1BqltQKcysVJCeI6cAXp2bU,19566
193
200
  swarms/utils/loguru_logger.py,sha256=hIoSK3NHLpe7eAmjHRURrEYzNXYC2gbR7_Vv63Yaydk,685
194
- swarms/utils/markdown_message.py,sha256=RThHNnMf6ZLTlYK4vKn3yuewChaxWAYAWb0Xm_pTyIU,652
201
+ swarms/utils/output_types.py,sha256=yEggBESV8D-gOh7NR6OpOT0WUmA97oz514f27B9NV1Y,406
195
202
  swarms/utils/parse_code.py,sha256=XFOLymbdP3HzMZuqsj7pwUyisvUmTm0ev9iThR_ambI,1987
196
203
  swarms/utils/pdf_to_text.py,sha256=nkySOS_sJ4Jf4RP5SoDpMB5WfjJ_GGc5z8gJfn2cxOM,1311
197
204
  swarms/utils/str_to_dict.py,sha256=T3Jsdjz87WIlkSo7jAW6BB80sv0Ns49WT1qXlOrdEoE,874
198
205
  swarms/utils/try_except_wrapper.py,sha256=uvDZDZJcH986EF0Ej6zZBLcqHJ58NHizPsAH5olrE7Q,3919
199
- swarms/utils/visualizer.py,sha256=0ylohEk62MAS6iPRaDOV03m9qo2k5J56tWlKJk_46p4,16927
200
- swarms/utils/vllm_wrapper.py,sha256=AUoJuZhBc9iD70Uo400toAlIcY1P0LkA67eVau5rDhw,5067
201
- swarms/utils/wrapper_clusterop.py,sha256=PMSCVM7ZT1vgj1D_MYAe835RR3SMLYxA-si2JS02yNQ,4220
202
- swarms/utils/xml_utils.py,sha256=j8byUa56VT7V4e18pL8UBftLdyWKsUHbid1KDxnAWBo,1416
203
- swarms-7.8.4.dist-info/LICENSE,sha256=jwRtEmTWjLrEsvFB6QFdYs2cEeZPRMdj-UMOFkPF8_0,11363
204
- swarms-7.8.4.dist-info/METADATA,sha256=dV2n6Kb8uRJa8-hF4AK4cpo_OM_S4cyoSyoWFhRanYM,94945
205
- swarms-7.8.4.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
206
- swarms-7.8.4.dist-info/entry_points.txt,sha256=2K0rTtfO1X1WaO-waJlXIKw5Voa_EpAL_yU0HXE2Jgc,47
207
- swarms-7.8.4.dist-info/RECORD,,
206
+ swarms/utils/vllm_wrapper.py,sha256=sNkm4EbeMrqqmHidnvq5zTnofQAaARy3HIrNBu11lKs,5072
207
+ swarms/utils/xml_utils.py,sha256=D4nEdo1nkHqSoTKrWylXBXjcHFhGaOYvvfGNQQoYV5o,2514
208
+ swarms-7.8.7.dist-info/LICENSE,sha256=jwRtEmTWjLrEsvFB6QFdYs2cEeZPRMdj-UMOFkPF8_0,11363
209
+ swarms-7.8.7.dist-info/METADATA,sha256=ysQ9oCgqZ8C76O62Z3g0L_RSZOq-4iyw_yjVdUYrAhk,94363
210
+ swarms-7.8.7.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
211
+ swarms-7.8.7.dist-info/entry_points.txt,sha256=2K0rTtfO1X1WaO-waJlXIKw5Voa_EpAL_yU0HXE2Jgc,47
212
+ swarms-7.8.7.dist-info/RECORD,,
@@ -1,242 +0,0 @@
1
- from typing import List, Callable
2
-
3
- from swarms.structs.agent import Agent
4
- from swarms.utils.loguru_logger import logger
5
- from swarms.structs.base_swarm import BaseSwarm
6
- from swarms.structs.conversation import Conversation
7
-
8
-
9
- # def select_next_speaker_bid(
10
- # step: int,
11
- # agents: List[Agent],
12
- # ) -> int:
13
- # """Selects the next speaker."""
14
- # bids = []
15
- # for agent in agents:
16
- # bid = ask_for_bid(agent)
17
- # bids.append(bid)
18
- # max_value = max(bids)
19
- # max_indices = [i for i, x in enumerate(bids) if x == max_value]
20
- # idx = random.choice(max_indices)
21
- # return idx
22
-
23
-
24
- def select_next_speaker_roundtable(
25
- step: int, agents: List[Agent]
26
- ) -> int:
27
- """Selects the next speaker."""
28
- return step % len(agents)
29
-
30
-
31
- def select_next_speaker_director(
32
- step: int, agents: List[Agent], director: Agent
33
- ) -> int:
34
- # if the step if even => director
35
- # => director selects next speaker
36
- if step % 2 == 1:
37
- idx = 0
38
- else:
39
- idx = director.select_next_speaker() + 1
40
- return idx
41
-
42
-
43
- def run_director(self, task: str):
44
- """Runs the multi-agent collaboration with a director."""
45
- n = 0
46
- self.reset()
47
- self.inject("Debate Moderator", task)
48
- print("(Debate Moderator): \n")
49
-
50
- while n < self.max_loops:
51
- name, message = self.step()
52
- print(f"({name}): {message}\n")
53
- n += 1
54
-
55
-
56
- # [MAYBE]: Add type hints
57
- class MultiAgentCollaboration(BaseSwarm):
58
- """
59
- Multi-agent collaboration class.
60
-
61
- Attributes:
62
- agents (List[Agent]): The agents in the collaboration.
63
- selection_function (callable): The function that selects the next speaker.
64
- Defaults to select_next_speaker.
65
- max_loops (int): The maximum number of iterations. Defaults to 10.
66
- autosave (bool): Whether to autosave the state of all agents. Defaults to True.
67
- saved_file_path_name (str): The path to the saved file. Defaults to
68
- "multi_agent_collab.json".
69
- stopping_token (str): The token that stops the collaboration. Defaults to
70
- "<DONE>".
71
- results (list): The results of the collaboration. Defaults to [].
72
- logger (logging.Logger): The logger. Defaults to logger.
73
- logging (bool): Whether to log the collaboration. Defaults to True.
74
-
75
-
76
- Methods:
77
- reset: Resets the state of all agents.
78
- inject: Injects a message into the collaboration.
79
- inject_agent: Injects an agent into the collaboration.
80
- step: Steps through the collaboration.
81
- ask_for_bid: Asks an agent for a bid.
82
- select_next_speaker: Selects the next speaker.
83
- run: Runs the collaboration.
84
- format_results: Formats the results of the run method.
85
-
86
-
87
- Usage:
88
- >>> from swarm_models import OpenAIChat
89
- >>> from swarms.structs import Agent
90
- >>> from swarms.swarms.multi_agent_collab import MultiAgentCollaboration
91
- >>>
92
- >>> # Initialize the language model
93
- >>> llm = OpenAIChat(
94
- >>> temperature=0.5,
95
- >>> )
96
- >>>
97
- >>>
98
- >>> ## Initialize the workflow
99
- >>> agent = Agent(llm=llm, max_loops=1, dashboard=True)
100
- >>>
101
- >>> # Run the workflow on a task
102
- >>> out = agent.run("Generate a 10,000 word blog on health and wellness.")
103
- >>>
104
- >>> # Initialize the multi-agent collaboration
105
- >>> swarm = MultiAgentCollaboration(
106
- >>> agents=[agent],
107
- >>> max_loops=4,
108
- >>> )
109
- >>>
110
- >>> # Run the multi-agent collaboration
111
- >>> swarm.run()
112
- >>>
113
- >>> # Format the results of the multi-agent collaboration
114
- >>> swarm.format_results(swarm.results)
115
-
116
- """
117
-
118
- def __init__(
119
- self,
120
- name: str = "MultiAgentCollaboration",
121
- description: str = "A multi-agent collaboration.",
122
- director: Agent = None,
123
- agents: List[Agent] = None,
124
- select_next_speaker: Callable = None,
125
- max_loops: int = 10,
126
- autosave: bool = True,
127
- saved_file_path_name: str = "multi_agent_collab.json",
128
- stopping_token: str = "<DONE>",
129
- logging: bool = True,
130
- *args,
131
- **kwargs,
132
- ):
133
- super().__init__(
134
- name=name,
135
- description=description,
136
- agents=agents,
137
- *args,
138
- **kwargs,
139
- )
140
- self.name = name
141
- self.description = description
142
- self.director = director
143
- self.agents = agents
144
- self.select_next_speaker = select_next_speaker
145
- self._step = 0
146
- self.max_loops = max_loops
147
- self.autosave = autosave
148
- self.saved_file_path_name = saved_file_path_name
149
- self.stopping_token = stopping_token
150
- self.results = []
151
- self.logger = logger
152
- self.logging = logging
153
-
154
- # Conversation
155
- self.conversation = Conversation(
156
- time_enabled=False, *args, **kwargs
157
- )
158
-
159
- def default_select_next_speaker(
160
- self, step: int, agents: List[Agent]
161
- ) -> int:
162
- """Default speaker selection function."""
163
- return step % len(agents)
164
-
165
- def inject(self, name: str, message: str):
166
- """Injects a message into the multi-agent collaboration."""
167
- for agent in self.agents:
168
- self.conversation.add(name, message)
169
- agent.run(self.conversation.return_history_as_string())
170
- self._step += 1
171
-
172
- def step(self) -> str:
173
- """Steps through the multi-agent collaboration."""
174
- speaker_idx = self.select_next_speaker(
175
- self._step, self.agents
176
- )
177
- speaker = self.agents[speaker_idx]
178
- message = speaker.send()
179
-
180
- for receiver in self.agents:
181
- self.conversation.add(speaker.name, message)
182
- receiver.run(self.conversation.return_history_as_string())
183
-
184
- self._step += 1
185
-
186
- if self.logging:
187
- self.log_step(speaker, message)
188
-
189
- return self.conversation.return_history_as_string()
190
-
191
- def log_step(self, speaker: str, response: str):
192
- """Logs the step of the multi-agent collaboration."""
193
- self.logger.info(f"{speaker.name}: {response}")
194
-
195
- def run(self, task: str, *args, **kwargs):
196
- """Runs the multi-agent collaboration."""
197
- for _ in range(self.max_loops):
198
- result = self.step()
199
- if self.autosave:
200
- self.save_state()
201
- if self.stopping_token in result:
202
- break
203
- return self.conversation.return_history_as_string()
204
-
205
- # def format_results(self, results):
206
- # """Formats the results of the run method"""
207
- # formatted_results = "\n".join(
208
- # [
209
- # f"{result['agent']} responded: {result['response']}"
210
- # for result in results
211
- # ]
212
- # )
213
- # return formatted_results
214
-
215
- # def save(self):
216
- # """Saves the state of all agents."""
217
- # state = {
218
- # "step": self._step,
219
- # "results": [
220
- # {"agent": r["agent"].name, "response": r["response"]}
221
- # for r in self.results
222
- # ],
223
- # }
224
-
225
- # with open(self.saved_file_path_name, "w") as file:
226
- # json.dump(state, file)
227
-
228
- # def load(self):
229
- # """Loads the state of all agents."""
230
- # with open(self.saved_file_path_name) as file:
231
- # state = json.load(file)
232
- # self._step = state["step"]
233
- # self.results = state["results"]
234
- # return state
235
-
236
- # def __repr__(self):
237
- # return (
238
- # f"MultiAgentCollaboration(agents={self.agents},"
239
- # f" selection_function={self.select_next_speaker},"
240
- # f" max_loops={self.max_loops}, autosave={self.autosave},"
241
- # f" saved_file_path_name={self.saved_file_path_name})"
242
- # )
@@ -1,6 +0,0 @@
1
- from swarms.utils.history_output_formatter import (
2
- HistoryOutputType as OutputType,
3
- )
4
-
5
- # Use the OutputType for type annotations
6
- output_type: OutputType # OutputType now includes 'xml'
@@ -1,21 +0,0 @@
1
- from swarms.utils.formatter import formatter
2
-
3
-
4
- def display_markdown_message(message: str, color: str = "cyan"):
5
- """
6
- Display markdown message. Works with multiline strings with lots of indentation.
7
- Will automatically make single line > tags beautiful.
8
- """
9
-
10
- for line in message.split("\n"):
11
- line = line.strip()
12
- if line == "":
13
- print()
14
- elif line == "---":
15
- formatter.print_panel("-" * 50)
16
- else:
17
- formatter.print_panel(line)
18
-
19
- if "\n" not in message and message.startswith(">"):
20
- # Aesthetic choice. For these tags, they need a space below them
21
- print()