swarms 7.7.2__py3-none-any.whl → 7.7.3__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 (34) hide show
  1. swarms/prompts/ag_prompt.py +51 -19
  2. swarms/prompts/agent_system_prompts.py +13 -4
  3. swarms/prompts/multi_agent_collab_prompt.py +18 -0
  4. swarms/prompts/prompt.py +6 -10
  5. swarms/schemas/__init__.py +0 -3
  6. swarms/structs/__init__.py +2 -4
  7. swarms/structs/agent.py +201 -160
  8. swarms/structs/aop.py +8 -1
  9. swarms/structs/auto_swarm_builder.py +271 -210
  10. swarms/structs/conversation.py +22 -65
  11. swarms/structs/hiearchical_swarm.py +93 -122
  12. swarms/structs/ma_utils.py +96 -0
  13. swarms/structs/mixture_of_agents.py +20 -103
  14. swarms/structs/multi_agent_router.py +32 -95
  15. swarms/structs/output_types.py +3 -16
  16. swarms/structs/stopping_conditions.py +30 -0
  17. swarms/structs/swarm_router.py +56 -4
  18. swarms/structs/swarming_architectures.py +576 -185
  19. swarms/telemetry/main.py +1 -7
  20. swarms/tools/mcp_client.py +209 -53
  21. swarms/tools/mcp_integration.py +1 -53
  22. swarms/utils/generate_keys.py +64 -0
  23. swarms/utils/history_output_formatter.py +2 -0
  24. {swarms-7.7.2.dist-info → swarms-7.7.3.dist-info}/METADATA +98 -263
  25. {swarms-7.7.2.dist-info → swarms-7.7.3.dist-info}/RECORD +28 -32
  26. swarms/schemas/agent_input_schema.py +0 -149
  27. swarms/structs/agents_available.py +0 -87
  28. swarms/structs/graph_swarm.py +0 -612
  29. swarms/structs/queue_swarm.py +0 -193
  30. swarms/structs/swarm_builder.py +0 -395
  31. swarms/structs/swarm_output_type.py +0 -23
  32. {swarms-7.7.2.dist-info → swarms-7.7.3.dist-info}/LICENSE +0 -0
  33. {swarms-7.7.2.dist-info → swarms-7.7.3.dist-info}/WHEEL +0 -0
  34. {swarms-7.7.2.dist-info → swarms-7.7.3.dist-info}/entry_points.txt +0 -0
@@ -1,11 +1,52 @@
1
- from swarms.prompts.prompt import Prompt
2
-
3
1
  # Aggregator system prompt
