Skip to content

Commit e839dc5

Browse files
authored
Merge branch 'master' into mvstream
2 parents 7f33161 + c5c7693 commit e839dc5

117 files changed

Lines changed: 10575 additions & 13099 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 150 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,150 @@
1+
name: Test Main Features
2+
3+
on:
4+
push:
5+
paths:
6+
- 'tests/test_main_features.py'
7+
- 'swarms/**'
8+
- 'requirements.txt'
9+
- 'pyproject.toml'
10+
branches: [ "master" ]
11+
pull_request:
12+
paths:
13+
- 'tests/test_main_features.py'
14+
- 'swarms/**'
15+
- 'requirements.txt'
16+
- 'pyproject.toml'
17+
branches: [ "master" ]
18+
workflow_dispatch: # Allow manual triggering
19+
20+
jobs:
21+
test-main-features:
22+
runs-on: ubuntu-latest
23+
timeout-minutes: 30
24+
25+
steps:
26+
- name: Checkout code
27+
uses: actions/checkout@v5
28+
29+
- name: Set up Python 3.10
30+
uses: actions/setup-python@v6
31+
with:
32+
python-version: "3.10"
33+
34+
- name: Cache pip dependencies
35+
uses: actions/cache@v4
36+
with:
37+
path: ~/.cache/pip
38+
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
39+
restore-keys: |
40+
${{ runner.os }}-pip-
41+
42+
- name: Install Poetry
43+
run: |
44+
curl -sSL https://install.python-poetry.org | python3 -
45+
echo "$HOME/.local/bin" >> $GITHUB_PATH
46+
47+
- name: Configure Poetry
48+
run: |
49+
poetry config virtualenvs.create true
50+
poetry config virtualenvs.in-project true
51+
52+
- name: Install dependencies
53+
run: |
54+
poetry install --with test --no-dev
55+
56+
- name: Set up environment variables
57+
run: |
58+
echo "OPENAI_API_KEY=${{ secrets.OPENAI_API_KEY }}" >> $GITHUB_ENV
59+
echo "ANTHROPIC_API_KEY=${{ secrets.ANTHROPIC_API_KEY }}" >> $GITHUB_ENV
60+
echo "GOOGLE_API_KEY=${{ secrets.GOOGLE_API_KEY }}" >> $GITHUB_ENV
61+
echo "COHERE_API_KEY=${{ secrets.COHERE_API_KEY }}" >> $GITHUB_ENV
62+
echo "HUGGINGFACE_API_KEY=${{ secrets.HUGGINGFACE_API_KEY }}" >> $GITHUB_ENV
63+
echo "REPLICATE_API_KEY=${{ secrets.REPLICATE_API_KEY }}" >> $GITHUB_ENV
64+
echo "TOGETHER_API_KEY=${{ secrets.TOGETHER_API_KEY }}" >> $GITHUB_ENV
65+
66+
- name: Run Main Features Tests
67+
run: |
68+
cd /Users/swarms_wd/Desktop/research/swarms
69+
poetry run python tests/test_main_features.py
70+
71+
- name: Upload test results
72+
uses: actions/upload-artifact@v4
73+
if: always()
74+
with:
75+
name: test-results
76+
path: test_runs/
77+
retention-days: 7
78+
79+
- name: Comment on PR with test results
80+
if: github.event_name == 'pull_request' && always()
81+
uses: actions/github-script@v7
82+
with:
83+
script: |
84+
const fs = require('fs');
85+
const path = require('path');
86+
87+
try {
88+
// Look for test result files
89+
const testRunsDir = 'test_runs';
90+
if (fs.existsSync(testRunsDir)) {
91+
const files = fs.readdirSync(testRunsDir);
92+
const latestReport = files
93+
.filter(f => f.endsWith('.md'))
94+
.sort()
95+
.pop();
96+
97+
if (latestReport) {
98+
const reportPath = path.join(testRunsDir, latestReport);
99+
const reportContent = fs.readFileSync(reportPath, 'utf8');
100+
101+
// Extract summary from markdown
102+
const summaryMatch = reportContent.match(/## Summary\n\n(.*?)\n\n## Detailed Results/s);
103+
const summary = summaryMatch ? summaryMatch[1] : 'Test results available in artifacts';
104+
105+
github.rest.issues.createComment({
106+
issue_number: context.issue.number,
107+
owner: context.repo.owner,
108+
repo: context.repo.repo,
109+
body: `## Main Features Test Results\n\n${summary}\n\n📊 Full test report available in artifacts.`
110+
});
111+
}
112+
}
113+
} catch (error) {
114+
console.log('Could not read test results:', error.message);
115+
}
116+
117+
test-coverage:
118+
runs-on: ubuntu-latest
119+
if: github.event_name == 'pull_request'
120+
needs: test-main-features
121+
122+
steps:
123+
- name: Checkout code
124+
uses: actions/checkout@v5
125+
126+
- name: Set up Python 3.10
127+
uses: actions/setup-python@v6
128+
with:
129+
python-version: "3.10"
130+
131+
- name: Install Poetry
132+
run: |
133+
curl -sSL https://install.python-poetry.org | python3 -
134+
echo "$HOME/.local/bin" >> $GITHUB_PATH
135+
136+
- name: Install dependencies
137+
run: |
138+
poetry install --with test
139+
140+
- name: Run coverage analysis
141+
run: |
142+
poetry run pytest tests/test_main_features.py --cov=swarms --cov-report=xml --cov-report=html
143+
144+
- name: Upload coverage to Codecov
145+
uses: codecov/codecov-action@v4
146+
with:
147+
file: ./coverage.xml
148+
flags: main-features
149+
name: main-features-coverage
150+
fail_ci_if_error: false

agent_mcp.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
from swarms import Agent
2+
from swarms.prompts.finance_agent_sys_prompt import (
3+
FINANCIAL_AGENT_SYS_PROMPT,
4+
)
5+
6+
agent = Agent(
7+
agent_name="Financial-Analysis-Agent", # Name of the agent
8+
agent_description="Personal finance advisor agent", # Description of the agent's role
9+
system_prompt=FINANCIAL_AGENT_SYS_PROMPT, # System prompt for financial tasks
10+
max_loops=1,
11+
mcp_urls=[
12+
"http://0.0.0.0:5932/mcp",
13+
],
14+
model_name="gpt-4o-mini",
15+
output_type="all",
16+
)
17+
18+
out = agent.run(
19+
"Use the discover agent tools to find what agents are available and provide a summary"
20+
)
21+
22+
# Print the output from the agent's run method.
23+
print(out)

docs/examples/index.md

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -242,12 +242,20 @@ This index organizes **100+ production-ready examples** from our [Swarms Example
242242
| Business | [Business Strategy](https://github.com/The-Swarm-Corporation/swarms-examples/blob/main/examples/applications/business_strategy/business_strategy_graph/growth_agent.py) | Strategic planning and business development swarm |
243243
| Research | [Astronomy Research](https://github.com/The-Swarm-Corporation/swarms-examples/blob/main/examples/applications/astronomy/multiversal_detection/test.py) | Collaborative space research and astronomical analysis |
244244

245-
## Additional Resources
246245

247-
- [Github](https://github.com/kyegomez/swarms)
246+
-------
248247

249-
- Discord (https://t.co/zlLe07AqUX)
248+
## Connect With Us
250249

251-
- Telegram (https://t.co/dSRy143zQv)
250+
Join our community of agent engineers and researchers for technical support, cutting-edge updates, and exclusive access to world-class agent engineering insights!
252251

253-
- X Community (https://x.com/i/communities/1875452887414804745)
252+
| Platform | Description | Link |
253+
|----------|-------------|------|
254+
| 📚 Documentation | Official documentation and guides | [docs.swarms.world](https://docs.swarms.world) |
255+
| 📝 Blog | Latest updates and technical articles | [Medium](https://medium.com/@kyeg) |
256+
| 💬 Discord | Live chat and community support | [Join Discord](https://discord.gg/EamjgSaEQf) |
257+
| 🐦 Twitter | Latest news and announcements | [@swarms_corp](https://twitter.com/swarms_corp) |
258+
| 👥 LinkedIn | Professional network and updates | [The Swarm Corporation](https://www.linkedin.com/company/the-swarm-corporation) |
259+
| 📺 YouTube | Tutorials and demos | [Swarms Channel](https://www.youtube.com/channel/UC9yXyitkbU_WSy7bd_41SqQ) |
260+
| 🎫 Events | Join our community events | [Sign up here](https://lu.ma/5p2jnc2v) |
261+
| 🚀 Onboarding Session | Get onboarded with Kye Gomez, creator and lead maintainer of Swarms | [Book Session](https://cal.com/swarms/swarms-onboarding-session) |

docs/examples/templates.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ The Swarms framework is a powerful multi-agent orchestration platform that enabl
8686
| [Marketing-Swarm-Template](https://github.com/The-Swarm-Corporation/Marketing-Swarm-Template) | Marketing campaign automation template | Marketing Automation | Business |
8787
| [Multi-Agent-Marketing-Course](https://github.com/The-Swarm-Corporation/Multi-Agent-Marketing-Course) | Educational course on multi-agent marketing | Marketing Education | Business |
8888
| [NewsAgent](https://github.com/The-Swarm-Corporation/NewsAgent) | News aggregation and analysis agent | News Analysis | Business |
89+
|[Product-Marketing-Agency](https://github.com/The-Swarm-Corporation/Product-Marketing-Agency) | Product marketing content generation | Product Marketing | Business |
8990

9091
### Legal Services
9192

docs/llm.txt

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6853,10 +6853,10 @@ pip3 install -U swarms
68536853
| Quickstart | [Get Started](https://docs.swarms.world/en/latest/swarms/install/quickstart/) |
68546854
| Environment Setup | [Environment Configuration](https://docs.swarms.world/en/latest/swarms/install/workspace_manager/) |
68556855
| Environment Variables | [Environment Variables](https://docs.swarms.world/en/latest/swarms/install/env/) |
6856-
| Swarms CLI | [CLI Documentation](https://docs.swarms.world/en/latest/swarms/cli/main/) |
6856+
| Swarms CLI | [CLI Documentation](https://docs.swarms.world/en/latest/swarms/cli/cli_reference/) |
68576857
| Agent Internal Mechanisms | [Agent Architecture](https://docs.swarms.world/en/latest/swarms/framework/agents_explained/) |
68586858
| Agent API | [Agent API](https://docs.swarms.world/en/latest/swarms/structs/agent/) |
6859-
| Managing Prompts in Production | [Prompts Management](https://docs.swarms.world/en/latest/swarms/prompts/main/) |
6859+
| Managing Prompts in Production | [Prompts Management](https://github.com/kyegomez/swarms/tree/master/swarms/prompts/) |
68606860
| Integrating External Agents | [External Agents Integration](https://docs.swarms.world/en/latest/swarms/agents/external_party_agents/) |
68616861
| Creating Agents from YAML | [YAML Agent Creation](https://docs.swarms.world/en/latest/swarms/agents/create_agents_yaml/) |
68626862
| Why You Need Swarms | [Why MultiAgent Collaboration](https://docs.swarms.world/en/latest/swarms/concept/why/) |
@@ -6991,15 +6991,15 @@ The Swarms protocol is organized into several key layers, each responsible for a
69916991
agents and swarms.
69926992

69936993
- **Prompts (`swarms/prompts`)**: Houses prompt templates, system prompts, and agent-specific prompts for LLM-based agents. See
6994-
[Prompts Management](https://docs.swarms.world/en/latest/swarms/prompts/main/)
6994+
[Prompts Management](https://github.com/kyegomez/swarms/tree/master/swarms/prompts/)
69956995

69966996
- **Telemetry (`swarms/telemetry`)**: Handles logging, monitoring, and bootup routines for observability and debugging.
69976997

69986998
- **Schemas (`swarms/schemas`)**: Defines data schemas for agents, tools, completions, and communication protocols, ensuring type
69996999
safety and consistency.
70007000

70017001
- **CLI (`swarms/cli`)**: Provides command-line utilities for agent creation, management, and orchestration. See [CLI Documentation]
7002-
(https://docs.swarms.world/en/latest/swarms/cli/main/)
7002+
(https://docs.swarms.world/en/latest/swarms/cli/cli_reference/)
70037003

70047004
---
70057005

@@ -7218,7 +7218,7 @@ diy_memory/)
72187218

72197219
- `prompt.py`, `reasoning_prompt.py`, `multi_agent_collab_prompt.py`, etc.
72207220

7221-
- [Prompts Management](https://docs.swarms.world/en/latest/swarms/prompts/main/)
7221+
- [Prompts Management](https://github.com/kyegomez/swarms/tree/master/swarms/prompts/)
72227222

72237223

72247224
### `artifacts/`
@@ -7265,7 +7265,7 @@ diy_memory/)
72657265

72667266
- `main.py`, `create_agent.py`, `onboarding_process.py`.
72677267

7268-
- [CLI Documentation](https://docs.swarms.world/en/latest/swarms/cli/main/)
7268+
- [CLI Documentation](https://docs.swarms.world/en/latest/swarms/cli/cli_reference/)
72697269

72707270

72717271
---
@@ -7287,7 +7287,7 @@ For example, a typical workflow might involve:
72877287
- Logging all actions and outputs for traceability and debugging.
72887288

72897289

7290-
For more advanced examples, see the [Examples Overview](https://docs.swarms.world/en/latest/examples/index/).
7290+
For more advanced examples, see the [Examples Overview](https://docs.swarms.world/en/latest/examples/).
72917291

72927292
---
72937293

@@ -7321,9 +7321,9 @@ For more on the philosophy and architecture, see [Development Philosophy & Princ
73217321
| BaseTool Reference | [BaseTool Reference](https://docs.swarms.world/en/latest/swarms/tools/base_tool/) | Reference for the BaseTool class |
73227322
| Reasoning Agents Overview | [Reasoning Agents Overview](https://docs.swarms.world/en/latest/swarms/agents/reasoning_agents_overview/) | Overview of reasoning agents |
73237323
| Multi-Agent Architectures Overview | [Multi-Agent Architectures Overview](https://docs.swarms.world/en/latest/swarms/concept/swarm_architectures/) | Multi-agent system architectures |
7324-
| Examples Overview | [Examples Overview](https://docs.swarms.world/en/latest/examples/index/) | Example projects and use cases |
7325-
| CLI Documentation | [CLI Documentation](https://docs.swarms.world/en/latest/swarms/cli/main/) | Command-line interface documentation |
7326-
| Prompts Management | [Prompts Management](https://docs.swarms.world/en/latest/swarms/prompts/main/) | Managing and customizing prompts |
7324+
| Examples Overview | [Examples Overview](https://docs.swarms.world/en/latest/examples/) | Example projects and use cases |
7325+
| CLI Documentation | [CLI Documentation](https://docs.swarms.world/en/latest/swarms/cli/cli_reference/) | Command-line interface documentation |
7326+
| Prompts Management | [Prompts Management](https://github.com/kyegomez/swarms/tree/master/swarms/prompts/) | Managing and customizing prompts |
73277327
| Development Philosophy & Principles | [Development Philosophy & Principles](https://docs.swarms.world/en/latest/swarms/concept/philosophy/) | Framework philosophy and guiding principles |
73287328
| Understanding Swarms Architecture | [Understanding Swarms Architecture](https://docs.swarms.world/en/latest/swarms/concept/framework_architecture/) | In-depth look at Swarms architecture |
73297329
| SIP Guidelines and Template | [SIP Guidelines and Template](https://docs.swarms.world/en/latest/protocol/sip/) | Swarms Improvement Proposal process and template |

docs/protocol/overview.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -85,15 +85,15 @@ The Swarms protocol is organized into several key layers, each responsible for a
8585
agents and swarms.
8686

8787
- **Prompts (`swarms/prompts`)**: Houses prompt templates, system prompts, and agent-specific prompts for LLM-based agents. See
88-
[Prompts Management](https://docs.swarms.world/en/latest/swarms/prompts/main/)
88+
[Prompts Management](https://github.com/kyegomez/swarms/tree/master/swarms/prompts/)
8989

9090
- **Telemetry (`swarms/telemetry`)**: Handles logging, monitoring, and bootup routines for observability and debugging.
9191

9292
- **Schemas (`swarms/schemas`)**: Defines data schemas for agents, tools, completions, and communication protocols, ensuring type
9393
safety and consistency.
9494

9595
- **CLI (`swarms/cli`)**: Provides command-line utilities for agent creation, management, and orchestration. See [CLI Documentation]
96-
(https://docs.swarms.world/en/latest/swarms/cli/main/)
96+
(https://docs.swarms.world/en/latest/swarms/cli/cli_reference/)
9797

9898
---
9999

@@ -312,7 +312,7 @@ diy_memory/)
312312

313313
- `prompt.py`, `reasoning_prompt.py`, `multi_agent_collab_prompt.py`, etc.
314314

315-
- [Prompts Management](https://docs.swarms.world/en/latest/swarms/prompts/main/)
315+
- [Prompts Management](https://github.com/kyegomez/swarms/tree/master/swarms/prompts/)
316316

317317

318318
### `artifacts/`
@@ -359,7 +359,7 @@ diy_memory/)
359359

360360
- `main.py`, `create_agent.py`, `onboarding_process.py`.
361361

362-
- [CLI Documentation](https://docs.swarms.world/en/latest/swarms/cli/main/)
362+
- [CLI Documentation](https://docs.swarms.world/en/latest/swarms/cli/cli_reference/)
363363

364364

365365
---
@@ -381,7 +381,7 @@ For example, a typical workflow might involve:
381381
- Logging all actions and outputs for traceability and debugging.
382382

383383

384-
For more advanced examples, see the [Examples Overview](https://docs.swarms.world/en/latest/examples/index/).
384+
For more advanced examples, see the [Examples Overview](https://docs.swarms.world/en/latest/examples/).
385385

386386
---
387387

@@ -415,9 +415,9 @@ For more on the philosophy and architecture, see [Development Philosophy & Princ
415415
| BaseTool Reference | [BaseTool Reference](https://docs.swarms.world/en/latest/swarms/tools/base_tool/) | Reference for the BaseTool class |
416416
| Reasoning Agents Overview | [Reasoning Agents Overview](https://docs.swarms.world/en/latest/swarms/agents/reasoning_agents_overview/) | Overview of reasoning agents |
417417
| Multi-Agent Architectures Overview | [Multi-Agent Architectures Overview](https://docs.swarms.world/en/latest/swarms/concept/swarm_architectures/) | Multi-agent system architectures |
418-
| Examples Overview | [Examples Overview](https://docs.swarms.world/en/latest/examples/index/) | Example projects and use cases |
419-
| CLI Documentation | [CLI Documentation](https://docs.swarms.world/en/latest/swarms/cli/main/) | Command-line interface documentation |
420-
| Prompts Management | [Prompts Management](https://docs.swarms.world/en/latest/swarms/prompts/main/) | Managing and customizing prompts |
418+
| Examples Overview | [Examples Overview](https://docs.swarms.world/en/latest/examples/) | Example projects and use cases |
419+
| CLI Documentation | [CLI Documentation](https://docs.swarms.world/en/latest/swarms/cli/cli_reference/) | Command-line interface documentation |
420+
| Prompts Management | [Prompts Management](https://github.com/kyegomez/swarms/tree/master/swarms/prompts/) | Managing and customizing prompts |
421421
| Development Philosophy & Principles | [Development Philosophy & Principles](https://docs.swarms.world/en/latest/swarms/concept/philosophy/) | Framework philosophy and guiding principles |
422422
| Understanding Swarms Architecture | [Understanding Swarms Architecture](https://docs.swarms.world/en/latest/swarms/concept/framework_architecture/) | In-depth look at Swarms architecture |
423423
| SIP Guidelines and Template | [SIP Guidelines and Template](https://docs.swarms.world/en/latest/protocol/sip/) | Swarms Improvement Proposal process and template |

0 commit comments

Comments
 (0)