|
|
|
@ -175,99 +175,6 @@ swarms heavy-swarm \
|
|
|
|
|
|
|
|
|
|
|
|
---
|
|
|
|
---
|
|
|
|
|
|
|
|
|
|
|
|
## Scripting Examples
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
### Research Pipeline
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
# research_pipeline.sh
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
TOPICS=(
|
|
|
|
|
|
|
|
"AI in manufacturing"
|
|
|
|
|
|
|
|
"Blockchain in supply chain"
|
|
|
|
|
|
|
|
"Edge computing in IoT"
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for topic in "${TOPICS[@]}"; do
|
|
|
|
|
|
|
|
echo "Researching: $topic"
|
|
|
|
|
|
|
|
OUTPUT_FILE="research_$(echo $topic | tr ' ' '_').txt"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
swarms heavy-swarm \
|
|
|
|
|
|
|
|
--task "Comprehensive analysis of $topic: market size, key players, trends, and opportunities" \
|
|
|
|
|
|
|
|
--loops-per-agent 2 \
|
|
|
|
|
|
|
|
--verbose > "$OUTPUT_FILE"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
echo "Saved to: $OUTPUT_FILE"
|
|
|
|
|
|
|
|
done
|
|
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
### Daily Market Analysis
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
# daily_market.sh
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
DATE=$(date +%Y-%m-%d)
|
|
|
|
|
|
|
|
OUTPUT_FILE="market_analysis_$DATE.txt"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
echo "Daily Market Analysis - $DATE" > $OUTPUT_FILE
|
|
|
|
|
|
|
|
echo "==============================" >> $OUTPUT_FILE
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
swarms heavy-swarm \
|
|
|
|
|
|
|
|
--task "Analyze today's key market movements, notable news, and outlook for tomorrow. Focus on tech, healthcare, and energy sectors." \
|
|
|
|
|
|
|
|
--loops-per-agent 2 \
|
|
|
|
|
|
|
|
--question-agent-model-name gpt-4 \
|
|
|
|
|
|
|
|
--worker-model-name gpt-4 \
|
|
|
|
|
|
|
|
--verbose >> $OUTPUT_FILE
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
echo "Analysis complete: $OUTPUT_FILE"
|
|
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
### CI/CD Integration
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
```yaml
|
|
|
|
|
|
|
|
# .github/workflows/heavy-swarm-research.yml
|
|
|
|
|
|
|
|
name: Weekly Heavy Swarm Research
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
on:
|
|
|
|
|
|
|
|
schedule:
|
|
|
|
|
|
|
|
- cron: '0 6 * * 1' # Every Monday at 6 AM
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
|
|
|
|
research:
|
|
|
|
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
steps:
|
|
|
|
|
|
|
|
- uses: actions/checkout@v3
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- name: Set up Python
|
|
|
|
|
|
|
|
uses: actions/setup-python@v4
|
|
|
|
|
|
|
|
with:
|
|
|
|
|
|
|
|
python-version: '3.10'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- name: Install Swarms
|
|
|
|
|
|
|
|
run: pip install swarms
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- name: Run Heavy Swarm Research
|
|
|
|
|
|
|
|
env:
|
|
|
|
|
|
|
|
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
|
|
|
|
|
|
|
|
run: |
|
|
|
|
|
|
|
|
swarms heavy-swarm \
|
|
|
|
|
|
|
|
--task "Weekly technology trends and market analysis report" \
|
|
|
|
|
|
|
|
--loops-per-agent 3 \
|
|
|
|
|
|
|
|
--question-agent-model-name gpt-4 \
|
|
|
|
|
|
|
|
--worker-model-name gpt-4 \
|
|
|
|
|
|
|
|
--verbose > weekly_research.txt
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- name: Upload Results
|
|
|
|
|
|
|
|
uses: actions/upload-artifact@v3
|
|
|
|
|
|
|
|
with:
|
|
|
|
|
|
|
|
name: weekly-research
|
|
|
|
|
|
|
|
path: weekly_research.txt
|
|
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
## Configuration Recommendations
|
|
|
|
## Configuration Recommendations
|
|
|
|
|
|
|
|
|
|
|
|
### Quick Analysis (Cost-Effective)
|
|
|
|
### Quick Analysis (Cost-Effective)
|
|
|
|
@ -311,34 +218,6 @@ swarms heavy-swarm \
|
|
|
|
|
|
|
|
|
|
|
|
---
|
|
|
|
---
|
|
|
|
|
|
|
|
|
|
|
|
## Output Processing
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
### Save to File
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
|
|
|
swarms heavy-swarm --task "Your task" > report.txt 2>&1
|
|
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
### Extract Sections
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
|
|
|
# Get executive summary
|
|
|
|
|
|
|
|
swarms heavy-swarm --task "Your task" | grep -A 50 "Executive Summary"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Get recommendations
|
|
|
|
|
|
|
|
swarms heavy-swarm --task "Your task" | grep -A 20 "Recommendations"
|
|
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
### Timestamp Output
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
|
|
|
swarms heavy-swarm --task "Your task" | while read line; do
|
|
|
|
|
|
|
|
echo "[$(date '+%H:%M:%S')] $line"
|
|
|
|
|
|
|
|
done
|
|
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
## Best Practices
|
|
|
|
## Best Practices
|
|
|
|
|
|
|
|
|
|
|
|
!!! tip "Task Formulation"
|
|
|
|
!!! tip "Task Formulation"
|
|
|
|
|