diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml index e3733b98..4203b99b 100644 --- a/.github/FUNDING.yml +++ b/.github/FUNDING.yml @@ -1,6 +1,4 @@ ---- # These are supported funding model platforms - github: [kyegomez] # patreon: # Replace with a single Patreon username # open_collective: # Replace with a single Open Collective username diff --git a/.github/action.yml b/.github/action.yml index f2f9016c..dd40a722 100644 --- a/.github/action.yml +++ b/.github/action.yml @@ -3,35 +3,30 @@ description: "Initialize environment for tests" runs: using: "composite" steps: - - name: Checkout actions - uses: actions/checkout@v3 - - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.python-version }} - - - name: Install and configure Poetry - uses: snok/install-poetry@v1 - with: - virtualenvs-create: true - virtualenvs-in-project: true - installer-parallel: true - - - name: Load cached venv - id: cached-poetry-dependencies - uses: actions/cache@v3 - with: - path: .venv - key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }} - - - name: Install dependencies - if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' - run: poetry install --no-interaction --no-root --with test --with dev --all-extras - shell: bash - - - name: Activate venv - run: | - source .venv/bin/activate - echo PATH=$PATH >> $GITHUB_ENV - shell: bash \ No newline at end of file + - name: Checkout actions + uses: actions/checkout@v3 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + - name: Install and configure Poetry + uses: snok/install-poetry@v1 + with: + virtualenvs-create: true + virtualenvs-in-project: true + installer-parallel: true + - name: Load cached venv + id: cached-poetry-dependencies + uses: actions/cache@v3 + with: + path: .venv + key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }} + - name: Install dependencies + if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' + run: poetry install --no-interaction --no-root --with test --with dev --all-extras + shell: bash + - name: Activate venv + run: | + source .venv/bin/activate + echo PATH=$PATH >> $GITHUB_ENV + shell: bash diff --git a/.github/dependabot.yml b/.github/dependabot.yml index b523994a..6b10ed04 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,13 +1,10 @@ ---- # https://docs.github.com/en/code-security/supply-chain-security/keeping-your-dependencies-updated-automatically/configuration-options-for-dependency-updates - version: 2 updates: - package-ecosystem: "github-actions" directory: "/" schedule: interval: "weekly" - - package-ecosystem: "pip" directory: "/" schedule: diff --git a/.github/labeler.yml b/.github/labeler.yml index 1fb9d7ec..05bdfe5b 100644 --- a/.github/labeler.yml +++ b/.github/labeler.yml @@ -1,13 +1,10 @@ ---- # this is a config file for the github action labeler # Add 'label1' to any changes within 'example' folder or any subfolders example_change: - example/** - # Add 'label2' to any file changes within 'example2' folder example2_change: example2/* - # Add label3 to any change to .txt files within the entire repository. # Quotation marks are required for the leading asterisk text_files: diff --git a/.github/library/setup/action.yml b/.github/library/setup/action.yml index f3f7dec5..faf529c5 100644 --- a/.github/library/setup/action.yml +++ b/.github/library/setup/action.yml @@ -1,6 +1,5 @@ name: "Setup environment" description: "Setup environment for the CI" - runs: using: composite steps: diff --git a/.github/workflows/RELEASE.yml b/.github/workflows/RELEASE.yml index b219bb77..eb3619b3 100644 --- a/.github/workflows/RELEASE.yml +++ b/.github/workflows/RELEASE.yml @@ -1,5 +1,4 @@ name: release - on: pull_request: types: @@ -8,15 +7,13 @@ on: - master paths: - 'pyproject.toml' - env: POETRY_VERSION: "1.4.2" - jobs: if_release: if: | - ${{ github.event.pull_request.merged == true }} - && ${{ contains(github.event.pull_request.labels.*.name, 'release') }} + ${{ github.event.pull_request.merged == true }} + && ${{ contains(github.event.pull_request.labels.*.name, 'release') }} runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -45,5 +42,5 @@ jobs: - name: Publish to PyPI env: POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_API_TOKEN }} - run: | - poetry publish \ No newline at end of file + run: |- + poetry publish diff --git a/.github/workflows/codacy.yml b/.github/workflows/codacy.yml index 5f58b11d..c04900b8 100644 --- a/.github/workflows/codacy.yml +++ b/.github/workflows/codacy.yml @@ -12,19 +12,16 @@ # https://github.com/codacy/codacy-analysis-cli. name: Codacy Security Scan - on: push: - branches: [ "master" ] + branches: ["master"] pull_request: # The branches below must be a subset of the branches above - branches: [ "master" ] + branches: ["master"] schedule: - cron: '18 23 * * 4' - permissions: contents: read - jobs: codacy-security-scan: permissions: @@ -37,7 +34,6 @@ jobs: # Checkout the repository to the GitHub Actions runner - name: Checkout code uses: actions/checkout@v4 - # Execute Codacy Analysis CLI and generate a SARIF output with the security issues identified during the analysis - name: Run Codacy Analysis CLI uses: codacy/codacy-analysis-cli-action@33d455949345bddfdb845fba76b57b70cc83754b @@ -53,7 +49,6 @@ jobs: # Force 0 exit code to allow SARIF file generation # This will handover control about PR rejection to the GitHub side max-allowed-issues: 2147483647 - # Upload the SARIF file generated in the previous step - name: Upload SARIF results file uses: github/codeql-action/upload-sarif@v3 diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 56930314..f7773c66 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -10,16 +10,14 @@ # supported CodeQL languages. # name: "CodeQL" - on: push: - branches: [ "master" ] + branches: ["master"] pull_request: # The branches below must be a subset of the branches above - branches: [ "master" ] + branches: ["master"] schedule: - cron: '33 12 * * 5' - jobs: analyze: name: Analyze @@ -34,49 +32,42 @@ jobs: actions: read contents: read security-events: write - strategy: fail-fast: false matrix: - language: [ 'python' ] + language: ['python'] # CodeQL supports [ 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'swift' ] # Use only 'java-kotlin' to analyze code written in Java, Kotlin or both # Use only 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both # Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - # Initializes the CodeQL tools for scanning. - - name: Initialize CodeQL - uses: github/codeql-action/init@v3 - with: - languages: ${{ matrix.language }} - # If you wish to specify custom queries, you can do so here or in a config file. - # By default, queries listed here will override any specified in a config file. - # Prefix the list here with "+" to use these queries and those in the config file. - + - name: Checkout repository + uses: actions/checkout@v4 + # Initializes the CodeQL tools for scanning. + - name: Initialize CodeQL + uses: github/codeql-action/init@v3 + with: + languages: ${{ matrix.language }} + # If you wish to specify custom queries, you can do so here or in a config file. + # By default, queries listed here will override any specified in a config file. + # Prefix the list here with "+" to use these queries and those in the config file. + # Autobuild attempts to build any compiled languages (C/C++, C#, Go, Java, or Swift). + # If this step fails, then you should remove it and run the build manually (see below) + - name: Autobuild # For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs # queries: security-extended,security-and-quality + uses: github/codeql-action/autobuild@v3 + # ℹī¸ Command-line programs to run using the OS shell. + # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun - # Autobuild attempts to build any compiled languages (C/C++, C#, Go, Java, or Swift). - # If this step fails, then you should remove it and run the build manually (see below) - - name: Autobuild - uses: github/codeql-action/autobuild@v3 - - # ℹī¸ Command-line programs to run using the OS shell. - # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun - - # If the Autobuild fails above, remove it and uncomment the following three lines. - # modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance. - - # - run: | - # echo "Run, Build Application using script" - # ./location_of_script_within_repo/buildscript.sh + # If the Autobuild fails above, remove it and uncomment the following three lines. + # modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance. - - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v3 - with: - category: "/language:${{matrix.language}}" + # - run: | + # echo "Run, Build Application using script" + # ./location_of_script_within_repo/buildscript.sh + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v3 + with: + category: "/language:${{matrix.language}}" diff --git a/.github/workflows/cron_job_tests.yml b/.github/workflows/cron_job_tests.yml index 60bd98d3..d91c3cb9 100644 --- a/.github/workflows/cron_job_tests.yml +++ b/.github/workflows/cron_job_tests.yml @@ -1,27 +1,22 @@ name: Run pytest - on: schedule: # This will run the job every day at a random minute past the hour - - cron: '0 0 * * *' - + - cron: '0 0 * * *' jobs: test: runs-on: ubuntu-latest steps: - - name: Check out code - uses: actions/checkout@v4 - - - name: Set up Python - uses: actions/setup-python@v4 - with: - python-version: '3.9' - - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install pytest - pip install swarms - - - name: Run tests - run: pytest \ No newline at end of file + - name: Check out code + uses: actions/checkout@v4 + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: '3.9' + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install pytest + pip install swarms + - name: Run tests + run: pytest diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 0b830b9f..321ca45d 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -1,5 +1,4 @@ name: Docs WorkAgent - on: push: branches: @@ -17,4 +16,4 @@ jobs: - run: pip install mkdocs-material - run: pip install mkdocs-glightbox - run: pip install "mkdocstrings[python]" - - run: mkdocs gh-deploy --force \ No newline at end of file + - run: mkdocs gh-deploy --force diff --git a/.github/workflows/label.yml b/.github/workflows/label.yml index d23c4d40..62df9dd3 100644 --- a/.github/workflows/label.yml +++ b/.github/workflows/label.yml @@ -7,16 +7,13 @@ name: Labeler on: [pull_request_target] - jobs: label: - runs-on: ubuntu-latest permissions: contents: read pull-requests: write - steps: - - uses: actions/labeler@v5 - with: - repo-token: "${{ secrets.GITHUB_TOKEN }}" + - uses: actions/labeler@v5 + with: + repo-token: "${{ secrets.GITHUB_TOKEN }}" diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 4658157a..67f7f634 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -1,8 +1,14 @@ name: Lint - on: [push, pull_request] # yamllint disable-line rule:truthy - jobs: + yaml-format: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-go@v5 + - run: go install github.com/google/yamlfmt/cmd/yamlfmt@latest + - run: yamlfmt -w . + # - uses: autofix-ci/action@d3e591514b99d0fca6779455ff8338516663f7cc yaml-lint: runs-on: ubuntu-latest steps: @@ -27,4 +33,4 @@ jobs: - run: pip install ruff - run: ruff format . - run: ruff check --fix . - # - uses: autofix-ci/action@d3e591514b99d0fca6779455ff8338516663f7cc + - uses: autofix-ci/action@d3e591514b99d0fca6779455ff8338516663f7cc diff --git a/.github/workflows/pr_labeler.yml b/.github/workflows/pr_labeler.yml index 7745d717..af914dc8 100644 --- a/.github/workflows/pr_labeler.yml +++ b/.github/workflows/pr_labeler.yml @@ -1,9 +1,7 @@ name: "PR Labeler" - on: pull_request_target: types: ["opened", "reopened", "ready_for_review"] - jobs: triage: permissions: @@ -11,5 +9,5 @@ jobs: pull-requests: write runs-on: ubuntu-latest steps: - - uses: actions/labeler@v5 - if: ${{ github.event.pull_request.draft == false }} \ No newline at end of file + - uses: actions/labeler@v5 + if: ${{ github.event.pull_request.draft == false }} diff --git a/.github/workflows/pr_request_checks.yml b/.github/workflows/pr_request_checks.yml index cfc01afb..34b77de9 100644 --- a/.github/workflows/pr_request_checks.yml +++ b/.github/workflows/pr_request_checks.yml @@ -1,29 +1,20 @@ name: Pull Request Checks - on: pull_request: branches: - master - jobs: test: runs-on: ubuntu-latest - steps: - name: Checkout code uses: actions/checkout@v4 - - name: Set up Python uses: actions/setup-python@v5 with: python-version: 3.x - - name: Install dependencies - run: | - pip install -r requirements.txt - pip install swarms - pip install pytest - + run: "pip install -r requirements.txt\npip install swarms\npip install pytest \n" - name: Run tests and checks run: | pytest diff --git a/.github/workflows/pull-request-links.yml b/.github/workflows/pull-request-links.yml index 4cb674d8..96846d2f 100644 --- a/.github/workflows/pull-request-links.yml +++ b/.github/workflows/pull-request-links.yml @@ -5,14 +5,12 @@ on: - opened paths: - "docs/**" - permissions: pull-requests: write - jobs: pull-request-links: runs-on: ubuntu-latest steps: - uses: readthedocs/actions/preview@v1 with: - project-slug: swarms \ No newline at end of file + project-slug: swarms diff --git a/.github/workflows/pylint.yml b/.github/workflows/pylint.yml index d3f42fb1..c9c7ac2f 100644 --- a/.github/workflows/pylint.yml +++ b/.github/workflows/pylint.yml @@ -1,7 +1,5 @@ name: Pylint - on: [push] - jobs: build: runs-on: ubuntu-latest @@ -9,15 +7,15 @@ jobs: matrix: python-version: ["3.8", "3.9", "3.10"] steps: - - uses: actions/checkout@v4 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v5 - with: - python-version: ${{ matrix.python-version }} - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install pylint - - name: Analysing the code with pylint - run: | - pylint $(git ls-files '*.py') + - uses: actions/checkout@v4 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install pylint + - name: Analysing the code with pylint + run: | + pylint $(git ls-files '*.py') diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index adc0c5ef..5d39cc0f 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -2,38 +2,33 @@ # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python name: Python application - on: push: - branches: [ "master" ] + branches: ["master"] pull_request: - branches: [ "master" ] - + branches: ["master"] permissions: contents: read - jobs: build: - 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" - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install flake8 pytest swarms - if [ -f requirements.txt ]; then pip install -r requirements.txt; fi - - name: Lint with flake8 - run: | - # stop the build if there are Python syntax errors or undefined names - flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics - # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide - flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics - - name: Test with pytest - run: | - pytest + - uses: actions/checkout@v4 + - name: Set up Python 3.10 + uses: actions/setup-python@v5 + with: + python-version: "3.10" + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install flake8 pytest swarms + if [ -f requirements.txt ]; then pip install -r requirements.txt; fi + - name: Lint with flake8 + run: | + # stop the build if there are Python syntax errors or undefined names + flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics + # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide + flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics + - name: Test with pytest + run: | + pytest diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 31cdfb93..b9266b12 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -2,40 +2,36 @@ # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python name: Python package - on: push: - branches: [ "master" ] + branches: ["master"] pull_request: - branches: [ "master" ] - + branches: ["master"] jobs: build: - runs-on: ubuntu-latest strategy: fail-fast: false matrix: python-version: ["3.7", "3.9", "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 }} - - name: Install dependencies - run: | - python -m pip install --upgrade pip - python -m pip install --upgrade swarms - python -m pip install flake8 pytest swarms - if [ -f requirements.txt ]; then pip install -r requirements.txt; fi - - name: Lint with flake8 - run: | - # stop the build if there are Python syntax errors or undefined names - flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics - # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide - flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics - - name: Test with pytest - run: | - pytest \ No newline at end of file + - uses: actions/checkout@v4 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: | + python -m pip install --upgrade pip + python -m pip install --upgrade swarms + python -m pip install flake8 pytest swarms + if [ -f requirements.txt ]; then pip install -r requirements.txt; fi + - name: Lint with flake8 + run: | + # stop the build if there are Python syntax errors or undefined names + flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics + # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide + flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics + - name: Test with pytest + run: |- + pytest diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index e055b770..b6ddeb5f 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -1,17 +1,12 @@ name: Upload Python Package - -on: # yamllint disable-line rule:truthy +on: # yamllint disable-line rule:truthy release: types: [published] - permissions: contents: read - jobs: deploy: - runs-on: ubuntu-latest - steps: - uses: actions/checkout@v4 - name: Set up Python diff --git a/.github/workflows/run_examples.yml b/.github/workflows/run_examples.yml index ea07b0f3..1988948e 100644 --- a/.github/workflows/run_examples.yml +++ b/.github/workflows/run_examples.yml @@ -1,34 +1,28 @@ name: Run Examples Script - on: push: - branches: [ main ] + branches: [main] pull_request: - branches: [ main ] + branches: [main] schedule: # Runs at 3:00 AM UTC every day - cron: '0 3 * * *' - jobs: run-examples: runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - - name: Setup Python - uses: actions/setup-python@v5 - with: - python-version: '3.9' - - - name: Install dependencies - run: | - pip install -r requirements.txt - # Assuming your script might also need pytest and swarms - pip install pytest - pip install swarms - - - name: Make Script Executable and Run - run: | - chmod +x ./swarms/scripts/run_examples.sh - ./swarms/scripts/run_examples.sh \ No newline at end of file + - uses: actions/checkout@v4 + - name: Setup Python + uses: actions/setup-python@v5 + with: + python-version: '3.9' + - name: Install dependencies + run: | + pip install -r requirements.txt + # Assuming your script might also need pytest and swarms + pip install pytest + pip install swarms + - name: Make Script Executable and Run + run: |- + chmod +x ./swarms/scripts/run_examples.sh + ./swarms/scripts/run_examples.sh diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml index 3aa6410b..f43cdfbf 100644 --- a/.github/workflows/stale.yml +++ b/.github/workflows/stale.yml @@ -4,24 +4,20 @@ # For more information, see: # https://github.com/actions/stale name: Mark stale issues and pull requests - on: schedule: - - cron: '26 12 * * *' - + - cron: '26 12 * * *' jobs: stale: - runs-on: ubuntu-latest permissions: issues: write pull-requests: write - steps: - - uses: actions/stale@v9 - with: - repo-token: ${{ secrets.GITHUB_TOKEN }} - stale-issue-message: 'Stale issue message' - stale-pr-message: 'Stale pull request message' - stale-issue-label: 'no-issue-activity' - stale-pr-label: 'no-pr-activity' \ No newline at end of file + - uses: actions/stale@v9 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + stale-issue-message: 'Stale issue message' + stale-pr-message: 'Stale pull request message' + stale-issue-label: 'no-issue-activity' + stale-pr-label: 'no-pr-activity' diff --git a/.github/workflows/stale_issue.yml b/.github/workflows/stale_issue.yml index c5fe2648..9bb11d88 100644 --- a/.github/workflows/stale_issue.yml +++ b/.github/workflows/stale_issue.yml @@ -4,46 +4,41 @@ # For more information, see: # https://github.com/actions/stale name: Mark stale issues and pull requests - on: schedule: - # Scheduled to run at 1.30 UTC everyday - - cron: '30 1 * * *' - + # Scheduled to run at 1.30 UTC everyday + - cron: '30 1 * * *' jobs: stale: - runs-on: ubuntu-latest permissions: issues: write pull-requests: write - steps: - - uses: actions/stale@v9 - with: - repo-token: ${{ secrets.GITHUB_TOKEN }} - days-before-issue-stale: 14 - days-before-issue-close: 14 - stale-issue-label: "status:stale" - close-issue-reason: not_planned - any-of-labels: "status:awaiting user response,status:more data needed" - stale-issue-message: > - Marking this issue as stale since it has been open for 14 days with no activity. - This issue will be closed if no further activity occurs. - close-issue-message: > - This issue was closed because it has been inactive for 28 days. - Please post a new issue if you need further assistance. Thanks! - days-before-pr-stale: 14 - days-before-pr-close: 14 - stale-pr-label: "status:stale" - stale-pr-message: > - Marking this pull request as stale since it has been open for 14 days with no activity. - This PR will be closed if no further activity occurs. - close-pr-message: > - This pull request was closed because it has been inactive for 28 days. - Please open a new pull request if you need further assistance. Thanks! - # Label that can be assigned to issues to exclude them from being marked as stale - exempt-issue-labels: 'override-stale' - # Label that can be assigned to PRs to exclude them from being marked as stale - exempt-pr-labels: "override-stale" - \ No newline at end of file + - uses: actions/stale@v9 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + days-before-issue-stale: 14 + days-before-issue-close: 14 + stale-issue-label: "status:stale" + close-issue-reason: not_planned + any-of-labels: "status:awaiting user response,status:more data needed" + stale-issue-message: > + Marking this issue as stale since it has been open for 14 days with no activity. This issue will be closed if no further activity occurs. + + close-issue-message: > + This issue was closed because it has been inactive for 28 days. Please post a new issue if you need further assistance. Thanks! + + days-before-pr-stale: 14 + days-before-pr-close: 14 + stale-pr-label: "status:stale" + stale-pr-message: > + Marking this pull request as stale since it has been open for 14 days with no activity. This PR will be closed if no further activity occurs. + + close-pr-message: > + This pull request was closed because it has been inactive for 28 days. Please open a new pull request if you need further assistance. Thanks! + + # Label that can be assigned to issues to exclude them from being marked as stale + exempt-issue-labels: 'override-stale' + # Label that can be assigned to PRs to exclude them from being marked as stale + exempt-pr-labels: "override-stale" diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index baaadfc8..09b6c51e 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,14 +1,11 @@ name: test - on: push: branches: [master] pull_request: workflow_dispatch: - env: POETRY_VERSION: "1.4.2" - jobs: test: runs-on: ubuntu-latest @@ -30,14 +27,7 @@ jobs: python-version: ${{ matrix.python-version }} poetry-version: "1.4.2" cache-key: ${{ matrix.test_type }} - install-command: - if [ "${{ matrix.test_type }}" == "core" ]; then - echo "Running core tests, installing dependencies with poetry..." - poetry install - else - echo "Running extended tests, installing dependencies with poetry..." - poetry install -E extended_testing - fi + install-command: if [ "${{ matrix.test_type }}" == "core" ]; then echo "Running core tests, installing dependencies with poetry..." poetry install else echo "Running extended tests, installing dependencies with poetry..." poetry install -E extended_testing fi - name: Run ${{matrix.test_type}} tests run: | if [ "${{ matrix.test_type }}" == "core" ]; then @@ -56,13 +46,13 @@ jobs: poetry-version: "1.4.2" cache-key: ${{ matrix.test_type }} install-command: | - if [ "${{ matrix.test_type }}" == "core" ]; then - echo "Running core tests, installing dependencies with poetry..." - poetry install - else - echo "Running extended tests, installing dependencies with poetry..." - poetry install -E extended_testing - fi + if [ "${{ matrix.test_type }}" == "core" ]; then + echo "Running core tests, installing dependencies with poetry..." + poetry install + else + echo "Running extended tests, installing dependencies with poetry..." + poetry install -E extended_testing + fi - name: Run ${{matrix.test_type}} tests run: | if [ "${{ matrix.test_type }}" == "core" ]; then @@ -93,13 +83,13 @@ jobs: poetry-version: "1.4.2" cache-key: ${{ matrix.test_type }} install-command: | - if [ "${{ matrix.test_type }}" == "core" ]; then - echo "Running core tests, installing dependencies with poetry..." - poetry install - else - echo "Running extended tests, installing dependencies with poetry..." - poetry install -E extended_testing - fi + if [ "${{ matrix.test_type }}" == "core" ]; then + echo "Running core tests, installing dependencies with poetry..." + poetry install + else + echo "Running extended tests, installing dependencies with poetry..." + poetry install -E extended_testing + fi - name: Run ${{matrix.test_type}} tests run: | if [ "${{ matrix.test_type }}" == "core" ]; then @@ -107,4 +97,4 @@ jobs: else make extended_tests fi - shell: bash \ No newline at end of file + shell: bash diff --git a/.github/workflows/test_pr.yml b/.github/workflows/test_pr.yml index 8da3bd0a..56b077b0 100644 --- a/.github/workflows/test_pr.yml +++ b/.github/workflows/test_pr.yml @@ -1,81 +1,79 @@ # Notebook-related checks name: Presubmit checks - on: # Relevant PRs pull_request: paths: - - "swarms/**" - - "tests/**" + - "swarms/**" + - "tests/**" # Allow manual runs workflow_dispatch: - jobs: test3_11: name: Test Py3.11 runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - - uses: actions/setup-python@v5 - with: - python-version: '3.11' - - name: Run tests - run: | - python --version - pip install .[dev] - python -m pytest + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: '3.11' + - name: Run tests + run: | + python --version + pip install .[dev] + python -m pytest test3_10: name: Test Py3.10 runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - - uses: actions/setup-python@v5 - with: - python-version: '3.10' - - name: Run tests - run: | - python --version - pip install -q .[dev] - python -m pytest + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: '3.10' + - name: Run tests + run: | + python --version + pip install -q .[dev] + python -m pytest test3_9: name: Test Py3.9 runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - - uses: actions/setup-python@v5 - with: - python-version: '3.9' - - name: Run tests - run: | - python --version - pip install .[dev] - python -m pytest + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: '3.9' + - name: Run tests + run: | + python --version + pip install .[dev] + python -m pytest pytype3_10: name: pytype 3.10 runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - - uses: actions/setup-python@v5 - with: - python-version: '3.10' - - name: Run pytype - run: | - python --version - pip install .[dev] - pip install -q gspread ipython - pytype + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: '3.10' + - name: Run pytype + run: | + python --version + pip install .[dev] + pip install -q gspread ipython + pytype format: name: Check format with black runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - - uses: actions/setup-python@v5 - with: - python-version: '3.11' - - name: Check format - run: | - python --version - pip install -q . - pip install -q black - black . --check + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: '3.11' + - name: Check format + run: | + python --version + pip install -q . + pip install -q black + black . --check diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index c858b5fe..d4567904 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -1,27 +1,21 @@ name: Unit Tests - on: push: branches: - master - jobs: test: runs-on: ubuntu-latest - steps: - name: Checkout code uses: actions/checkout@v4 - - name: Set up Python uses: actions/setup-python@v5 with: python-version: "3.10" - - name: Install dependencies run: | pip install -r requirements.txt pip install pytest - - name: Run unit tests run: pytest diff --git a/.github/workflows/unit-test.yml b/.github/workflows/unit-test.yml index a858dae4..09b42750 100644 --- a/.github/workflows/unit-test.yml +++ b/.github/workflows/unit-test.yml @@ -1,36 +1,26 @@ name: build - on: push: - branches: [ main ] + branches: [main] pull_request: - branches: [ main ] - + branches: [main] jobs: - build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - - name: Setup Python - uses: actions/setup-python@v5 - with: - python-version: '3.9' - - - name: Install dependencies - run: | - pip install -r requirements.txt - pip install pytest - pip install swarms - - - name: Run Python unit tests - run: pytest - - - name: Verify that the Docker image for the action builds - run: docker build . --file Dockerfile - - - name: Verify integration test results - run: pytest + - uses: actions/checkout@v4 + - name: Setup Python + uses: actions/setup-python@v5 + with: + python-version: '3.9' + - name: Install dependencies + run: | + pip install -r requirements.txt + pip install pytest + pip install swarms + - name: Run Python unit tests + run: pytest + - name: Verify that the Docker image for the action builds + run: docker build . --file Dockerfile + - name: Verify integration test results + run: pytest diff --git a/.github/workflows/welcome.yml b/.github/workflows/welcome.yml index 3dcd5bb1..978cb5b0 100644 --- a/.github/workflows/welcome.yml +++ b/.github/workflows/welcome.yml @@ -1,11 +1,9 @@ name: Welcome WorkAgent - on: issues: types: [opened] pull_request_target: types: [opened] - jobs: build: name: 👋 Welcome @@ -16,4 +14,4 @@ jobs: with: repo-token: ${{ secrets.GITHUB_TOKEN }} issue-message: "Hello there, thank you for opening an Issue ! 🙏đŸģ The team was notified and they will get back to you asap." - pr-message: "Hello there, thank you for opening an PR ! 🙏đŸģ The team was notified and they will get back to you asap." \ No newline at end of file + pr-message: "Hello there, thank you for opening an PR ! 🙏đŸģ The team was notified and they will get back to you asap." diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 0c936705..b7bd5eeb 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -2,17 +2,17 @@ repos: - repo: https://github.com/ambv/black rev: 22.3.0 hooks: - - id: black + - id: black - repo: https://github.com/charliermarsh/ruff-pre-commit rev: 'v0.0.255' hooks: - id: ruff - args: [----unsafe-fixes] + args: ['----unsafe-fixes'] - repo: https://github.com/nbQA-dev/nbQA rev: 1.6.3 hooks: - - id: nbqa-black - additional_dependencies: [ipython==8.12, black] - - id: nbqa-ruff - args: ["--ignore=I001"] - additional_dependencies: [ipython==8.12, ruff] \ No newline at end of file + - id: nbqa-black + additional_dependencies: [ipython==8.12, black] + - id: nbqa-ruff + args: ["--ignore=I001"] + additional_dependencies: [ipython==8.12, ruff] diff --git a/.readthedocs.yml b/.readthedocs.yml index e3e74fad..dc508ab2 100644 --- a/.readthedocs.yml +++ b/.readthedocs.yml @@ -1,13 +1,10 @@ version: 2 - build: os: ubuntu-22.04 tools: python: "3.11" - mkdocs: configuration: mkdocs.yml - python: - install: - - requirements: requirements.txt + install: + - requirements: requirements.txt diff --git a/mkdocs.yml b/mkdocs.yml index 608d306e..fa99710d 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -16,15 +16,15 @@ extra: - icon: fontawesome/brands/python link: https://pypi.org/project/Swarms/ theme: - name: material - custom_dir: docs/overrides - logo: assets/img/SwarmsLogoIcon.png - palette: - # Palette toggle for light mode + name: material + custom_dir: docs/overrides + logo: assets/img/SwarmsLogoIcon.png + palette: + # Palette toggle for light mode - scheme: default primary: black toggle: - icon: material/brightness-7 + icon: material/brightness-7 name: Switch to dark mode # Palette toggle for dark mode - scheme: slate @@ -32,14 +32,14 @@ theme: toggle: icon: material/brightness-4 name: Switch to light mode - features: - - content.code.copy - - content.code.annotate - - navigation.tabs - - navigation.sections - - navigation.expand - - navigation.top - - announce.dismiss + features: + - content.code.copy + - content.code.annotate + - navigation.tabs + - navigation.sections + - navigation.expand + - navigation.top + - announce.dismiss markdown_extensions: - pymdownx.highlight: anchor_linenums: true @@ -55,131 +55,127 @@ markdown_extensions: - def_list - footnotes nav: -- Home: - - Overview: "index.md" - - Contributing: "contributing.md" - - Limitations of Individual Agents: "limits_of_individual_agents.md" - - Why Swarms: "why_swarms.md" - - The Swarms Bounty System: "swarms_bounty_system.md" -- Swarms Cloud API: - - Overview: "swarms_cloud/main.md" - - Migrate from OpenAI to Swarms in 3 lines of code: "swarms_cloud/migrate_openai.md" -- Swarms Framework [PY]: - - Overview: "swarms/index.md" - - DIY Build Your Own Agent: "diy_your_own_agent.md" - - swarms.agents: - - Agents: - - WorkerAgent: "swarms/agents/workeragent.md" - - OmniAgent: "swarms/agents/omni_agent.md" - - AbstractAgent: "swarms/agents/abstractagent.md" - - ToolAgent: "swarms/agents/toolagent.md" - - swarms.models: - - How to Create A Custom Language Model: "swarms/models/custom_model.md" - - Deploying Azure OpenAI in Production: A Comprehensive Guide: "swarms/models/azure_openai.md" - - Language: - - BaseLLM: "swarms/models/base_llm.md" - - Overview: "swarms/models/index.md" - - HuggingFaceLLM: "swarms/models/huggingface.md" - - Anthropic: "swarms/models/anthropic.md" - - OpenAI: "swarms/models/openai.md" - - vLLM: "swarms/models/vllm.md" - - MPT7B: "swarms/models/mpt.md" - - Mistral: "swarms/models/mistral.md" - - Mixtral: "swarms/models/mixtral.md" - - MultiModal: - - BaseMultiModalModel: "swarms/models/base_multimodal_model.md" - - Fuyu: "swarms/models/fuyu.md" - - Vilt: "swarms/models/vilt.md" - - Idefics: "swarms/models/idefics.md" - - Kosmos: "swarms/models/kosmos.md" - - Nougat: "swarms/models/nougat.md" - - Dalle3: "swarms/models/dalle3.md" - - GPT4V: "swarms/models/gpt4v.md" - - DistilWhisperModel: "swarms/models/distilled_whisperx.md" - - swarms.structs: - - Foundational Structures: - - agent: "swarms/structs/agent.md" - - basestructure: "swarms/structs/basestructure.md" - - artifactupload: "swarms/structs/artifactupload.md" - - taskinput: "swarms/structs/taskinput.md" - - stepinput: "swarms/structs/stepinput.md" - - artifact: "swarms/structs/artifact.md" - - task: "swarms/structs/task.md" - - Task Queue Base: "swarms/structs/taskqueuebase.md" - - Workflows: - - recursiveworkflow: "swarms/structs/recursiveworkflow.md" - - concurrentworkflow: "swarms/structs/concurrentworkflow.md" - - nonlinearworkflow: "swarms/structs/nonlinearworkflow.md" - - sequential_workflow: "swarms/structs/sequential_workflow.md" - - workflow: "swarms/structs/workflow.md" - - baseworkflow: "swarms/structs/baseworkflow.md" - - Multi Agent Architectures: - - conversation: "swarms/structs/conversation.md" - - groupchat: "swarms/structs/groupchat.md" - - swarmnetwork: "swarms/structs/swarmnetwork.md" - - groupchatmanager: "swarms/structs/groupchatmanager.md" - - MajorityVoting: "swarms/structs/majorityvoting.md" - - swarms.memory: - - Building Custom Vector Memory Databases with the AbstractVectorDatabase Class: "swarms/memory/diy_memory.md" - - Vector Databases: - - Weaviate: "swarms/memory/weaviate.md" - - PineconeDB: "swarms/memory/pinecone.md" - - PGVectorStore: "swarms/memory/pg.md" - - ShortTermMemory: "swarms/memory/short_term_memory.md" - - swarms.utils: - - Misc: - - pdf_to_text: "swarms/utils/pdf_to_text.md" - - load_model_torch: "swarms/utils/load_model_torch.md" - - metrics_decorator: "swarms/utils/metrics_decorator.md" - - prep_torch_inference: "swarms/utils/prep_torch_inference.md" - - find_image_path: "swarms/utils/find_image_path.md" - - print_class_parameters: "swarms/utils/print_class_parameters.md" - - extract_code_from_markdown: "swarms/utils/extract_code_from_markdown.md" - - check_device: "swarms/utils/check_device.md" - - display_markdown_message: "swarms/utils/display_markdown_message.md" - - phoenix_tracer: "swarms/utils/phoenix_tracer.md" - - limit_tokens_from_string: "swarms/utils/limit_tokens_from_string.md" - - math_eval: "swarms/utils/math_eval.md" -- Guides: - - Building Custom Vector Memory Databases with the AbstractVectorDatabase Class: "swarms/memory/diy_memory.md" - - How to Create A Custom Language Model: "swarms/models/custom_model.md" - - Deploying Azure OpenAI in Production: A Comprehensive Guide: "swarms/models/azure_openai.md" - - DIY Build Your Own Agent: "diy_your_own_agent.md" - - Overview: "examples/index.md" - - Agents: - - Agent: "examples/flow.md" - - OmniAgent: "examples/omni_agent.md" - - Swarms: - - SequentialWorkflow: "examples/reliable_autonomous_agents.md" - - 2O+ Autonomous Agent Blogs: "examples/ideas.md" -- Applications: - - CustomerSupport: - - Overview: "applications/customer_support.md" - - Marketing: - - Overview: "applications/marketing_agencies.md" -- Corporate: - - Corporate Documents: - - Data Room: "corporate/data_room.md" - - SwarmMemo: "corporate/swarm_memo.md" - - Corporate Architecture: "corporate/architecture.md" - - Flywheel: "corporate/flywheel.md" - - Bounties: "corporate/bounties.md" - - Purpose: "corporate/purpose.md" - - Roadmap: "corporate/roadmap.md" - - Sales: - - FAQ: "corporate/faq.md" - - Distribution: "corporate/distribution" - - Product: - - SwarmCloud: "corporate/swarm_cloud.md" - - Weaknesses: "corporate/failures.md" - - Design: "corporate/design.md" - - Metric: "corporate/metric.md" - - Research: "corporate/research.md" - - Demos: "corporate/demos.md" - - Checklist: "corporate/checklist.md" - - - Organization: - - FrontEnd Member Onboarding: "corporate/front_end_contributors.md" - - - \ No newline at end of file + - Home: + - Overview: "index.md" + - Contributing: "contributing.md" + - Limitations of Individual Agents: "limits_of_individual_agents.md" + - Why Swarms: "why_swarms.md" + - The Swarms Bounty System: "swarms_bounty_system.md" + - Swarms Cloud API: + - Overview: "swarms_cloud/main.md" + - Migrate from OpenAI to Swarms in 3 lines of code: "swarms_cloud/migrate_openai.md" + - Swarms Framework [PY]: + - Overview: "swarms/index.md" + - DIY Build Your Own Agent: "diy_your_own_agent.md" + - swarms.agents: + - Agents: + - WorkerAgent: "swarms/agents/workeragent.md" + - OmniAgent: "swarms/agents/omni_agent.md" + - AbstractAgent: "swarms/agents/abstractagent.md" + - ToolAgent: "swarms/agents/toolagent.md" + - swarms.models: + - How to Create A Custom Language Model: "swarms/models/custom_model.md" + - "Deploying Azure OpenAI in Production: A Comprehensive Guide": "swarms/models/azure_openai.md" + - Language: + - BaseLLM: "swarms/models/base_llm.md" + - Overview: "swarms/models/index.md" + - HuggingFaceLLM: "swarms/models/huggingface.md" + - Anthropic: "swarms/models/anthropic.md" + - OpenAI: "swarms/models/openai.md" + - vLLM: "swarms/models/vllm.md" + - MPT7B: "swarms/models/mpt.md" + - Mistral: "swarms/models/mistral.md" + - Mixtral: "swarms/models/mixtral.md" + - MultiModal: + - BaseMultiModalModel: "swarms/models/base_multimodal_model.md" + - Fuyu: "swarms/models/fuyu.md" + - Vilt: "swarms/models/vilt.md" + - Idefics: "swarms/models/idefics.md" + - Kosmos: "swarms/models/kosmos.md" + - Nougat: "swarms/models/nougat.md" + - Dalle3: "swarms/models/dalle3.md" + - GPT4V: "swarms/models/gpt4v.md" + - DistilWhisperModel: "swarms/models/distilled_whisperx.md" + - swarms.structs: + - Foundational Structures: + - agent: "swarms/structs/agent.md" + - basestructure: "swarms/structs/basestructure.md" + - artifactupload: "swarms/structs/artifactupload.md" + - taskinput: "swarms/structs/taskinput.md" + - stepinput: "swarms/structs/stepinput.md" + - artifact: "swarms/structs/artifact.md" + - task: "swarms/structs/task.md" + - Task Queue Base: "swarms/structs/taskqueuebase.md" + - Workflows: + - recursiveworkflow: "swarms/structs/recursiveworkflow.md" + - concurrentworkflow: "swarms/structs/concurrentworkflow.md" + - nonlinearworkflow: "swarms/structs/nonlinearworkflow.md" + - sequential_workflow: "swarms/structs/sequential_workflow.md" + - workflow: "swarms/structs/workflow.md" + - baseworkflow: "swarms/structs/baseworkflow.md" + - Multi Agent Architectures: + - conversation: "swarms/structs/conversation.md" + - groupchat: "swarms/structs/groupchat.md" + - swarmnetwork: "swarms/structs/swarmnetwork.md" + - groupchatmanager: "swarms/structs/groupchatmanager.md" + - MajorityVoting: "swarms/structs/majorityvoting.md" + - swarms.memory: + - Building Custom Vector Memory Databases with the AbstractVectorDatabase Class: "swarms/memory/diy_memory.md" + - Vector Databases: + - Weaviate: "swarms/memory/weaviate.md" + - PineconeDB: "swarms/memory/pinecone.md" + - PGVectorStore: "swarms/memory/pg.md" + - ShortTermMemory: "swarms/memory/short_term_memory.md" + - swarms.utils: + - Misc: + - pdf_to_text: "swarms/utils/pdf_to_text.md" + - load_model_torch: "swarms/utils/load_model_torch.md" + - metrics_decorator: "swarms/utils/metrics_decorator.md" + - prep_torch_inference: "swarms/utils/prep_torch_inference.md" + - find_image_path: "swarms/utils/find_image_path.md" + - print_class_parameters: "swarms/utils/print_class_parameters.md" + - extract_code_from_markdown: "swarms/utils/extract_code_from_markdown.md" + - check_device: "swarms/utils/check_device.md" + - display_markdown_message: "swarms/utils/display_markdown_message.md" + - phoenix_tracer: "swarms/utils/phoenix_tracer.md" + - limit_tokens_from_string: "swarms/utils/limit_tokens_from_string.md" + - math_eval: "swarms/utils/math_eval.md" + - Guides: + - Building Custom Vector Memory Databases with the AbstractVectorDatabase Class: "swarms/memory/diy_memory.md" + - How to Create A Custom Language Model: "swarms/models/custom_model.md" + - "Deploying Azure OpenAI in Production: A Comprehensive Guide": "swarms/models/azure_openai.md" + - DIY Build Your Own Agent: "diy_your_own_agent.md" + - Overview: "examples/index.md" + - Agents: + - Agent: "examples/flow.md" + - OmniAgent: "examples/omni_agent.md" + - Swarms: + - SequentialWorkflow: "examples/reliable_autonomous_agents.md" + - 2O+ Autonomous Agent Blogs: "examples/ideas.md" + - Applications: + - CustomerSupport: + - Overview: "applications/customer_support.md" + - Marketing: + - Overview: "applications/marketing_agencies.md" + - Corporate: + - Corporate Documents: + - Data Room: "corporate/data_room.md" + - SwarmMemo: "corporate/swarm_memo.md" + - Corporate Architecture: "corporate/architecture.md" + - Flywheel: "corporate/flywheel.md" + - Bounties: "corporate/bounties.md" + - Purpose: "corporate/purpose.md" + - Roadmap: "corporate/roadmap.md" + - Sales: + - FAQ: "corporate/faq.md" + - Distribution: "corporate/distribution" + - Product: + - SwarmCloud: "corporate/swarm_cloud.md" + - Weaknesses: "corporate/failures.md" + - Design: "corporate/design.md" + - Metric: "corporate/metric.md" + - Research: "corporate/research.md" + - Demos: "corporate/demos.md" + - Checklist: "corporate/checklist.md" + - Organization: + - FrontEnd Member Onboarding: "corporate/front_end_contributors.md"