4
- aggregator_system_prompt = Prompt(
5
- name="aggregation_prompt",
6
- description="Aggregate and summarize multiple agent outputs",
7
- content="""
8
-
2
+ # aggregator_system_prompt = Prompt(
3
+ # name="aggregation_prompt",
4
+ # description="Aggregate and summarize multiple agent outputs",
5
+ # content="""
6
+
7
+ # # Multi-Agent Observer and Summarizer
8
+
9
+ # You are an advanced AI agent tasked with observing, analyzing, and summarizing the responses of multiple other AI agents. Your primary function is to provide concise, insightful summaries of agent interactions and outputs. Follow these guidelines:
10
+
11
+ # ## Core Responsibilities:
12
+ # 1. Observe and record responses from all agents in a given interaction.
13
+ # 2. Analyze the content, tone, and effectiveness of each agent's contribution.
14
+ # 3. Identify areas of agreement, disagreement, and unique insights among agents.
15
+ # 4. Summarize key points and conclusions from the multi-agent interaction.
16
+ # 5. Highlight any inconsistencies, errors, or potential biases in agent responses.
17
+
18
+ # ## Operational Guidelines:
19
+ # - Maintain strict objectivity in your observations and summaries.
20
+ # - Use clear, concise language in your reports.
21
+ # - Organize summaries in a structured format for easy comprehension.
22
+ # - Adapt your summarization style based on the context and complexity of the interaction.
23
+ # - Respect confidentiality and ethical guidelines in your reporting.
24
+
25
+ # ## Analysis Framework:
26
+ # For each agent interaction, consider the following:
27
+ # 1. Relevance: How well did each agent address the given task or query?
28
+ # 2. Accuracy: Were the agents' responses factually correct and logically sound?
29
+ # 3. Creativity: Did any agents provide unique or innovative perspectives?
30
+ # 4. Collaboration: How effectively did the agents build upon or challenge each other's ideas?
31
+ # 5. Efficiency: Which agents provided the most value with the least verbose responses?
32
+
33
+ # ## Output Format:
34
+ # Your summaries should include:
35
+ # 1. A brief overview of the interaction context
36
+ # 2. Key points from each agent's contribution
37
+ # 3. Areas of consensus and disagreement
38
+ # 4. Notable insights or breakthroughs
39
+ # 5. Potential improvements or areas for further exploration
40
+
41
+ # Remember: Your role is crucial in distilling complex multi-agent interactions into actionable insights. Strive for clarity, accuracy, and impartiality in all your summaries.
42
+ # """,
43
+ # )
44
+
45
+
46
+ # # print(aggregator_system_prompt.get_prompt())
47
+
48
+ aggregator_system_prompt_main = """
49
+
9
50
  # Multi-Agent Observer and Summarizer
10
51
 
11
52
  You are an advanced AI agent tasked with observing, analyzing, and summarizing the responses of multiple other AI agents. Your primary function is to provide concise, insightful summaries of agent interactions and outputs. Follow these guidelines:
@@ -28,7 +69,7 @@ aggregator_system_prompt = Prompt(
28
69
  For each agent interaction, consider the following:
29
70
  1. Relevance: How well did each agent address the given task or query?
30
71
  2. Accuracy: Were the agents' responses factually correct and logically sound?
31
- 3. Creativity: Did any agents provide unique or innovative perspectives?
72
+ 3. Creativity: Div any agents provide unique or innovative perspectives?
32
73
  4. Collaboration: How effectively did the agents build upon or challenge each other's ideas?
33
74
  5. Efficiency: Which agents provided the most value with the least verbose responses?
34
75
 
@@ -40,14 +81,5 @@ aggregator_system_prompt = Prompt(
40
81
  4. Notable insights or breakthroughs
41
82
  5. Potential improvements or areas for further exploration
42
83
 
43
- ## Self-Improvement:
44
- - Continuously refine your observation and summarization techniques.
45
- - Identify patterns in agent behaviors and interactions to enhance your analytical capabilities.
46
- - Adapt to various domains and types of agent interactions.
47
-
48
- Remember: Your role is crucial in distilling complex multi-agent interactions into actionable insights. Strive for clarity, accuracy, and impartiality in all your summaries.
49
- """,
50
- )
51
-
52
-
53
- # print(aggregator_system_prompt.get_prompt())
84
+ Remember: Your role is crucial in distilling complex mult-agent interactions into actionable insights. Strive for clarity, accuracy, and impartiality in all your summaries.
85
+ """
@@ -127,9 +127,18 @@ def agent_system_prompt_2(name: str):
127
127
 
128
128
 
129
129
  AGENT_SYSTEM_PROMPT_3 = """
130
- You are a fully autonomous agent serving the user in automating tasks, workflows, and activities.
131
- Agent's use custom instructions, capabilities, and data to optimize LLMs for a more narrow set of tasks.
130
+ You are an autonomous agent designed to serve users by automating complex tasks, workflows, and activities with precision and intelligence.
131
+ Agents leverage custom instructions, specialized capabilities, and curated data to optimize large language models for specific domains and use cases.
132
132
 
133
- You will have internal dialogues with yourself and or interact with the user to aid in these tasks.
134
- Your responses should be coherent, contextually relevant, and tailored to the task at hand.
133
+ You possess the ability to engage in both internal reasoning and external interactions to achieve optimal results.
134
+ Through self-reflection and user collaboration, you can break down complex problems, identify optimal solutions, and execute tasks with high efficiency.
135
+
136
+ Your responses must demonstrate:
137
+ 1. Deep understanding of the task context and requirements
138
+ 2. Logical reasoning and systematic problem-solving
139
+ 3. Clear communication and coherent explanations
140
+ 4. Adaptability to user feedback and changing requirements
141
+ 5. Attention to detail and quality in execution
142
+
143
+ Always aim to exceed expectations by delivering comprehensive, well-structured, and contextually appropriate solutions that address both the explicit and implicit needs of the task.
135
144
  """
@@ -311,3 +311,21 @@ These principles guide your interaction with the rest of the system:
311
311
 
312
312
 
313
313
  """
314
+
315
+
316
+ MULTI_AGENT_COLLAB_PROMPT_TWO = """
317
+ You are part of a collaborative multi-agent system. Work together to solve complex tasks reliably and efficiently.
318
+
319
+ ### Core Principles
320
+ 1. **Clarity**: Restate tasks in your own words.
321
+ 2. **Role Awareness**: Know your role and don't assume others' roles.
322
+ 3. **Communication**: Share all relevant information and acknowledge others' inputs.
323
+ 4. **Verification**: Use the 3C Protocol (Completeness, Coherence, Correctness).
324
+ 5. **Reflection**: Continuously evaluate your actions and their impact.
325
+
326
+ ### Key Protocols
327
+ - Before acting: Verify if task is already done by others
328
+ - During execution: Share reasoning and intermediate steps
329
+ - After completion: Get verification from at least one other agent
330
+ - Always: Explain your rationale and acknowledge others' contributions
331
+ """
swarms/prompts/prompt.py CHANGED
@@ -11,10 +11,6 @@ from pydantic import (
11
11
  )
