├── requirements.txt ├── scripts ├── tests.sh ├── test_name.sh ├── code_quality.sh └── merge_all_prs.sh ├── autort.png ├── agorabanner.png ├── .github ├── workflows │ ├── ruff.yml │ ├── pull-request-links.yml │ ├── docs.yml │ ├── lints.yml │ ├── testing.yml │ ├── run_test.yml │ ├── quality.yml │ ├── pr_request_checks.yml │ ├── label.yml │ ├── docs_test.yml │ ├── pylint.yml │ ├── welcome.yml │ ├── unit-test.yml │ ├── python-publish.yml │ ├── code_quality_control.yml │ ├── stale.yml │ ├── cos_integration.yml │ └── test.yml ├── dependabot.yml ├── labeler.yml ├── ISSUE_TEMPLATE │ ├── feature_request.md │ └── bug_report.md ├── FUNDING.yml └── PULL_REQUEST_TEMPLATE.yml ├── .readthedocs.yml ├── autort ├── __init__.py ├── prompts.py └── main.py ├── .pre-commit-config.yaml ├── example.py ├── LICENSE ├── pyproject.toml ├── README.md ├── errors.txt └── .gitignore /requirements.txt: -------------------------------------------------------------------------------- 1 | torch 2 | zetascale 3 | swarms 4 | -------------------------------------------------------------------------------- /scripts/tests.sh: -------------------------------------------------------------------------------- 1 | find ./tests -name '*.py' -exec pytest {} \; -------------------------------------------------------------------------------- /autort.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kyegomez/AutoRT/HEAD/autort.png -------------------------------------------------------------------------------- /agorabanner.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kyegomez/AutoRT/HEAD/agorabanner.png -------------------------------------------------------------------------------- /.github/workflows/ruff.yml: -------------------------------------------------------------------------------- 1 | name: Ruff 2 | on: [ push, pull_request ] 3 | jobs: 4 | ruff: 5 | runs-on: ubuntu-latest 6 | steps: 7 | - uses: actions/checkout@v4 8 | - uses: chartboost/ruff-action@v1 9 | -------------------------------------------------------------------------------- /.readthedocs.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | 3 | build: 4 | os: ubuntu-22.04 5 | tools: 6 | python: "3.11" 7 | 8 | mkdocs: 9 | configuration: mkdocs.yml 10 | 11 | python: 12 | install: 13 | - requirements: requirements.txt -------------------------------------------------------------------------------- /scripts/test_name.sh: -------------------------------------------------------------------------------- 1 | find ./tests -name "*.py" -type f | while read file 2 | do 3 | filename=$(basename "$file") 4 | dir=$(dirname "$file") 5 | if [[ $filename != test_* ]]; then 6 | mv "$file" "$dir/test_$filename" 7 | fi 8 | done -------------------------------------------------------------------------------- /.github/workflows/pull-request-links.yml: -------------------------------------------------------------------------------- 1 | name: readthedocs/actions 2 | on: 3 | pull_request_target: 4 | types: 5 | - opened 6 | paths: 7 | - "docs/**" 8 | 9 | permissions: 10 | pull-requests: write 11 | 12 | jobs: 13 | pull-request-links: 14 | runs-on: ubuntu-latest 15 | steps: 16 | - uses: readthedocs/actions/preview@v1 17 | with: 18 | project-slug: swarms_torch -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | # https://docs.github.com/en/code-security/supply-chain-security/keeping-your-dependencies-updated-automatically/configuration-options-for-dependency-updates 2 | 3 | version: 2 4 | updates: 5 | - package-ecosystem: "github-actions" 6 | directory: "/" 7 | schedule: 8 | interval: "weekly" 9 | 10 | - package-ecosystem: "pip" 11 | directory: "/" 12 | schedule: 13 | interval: "weekly" 14 | 15 | -------------------------------------------------------------------------------- /.github/labeler.yml: -------------------------------------------------------------------------------- 1 | # this is a config file for the github action labeler 2 | 3 | # Add 'label1' to any changes within 'example' folder or any subfolders 4 | example_change: 5 | - example/** 6 | 7 | # Add 'label2' to any file changes within 'example2' folder 8 | example2_change: example2/* 9 | 10 | # Add label3 to any change to .txt files within the entire repository. Quotation marks are required for the leading asterisk 11 | text_files: 12 | - '**/*.txt' 13 | -------------------------------------------------------------------------------- /autort/__init__.py: -------------------------------------------------------------------------------- 1 | from autort.main import AutoRTAgent, AutoRTSwarm 2 | 3 | from autort.prompts import ( 4 | VISUALIZE_OBJECT_PROMPT, 5 | GENERATE_TASKS_PROMPT, 6 | FUSED_SYSTEM_PROMPT_WITH_SOP, 7 | FILTER_TASKS_SOP_PROMPT, 8 | ) 9 | 10 | __all__ = [ 11 | "AutoRTAgent", 12 | "AutoRTSwarm", 13 | "VISUALIZE_OBJECT_PROMPT", 14 | "GENERATE_TASKS_PROMPT", 15 | "FUSED_SYSTEM_PROMPT_WITH_SOP", 16 | "FILTER_TASKS_SOP_PROMPT", 17 | ] 18 | -------------------------------------------------------------------------------- /.github/workflows/docs.yml: -------------------------------------------------------------------------------- 1 | name: Docs WorkFlow 2 | 3 | on: 4 | push: 5 | branches: 6 | - master 7 | - main 8 | - develop 9 | jobs: 10 | deploy: 11 | runs-on: ubuntu-latest 12 | steps: 13 | - uses: actions/checkout@v4 14 | - uses: actions/setup-python@v5 15 | with: 16 | python-version: 3.x 17 | - run: pip install mkdocs-material 18 | - run: pip install "mkdocstrings[python]" 19 | - run: mkdocs gh-deploy --force -------------------------------------------------------------------------------- /.github/workflows/lints.yml: -------------------------------------------------------------------------------- 1 | name: Linting 2 | 3 | on: 4 | push: 5 | branches: 6 | - master 7 | 8 | jobs: 9 | lint: 10 | runs-on: ubuntu-latest 11 | 12 | steps: 13 | - name: Checkout code 14 | uses: actions/checkout@v4 15 | 16 | - name: Set up Python 17 | uses: actions/setup-python@v5 18 | with: 19 | python-version: 3.x 20 | 21 | - name: Install dependencies 22 | run: pip install -r requirements.txt 23 | 24 | - name: Run linters 25 | run: pylint swarms_torch -------------------------------------------------------------------------------- /.github/workflows/testing.yml: -------------------------------------------------------------------------------- 1 | name: Unit Tests 2 | 3 | on: 4 | push: 5 | branches: 6 | - master 7 | 8 | jobs: 9 | test: 10 | runs-on: ubuntu-latest 11 | 12 | steps: 13 | - name: Checkout code 14 | uses: actions/checkout@v4 15 | 16 | - name: Set up Python 17 | uses: actions/setup-python@v5 18 | with: 19 | python-version: 3.x 20 | 21 | - name: Install dependencies 22 | run: pip install -r requirements.txt 23 | 24 | - name: Run unit tests 25 | run: pytest tests/ -------------------------------------------------------------------------------- /.pre-commit-config.yaml: -------------------------------------------------------------------------------- 1 | repos: 2 | - repo: https://github.com/ambv/black 3 | rev: 22.3.0 4 | hooks: 5 | - id: black 6 | - repo: https://github.com/charliermarsh/ruff-pre-commit 7 | rev: 'v0.0.255' 8 | hooks: 9 | - id: ruff 10 | args: [--fix] 11 | - repo: https://github.com/nbQA-dev/nbQA 12 | rev: 1.6.3 13 | hooks: 14 | - id: nbqa-black 15 | additional_dependencies: [ipython==8.12, black] 16 | - id: nbqa-ruff 17 | args: ["--ignore=I001"] 18 | additional_dependencies: [ipython==8.12, ruff] -------------------------------------------------------------------------------- /.github/workflows/run_test.yml: -------------------------------------------------------------------------------- 1 | name: Python application test 2 | 3 | on: [push] 4 | 5 | jobs: 6 | build: 7 | 8 | runs-on: ubuntu-latest 9 | 10 | steps: 11 | - uses: actions/checkout@v4 12 | - name: Set up Python 3.8 13 | uses: actions/setup-python@v5 14 | with: 15 | python-version: 3.8 16 | - name: Install dependencies 17 | run: | 18 | python -m pip install --upgrade pip 19 | pip install pytest 20 | if [ -f requirements.txt ]; then pip install -r requirements.txt; fi 21 | - name: Run tests with pytest 22 | run: | 23 | pytest tests/ 24 | -------------------------------------------------------------------------------- /.github/workflows/quality.yml: -------------------------------------------------------------------------------- 1 | name: Quality 2 | 3 | on: 4 | push: 5 | branches: [ "main" ] 6 | pull_request: 7 | branches: [ "main" ] 8 | 9 | jobs: 10 | lint: 11 | runs-on: ubuntu-latest 12 | strategy: 13 | fail-fast: false 14 | steps: 15 | - name: Checkout actions 16 | uses: actions/checkout@v4 17 | with: 18 | fetch-depth: 0 19 | - name: Init environment 20 | uses: ./.github/actions/init-environment 21 | - name: Run linter 22 | run: | 23 | pylint `git diff --name-only --diff-filter=d origin/main HEAD | grep -E '\.py$' | tr '\n' ' '` -------------------------------------------------------------------------------- /.github/workflows/pr_request_checks.yml: -------------------------------------------------------------------------------- 1 | name: Pull Request Checks 2 | 3 | on: 4 | pull_request: 5 | branches: 6 | - master 7 | 8 | jobs: 9 | test: 10 | runs-on: ubuntu-latest 11 | 12 | steps: 13 | - name: Checkout code 14 | uses: actions/checkout@v4 15 | 16 | - name: Set up Python 17 | uses: actions/setup-python@v5 18 | with: 19 | python-version: 3.x 20 | 21 | - name: Install dependencies 22 | run: pip install -r requirements.txt 23 | 24 | - name: Run tests and checks 25 | run: | 26 | pytest tests/ 27 | pylint swarms_torch -------------------------------------------------------------------------------- /.github/workflows/label.yml: -------------------------------------------------------------------------------- 1 | # This workflow will triage pull requests and apply a label based on the 2 | # paths that are modified in the pull request. 3 | # 4 | # To use this workflow, you will need to set up a .github/labeler.yml 5 | # file with configuration. For more information, see: 6 | # https://github.com/actions/labeler 7 | 8 | name: Labeler 9 | on: [pull_request_target] 10 | 11 | jobs: 12 | label: 13 | 14 | runs-on: ubuntu-latest 15 | permissions: 16 | contents: read 17 | pull-requests: write 18 | 19 | steps: 20 | - uses: actions/labeler@v5.0.0 21 | with: 22 | repo-token: "${{ secrets.GITHUB_TOKEN }}" 23 | -------------------------------------------------------------------------------- /.github/workflows/docs_test.yml: -------------------------------------------------------------------------------- 1 | name: Documentation Tests 2 | 3 | on: 4 | push: 5 | branches: 6 | - master 7 | 8 | jobs: 9 | test: 10 | runs-on: ubuntu-latest 11 | 12 | steps: 13 | - name: Checkout code 14 | uses: actions/checkout@v4 15 | 16 | - name: Set up Python 17 | uses: actions/setup-python@v5 18 | with: 19 | python-version: 3.x 20 | 21 | - name: Install dependencies 22 | run: pip install -r requirements.txt 23 | 24 | - name: Build documentation 25 | run: make docs 26 | 27 | - name: Validate documentation 28 | run: sphinx-build -b linkcheck docs build/docs -------------------------------------------------------------------------------- /.github/workflows/pylint.yml: -------------------------------------------------------------------------------- 1 | name: Pylint 2 | 3 | on: [push] 4 | 5 | jobs: 6 | build: 7 | runs-on: ubuntu-latest 8 | strategy: 9 | matrix: 10 | python-version: ["3.8", "3.9", "3.10"] 11 | steps: 12 | - uses: actions/checkout@v4 13 | - name: Set up Python ${{ matrix.python-version }} 14 | uses: actions/setup-python@v5 15 | with: 16 | python-version: ${{ matrix.python-version }} 17 | - name: Install dependencies 18 | run: | 19 | python -m pip install --upgrade pip 20 | pip install pylint 21 | - name: Analysing the code with pylint 22 | run: | 23 | pylint $(git ls-files '*.py') 24 | -------------------------------------------------------------------------------- /.github/workflows/welcome.yml: -------------------------------------------------------------------------------- 1 | name: Welcome WorkFlow 2 | 3 | on: 4 | issues: 5 | types: [opened] 6 | pull_request_target: 7 | types: [opened] 8 | 9 | jobs: 10 | build: 11 | name: 👋 Welcome 12 | permissions: write-all 13 | runs-on: ubuntu-latest 14 | steps: 15 | - uses: actions/first-interaction@v1.3.0 16 | with: 17 | repo-token: ${{ secrets.GITHUB_TOKEN }} 18 | issue-message: "Hello there, thank you for opening an Issue ! 🙏🏻 The team was notified and they will get back to you asap." 19 | pr-message: "Hello there, thank you for opening an PR ! 🙏🏻 The team was notified and they will get back to you asap." -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this project 4 | title: '' 5 | labels: '' 6 | assignees: 'kyegomez' 7 | 8 | --- 9 | 10 | **Is your feature request related to a problem? Please describe.** 11 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] 12 | 13 | **Describe the solution you'd like** 14 | A clear and concise description of what you want to happen. 15 | 16 | **Describe alternatives you've considered** 17 | A clear and concise description of any alternative solutions or features you've considered. 18 | 19 | **Additional context** 20 | Add any other context or screenshots about the feature request here. 21 | -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | 3 | github: [kyegomez] 4 | patreon: # Replace with a single Patreon username 5 | open_collective: # Replace with a single Open Collective username 6 | ko_fi: # Replace with a single Ko-fi username 7 | tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel 8 | community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry 9 | liberapay: # Replace with a single Liberapay username 10 | issuehunt: # Replace with a single IssueHunt username 11 | otechie: # Replace with a single Otechie username 12 | lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry 13 | custom: #Nothing 14 | -------------------------------------------------------------------------------- /.github/workflows/unit-test.yml: -------------------------------------------------------------------------------- 1 | name: build 2 | 3 | on: 4 | push: 5 | branches: [ main ] 6 | pull_request: 7 | branches: [ main ] 8 | 9 | jobs: 10 | 11 | build: 12 | 13 | runs-on: ubuntu-latest 14 | 15 | steps: 16 | - uses: actions/checkout@v4 17 | 18 | - name: Setup Python 19 | uses: actions/setup-python@v5 20 | with: 21 | python-version: '3.10' 22 | 23 | - name: Install dependencies 24 | run: pip install -r requirements.txt 25 | 26 | - name: Run Python unit tests 27 | run: python3 -m unittest tests/ 28 | 29 | - name: Verify that the Docker image for the action builds 30 | run: docker build . --file Dockerfile 31 | 32 | - name: Verify integration test results 33 | run: python3 -m unittest tests/ 34 | -------------------------------------------------------------------------------- /.github/workflows/python-publish.yml: -------------------------------------------------------------------------------- 1 | 2 | name: Upload Python Package 3 | 4 | on: 5 | release: 6 | types: [published] 7 | 8 | permissions: 9 | contents: read 10 | 11 | jobs: 12 | deploy: 13 | 14 | runs-on: ubuntu-latest 15 | 16 | steps: 17 | - uses: actions/checkout@v4 18 | - name: Set up Python 19 | uses: actions/setup-python@v5 20 | with: 21 | python-version: '3.x' 22 | - name: Install dependencies 23 | run: | 24 | python -m pip install --upgrade pip 25 | pip install build 26 | - name: Build package 27 | run: python -m build 28 | - name: Publish package 29 | uses: pypa/gh-action-pypi-publish@2f6f737ca5f74c637829c0f5c3acd0e29ea5e8bf 30 | with: 31 | user: __token__ 32 | password: ${{ secrets.PYPI_API_TOKEN }} -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a detailed report on the bug and it's root cause. Conduct root cause error analysis 4 | title: "[BUG] " 5 | labels: bug 6 | assignees: kyegomez 7 | 8 | --- 9 | 10 | **Describe the bug** 11 | A clear and concise description of what the bug is and what the main root cause error is. Test very thoroughly before submitting. 12 | 13 | **To Reproduce** 14 | Steps to reproduce the behavior: 15 | 1. Go to '...' 16 | 2. Click on '....' 17 | 3. Scroll down to '....' 18 | 4. See error 19 | 20 | **Expected behavior** 21 | A clear and concise description of what you expected to happen. 22 | 23 | **Screenshots** 24 | If applicable, add screenshots to help explain your problem. 25 | 26 | **Additional context** 27 | Add any other context about the problem here. 28 | -------------------------------------------------------------------------------- /.github/workflows/code_quality_control.yml: -------------------------------------------------------------------------------- 1 | name: Linting and Formatting 2 | 3 | on: 4 | push: 5 | branches: 6 | - main 7 | 8 | jobs: 9 | lint_and_format: 10 | runs-on: ubuntu-latest 11 | 12 | steps: 13 | - name: Checkout code 14 | uses: actions/checkout@v4 15 | 16 | - name: Set up Python 17 | uses: actions/setup-python@v5 18 | with: 19 | python-version: 3.x 20 | 21 | - name: Install dependencies 22 | run: pip install -r requirements.txt 23 | 24 | - name: Find Python files 25 | run: find swarms_torch -name "*.py" -type f -exec autopep8 --in-place --aggressive --aggressive {} + 26 | 27 | - name: Push changes 28 | uses: ad-m/github-push-action@master 29 | with: 30 | github_token: ${{ secrets.GITHUB_TOKEN }} -------------------------------------------------------------------------------- /.github/workflows/stale.yml: -------------------------------------------------------------------------------- 1 | # This workflow warns and then closes issues and PRs that have had no activity for a specified amount of time. 2 | # 3 | # You can adjust the behavior by modifying this file. 4 | # For more information, see: 5 | # https://github.com/actions/stale 6 | name: Mark stale issues and pull requests 7 | 8 | on: 9 | schedule: 10 | - cron: '26 12 * * *' 11 | 12 | jobs: 13 | stale: 14 | 15 | runs-on: ubuntu-latest 16 | permissions: 17 | issues: write 18 | pull-requests: write 19 | 20 | steps: 21 | - uses: actions/stale@v9 22 | with: 23 | repo-token: ${{ secrets.GITHUB_TOKEN }} 24 | stale-issue-message: 'Stale issue message' 25 | stale-pr-message: 'Stale pull request message' 26 | stale-issue-label: 'no-issue-activity' 27 | stale-pr-label: 'no-pr-activity' -------------------------------------------------------------------------------- /scripts/code_quality.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Navigate to the directory containing the 'package' folder 4 | # cd /path/to/your/code/directory 5 | 6 | # Run autopep8 with max aggressiveness (-aaa) and in-place modification (-i) 7 | # on all Python files (*.py) under the 'package' directory. 8 | autopep8 --in-place --aggressive --aggressive --recursive --experimental --list-fixes package/ 9 | 10 | # Run black with default settings, since black does not have an aggressiveness level. 11 | # Black will format all Python files it finds in the 'package' directory. 12 | black --experimental-string-processing package/ 13 | 14 | # Run ruff on the 'package' directory. 15 | # Add any additional flags if needed according to your version of ruff. 16 | ruff --unsafe_fix 17 | 18 | # YAPF 19 | yapf --recursive --in-place --verbose --style=google --parallel package 20 | -------------------------------------------------------------------------------- /example.py: -------------------------------------------------------------------------------- 1 | # Import necessary modules 2 | import os 3 | from autort import AutoRTSwarm, AutoRTAgent 4 | 5 | # Set the OpenAI API key 6 | openai_api_key = os.getenv("OPENAI_API_KEY") 7 | 8 | # Define a list of AutoRTAgent instances 9 | agents = [ 10 | AutoRTAgent(openai_api_key, max_tokens=1000), 11 | AutoRTAgent(openai_api_key, max_tokens=1000), 12 | ] 13 | 14 | # Create an instance of AutoRTSwarm with the agents and datastore 15 | autort_swarm = AutoRTSwarm(agents=agents) 16 | 17 | # Run the AutoRTSwarm with the given inputs 18 | autort_swarm.run( 19 | "There is a bottle on the table.", 20 | "https://i.imgur.com/2qY9f8U.png", 21 | ) 22 | 23 | 24 | # Run a single agent in the swarm 25 | run_agent = autort_swarm.run_single_agent( 26 | autort_swarm.agents[0].id, 27 | ( 28 | "Pick up the bottle and place it on the shelf." 29 | "https://i.imgur.com/2qY9f8U.png" 30 | ), 31 | ) 32 | -------------------------------------------------------------------------------- /scripts/merge_all_prs.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Check if we are inside a Git repository 4 | if ! git rev-parse --git-dir > /dev/null 2>&1; then 5 | echo "Error: Must be run inside a Git repository." 6 | exit 1 7 | fi 8 | 9 | # Fetch all open pull requests 10 | echo "Fetching open PRs..." 11 | prs=$(gh pr list --state open --json number --jq '.[].number') 12 | 13 | # Check if there are PRs to merge 14 | if [ -z "$prs" ]; then 15 | echo "No open PRs to merge." 16 | exit 0 17 | fi 18 | 19 | echo "Found PRs: $prs" 20 | 21 | # Loop through each pull request number and merge it 22 | for pr in $prs; do 23 | echo "Attempting to merge PR #$pr" 24 | merge_output=$(gh pr merge $pr --auto --merge) 25 | merge_status=$? 26 | if [ $merge_status -ne 0 ]; then 27 | echo "Failed to merge PR #$pr. Error: $merge_output" 28 | else 29 | echo "Successfully merged PR #$pr" 30 | fi 31 | done 32 | 33 | echo "Processing complete." 34 | -------------------------------------------------------------------------------- /.github/workflows/cos_integration.yml: -------------------------------------------------------------------------------- 1 | name: Continuous Integration 2 | 3 | on: 4 | push: 5 | branches: 6 | - main 7 | 8 | jobs: 9 | test: 10 | runs-on: ubuntu-latest 11 | steps: 12 | - name: Checkout code 13 | uses: actions/checkout@v4 14 | 15 | - name: Set up Python 16 | uses: actions/setup-python@v5 17 | with: 18 | python-version: 3.x 19 | 20 | - name: Install dependencies 21 | run: pip install -r requirements.txt 22 | 23 | - name: Run unit tests 24 | run: pytest tests/unit 25 | 26 | - name: Run integration tests 27 | run: pytest tests/integration 28 | 29 | - name: Run code coverage 30 | run: pytest --cov=swarms tests/ 31 | 32 | - name: Run linters 33 | run: pylint swarms 34 | 35 | - name: Build documentation 36 | run: make docs 37 | 38 | - name: Validate documentation 39 | run: sphinx-build -b linkcheck docs build/docs 40 | 41 | - name: Run performance tests 42 | run: pytest tests/performance -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.yml: -------------------------------------------------------------------------------- 1 |