Skip to content

Commit

Permalink
chore: enhance project structure and clean up files fr fr 🧹
Browse files Browse the repository at this point in the history
- Added .pre-commit-config.yaml for improved code quality checks with pre-commit hooks
- Updated .gitignore to include .envrc for better environment management
- Cleaned up whitespace and formatting in various files for consistency
- Added initial test files for SwarmFactory and Swarm classes to improve test coverage

no cap, just leveling up the project vibes fr fr
  • Loading branch information
UltraInstinct0x committed Jan 7, 2025
1 parent def4d55 commit 97ebcb4
Show file tree
Hide file tree
Showing 18 changed files with 181 additions and 47 deletions.
6 changes: 3 additions & 3 deletions .backups/openhands.yml.bak
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ jobs:
develop:
if: github.event.label.name == 'ai-dev'
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Run OpenHands
uses: all-hands-ai/[email protected]
with:
Expand All @@ -20,4 +20,4 @@ jobs:
# Optional settings:
# max_cost: 10 # Maximum cost in USD
# max_time: 3600 # Maximum runtime in seconds
# log_level: debug # Verbosity of logs
# log_level: debug # Verbosity of logs
18 changes: 9 additions & 9 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ body:
attributes:
value: |
Thanks for reporting this bug! Let's get this fixed faster than a speedrunner finds glitches 🏃‍♂️
- type: textarea
id: bug-description
attributes:
Expand All @@ -16,7 +16,7 @@ body:
placeholder: "The agent swarm is doing something more cursed than expected..."
validations:
required: true

- type: textarea
id: reproduction
attributes:
Expand All @@ -28,7 +28,7 @@ body:
3. Watch everything go wrong when...
validations:
required: true

- type: textarea
id: expected
attributes:
Expand All @@ -37,7 +37,7 @@ body:
placeholder: "The agents should've..."
validations:
required: true

- type: textarea
id: actual
attributes:
Expand All @@ -46,7 +46,7 @@ body:
placeholder: "Instead, the agents..."
validations:
required: true

- type: input
id: version
attributes:
Expand All @@ -55,7 +55,7 @@ body:
placeholder: "0.1.0"
validations:
required: true

- type: textarea
id: environment
attributes:
Expand All @@ -70,14 +70,14 @@ body:
```
validations:
required: true

- type: textarea
id: logs
attributes:
label: 📝 Relevant Logs
description: Drop any error logs or outputs that might help (they'll be automatically formatted)
render: python

- type: checkboxes
id: terms
attributes:
Expand All @@ -89,4 +89,4 @@ body:
- label: I added enough context for @openhands-agent to debug the issue
required: true
- label: I've included all relevant code and error messages
required: true
required: true
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ contact_links:
about: For general questions and discussions about smolswarms
- name: 📚 Documentation
url: https://docs.smolswarms.ai
about: Check out our documentation first
about: Check out our documentation first
12 changes: 6 additions & 6 deletions .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ body:
attributes:
value: |
Thanks for dropping this feature request fr fr! Let's make SmolSwarms more cracked than ever 🔥
- type: textarea
id: feature-description
attributes:
Expand All @@ -16,7 +16,7 @@ body:
placeholder: "I want SmolSwarms to be able to..."
validations:
required: true

- type: textarea
id: proposed-solution
attributes:
Expand All @@ -25,7 +25,7 @@ body:
placeholder: "We could..."
validations:
required: true

- type: textarea
id: code-example
attributes:
Expand All @@ -34,15 +34,15 @@ body:
render: python
placeholder: |
from smolswarms import SwarmFactory
# Your absolutely cracked example here
swarm = SwarmFactory().spawn_hivemind(
vibe_check=True,
power_level="over9000"
)
validations:
required: false

- type: dropdown
id: priority
attributes:
Expand All @@ -65,4 +65,4 @@ body:
- label: I checked existing issues to avoid dropping duplicate requests
required: true
- label: I added enough context for @openhands-agent to understand the vibe
required: true
required: true
2 changes: 1 addition & 1 deletion .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,4 @@
- **Confidence Score**: <!-- AI's confidence in the solution -->

## 🤝 Additional Notes
<!--- Add any other context about the PR here -->
<!--- Add any other context about the PR here -->
22 changes: 11 additions & 11 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,24 +27,24 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: "🐍 Set up Python 3.10"
uses: actions/setup-python@v5
with:
python-version: "3.10"
cache: pip

- name: "📦 Install dependencies"
run: |
python -m pip install --upgrade pip
pip install -e .[dev]
- name: "✨ Vibe check with ruff"
run: ruff check .

- name: "🎨 Format check with black"
run: black . --check

- name: "🔍 Type check with mypy"
run: mypy smolswarms/

Expand All @@ -56,26 +56,26 @@ jobs:
fail-fast: false
matrix:
python-version: ["3.10", "3.11"]

steps:
- uses: actions/checkout@v4

- name: "🐍 Set up Python ${{ matrix.python-version }}"
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: pip

- name: "📦 Install dependencies"
run: |
python -m pip install --upgrade pip
pip install -e .[dev]
- name: "🧪 Run tests"
run: pytest --cov=smolswarms --cov-report=xml

- name: "📊 Upload coverage"
uses: codecov/codecov-action@v3
with:
file: ./coverage.xml
fail_ci_if_error: true
fail_ci_if_error: true
6 changes: 3 additions & 3 deletions .github/workflows/openhands-resolver.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@ jobs:
if: |
(github.event_name == 'issues' && github.event.label.name == 'fix-me') ||
(contains(github.event.comment.body, '@openhands-agent'))
steps:
- uses: actions/checkout@v4

- name: OpenHands Magic ✨
uses: all-hands-ai/openhands-resolver@latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
LLM_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
LLM_MODEL: ${{ vars.LLM_MODEL || 'anthropic/claude-3-5-sonnet-20241022' }}
GITHUB_USERNAME: ${{ secrets.PAT_USERNAME }}
PAT_TOKEN: ${{ secrets.PAT_TOKEN }}
PAT_TOKEN: ${{ secrets.PAT_TOKEN }}
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,4 @@ coverage.xml
# Misc
.DS_Store
.env
.envrc
.envrc
2 changes: 1 addition & 1 deletion .openhands_instructions
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ You are a based AI agent responsible for helping develop SmolSwarms - a framewor
- Explain complex parts like you're making a YouTube tutorial
- Keep it real but professional

Remember: We're building a framework that's supposed to make agent development go brr while keeping it more stable than a Redstone computer!
Remember: We're building a framework that's supposed to make agent development go brr while keeping it more stable than a Redstone computer!
32 changes: 32 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-toml
- id: check-added-large-files

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.8.6
hooks:
- id: ruff
args: [--fix]
- id: ruff-format

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.9.0
hooks:
- id: mypy
additional_dependencies: [pydantic, types-PyYAML]
args: [--ignore-missing-imports]

- repo: local
hooks:
- id: pytest
name: pytest
entry: pytest
language: system
pass_filenames: false
always_run: true
10 changes: 5 additions & 5 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Before diving in deeper than a speedrunner looking for glitches, here's what you
# Create a venv (isolation more important than a Minecraft bedrock wall)
python -m venv venv
source venv/bin/activate # or .\venv\Scripts\activate on Windows

# Install dependencies (with that developer DLC)
pip install -e .[dev]
```
Expand All @@ -45,7 +45,7 @@ Before diving in deeper than a speedrunner looking for glitches, here's what you
```bash
# Run the whole test suite
pytest

# Check coverage (gotta hit that 100% fr fr)
pytest --cov=smolswarms
```
Expand All @@ -54,10 +54,10 @@ Before diving in deeper than a speedrunner looking for glitches, here's what you
```bash
# Format your code (make it cleaner than a fresh install)
black .

# Run the linter (find bugs before they find you)
ruff check .

# Type check (because dynamic typing is too yolo)
mypy smolswarms/
```
Expand Down Expand Up @@ -111,4 +111,4 @@ Got questions? Need help? We're more active than a Twitch chat during a world re