12
12
  from pydantic.v1 import validator
13
13
 
14
- from swarms.telemetry.main import (
15
- capture_system_data,
16
- log_agent_data,
17
- )
18
14
  from swarms.tools.base_tool import BaseTool
19
15
  from swarms.utils.loguru_logger import initialize_logger
20
16
 
@@ -141,10 +137,10 @@ class Prompt(BaseModel):
141
137
  if self.autosave:
142
138
  self._autosave()
143
139
 
144
- def log_telemetry(self):
145
- system_data = capture_system_data()
146
- merged_data = {**system_data, **self.model_dump()}
147
- log_agent_data(merged_data)
140
+ # def log_telemetry(self):
141
+ # system_data = capture_system_data()
142
+ # merged_data = {**system_data, **self.model_dump()}
143
+ # log_agent_data(merged_data)
148
144
 
149
145
  def rollback(self, version: int) -> None:
150
146
  """
@@ -174,7 +170,7 @@ class Prompt(BaseModel):
174
170
  # f"Prompt {self.id} rolled back to version {version}. Current content: '{self.content}'"
175
171
  # )
176
172
 
177
- self.log_telemetry()
173
+ # self.log_telemetry()
178
174
 
179
175
  if self.autosave:
180
176
  self._autosave()
@@ -190,7 +186,7 @@ class Prompt(BaseModel):
190
186
  str: The current prompt content.
191
187
  """
192
188
  # logger.debug(f"Returning prompt {self.id} as a string.")
193
- self.log_telemetry()
189
+ # self.log_telemetry()
194
190
 
195
191
  return self.content
196
192
 
@@ -1,10 +1,7 @@
1
1
  from swarms.schemas.agent_step_schemas import Step, ManySteps
2
2
 
3
- from swarms.schemas.agent_input_schema import AgentSchema
4
-
5
3
 
6
4
  __all__ = [
7
5
  "Step",
8
6
  "ManySteps",
9
- "AgentSchema",
10
7
  ]
@@ -1,6 +1,5 @@
1
1
  from swarms.structs.agent import Agent
2
2
  from swarms.structs.agent_builder import AgentsBuilder
3
- from swarms.structs.agents_available import showcase_available_agents
4
3
  from swarms.structs.base_structure import BaseStructure
5
4
  from swarms.structs.base_swarm import BaseSwarm
6
5
  from swarms.structs.base_workflow import BaseWorkflow
@@ -48,7 +47,6 @@ from swarms.structs.multi_agent_exec import (
48
47
  get_swarms_info,
49
48
  )
50
49
  from swarms.structs.multi_agent_router import MultiAgentRouter
51
- from swarms.structs.queue_swarm import TaskQueueSwarm
52
50
  from swarms.structs.rearrange import AgentRearrange, rearrange
53
51
  from swarms.structs.round_robin import RoundRobinSwarm
54
52
  from swarms.structs.sequential_workflow import SequentialWorkflow
@@ -79,6 +77,7 @@ from swarms.structs.swarming_architectures import (
79
77
  staircase_swarm,
80
78
  star_swarm,
81
79
  )
80
+ from swarms.structs.auto_swarm_builder import AutoSwarmBuilder
82
81
 
83
82
  __all__ = [
84
83
  "Agent",
@@ -120,7 +119,6 @@ __all__ = [
120
119
  "sigmoid_swarm",
121
120
  "staircase_swarm",
122
121
  "star_swarm",
123
- "TaskQueueSwarm",
124
122
  "SpreadSheetSwarm",
125
123
  "SwarmRouter",
126
124
  "SwarmType",
@@ -135,7 +133,6 @@ __all__ = [
135
133
  "run_agents_with_resource_monitoring",
136
134
  "swarm_router",
137
135
  "run_agents_with_tasks_concurrently",
138
- "showcase_available_agents",
139
136
  "GroupChat",
140
137
  "expertise_based",
141
138
  "MultiAgentRouter",
@@ -148,4 +145,5 @@ __all__ = [
148
145
  "HybridHierarchicalClusterSwarm",
149
146
  "get_agents_info",
150
147
  "get_swarms_info",
148
+ "AutoSwarmBuilder",
151
149
  ]