Remember: there are no stupid questions, only cursed implementations 😤

Stay based! 🚀
Stay based! 🚀
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
SOFTWARE.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# 🌊 smolswarms

> Because why spawn one AI when you can spawn them all?
> Because why spawn one AI when you can spawn them all?
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![Python 3.10+](https://img.shields.io/badge/python-3.10+-blue.svg)](https://www.python.org/downloads/release/python-3100/)
Expand Down Expand Up @@ -126,7 +126,7 @@ Need help fixing bugs or implementing features? Just tag `@openhands-agent` in y
Hey @openhands-agent, this feature be acting more cursed than a Python script with mixed tabs and spaces. Help a dev out?
```

The agent will analyze your issue and try to fix it faster than a speedrunner finding a new glitch!
The agent will analyze your issue and try to fix it faster than a speedrunner finding a new glitch!

## ⚠️ Safety Notice

Expand All @@ -135,4 +135,4 @@ While smolswarms is designed to be more autonomous than a Tesla on autopilot, re
- Keep API costs under control (no infinite token glitch)
- Monitor agent behavior (they do be learning fr fr)

Need help or got questions? Drop an issue or hit us up - we're more responsive than a Discord mod during a raid! 🎮
Need help or got questions? Drop an issue or hit us up - we're more responsive than a Discord mod during a raid! 🎮
2 changes: 1 addition & 1 deletion docs/system_prompt.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ This prompt makes your AI assistant go absolutely bonkers with tool utilization,
- Always start with sequential thinking (it's like setting up your combo chain)
- Keep your knowledge graph updated (your quest log needs to stay current)
- Use git checkpoints religiously (because you ain't trying to lose progress)
- Automate everything that moves (if it happens twice, it needs a macro)
- Automate everything that moves (if it happens twice, it needs a macro)
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ dev = [
"black>=23.0.0",
"ruff>=0.5.0",
"mypy>=1.0.0",
"pre-commit>=3.6.0",
]

[tool.black]
Expand Down Expand Up @@ -54,4 +55,4 @@ strict_optional = true
allow-direct-references = true

[tool.hatch.dependencies]
smolagents = { git = "https://github.com/UltraInstinct0x/smolagents.git" }
smolagents = { git = "https://github.com/UltraInstinct0x/smolagents.git" }
1 change: 1 addition & 0 deletions tests/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"""Test package for smolswarms."""
Loading

0 comments on commit 97ebcb4

Please sign in to comment.