mirror of
https://github.com/microsoft/autogen.git
synced 2026-02-13 15:05:23 -05:00
* Update chat_with_teachable_agent.py to v2. * Update agentchat_teachability.ipynb to v2. * Add test of teachability accuracy. * Update installation instructions. * Add to contrib tests. * pre-commit fixes * Apply reviewer suggestions to test workflows.
139 lines
4.9 KiB
YAML
139 lines
4.9 KiB
YAML
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
|
|
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
|
|
|
|
name: ContribTests
|
|
|
|
on:
|
|
pull_request:
|
|
branches: ['main', 'dev/v0.2']
|
|
paths:
|
|
- 'autogen/**'
|
|
- 'test/agentchat/contrib/**'
|
|
- '.github/workflows/contrib-tests.yml'
|
|
- 'setup.py'
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.head_ref }}
|
|
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
|
|
|
|
jobs:
|
|
RetrieveChatTest:
|
|
runs-on: ${{ matrix.os }}
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
os: [ubuntu-latest, macos-latest, windows-2019]
|
|
python-version: ["3.8", "3.9", "3.10", "3.11"]
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
- name: Set up Python ${{ matrix.python-version }}
|
|
uses: actions/setup-python@v4
|
|
with:
|
|
python-version: ${{ matrix.python-version }}
|
|
- name: Install packages and dependencies for all tests
|
|
run: |
|
|
python -m pip install --upgrade pip wheel
|
|
pip install pytest
|
|
- name: Install qdrant_client when python-version is 3.8 and 3.10
|
|
if: matrix.python-version == '3.8' || matrix.python-version == '3.10'
|
|
run: |
|
|
pip install qdrant_client[fastembed]
|
|
- name: Install unstructured when python-version is 3.9 and 3.11 and not windows
|
|
if: (matrix.python-version == '3.9' || matrix.python-version == '3.11') && matrix.os != 'windows-2019'
|
|
run: |
|
|
pip install unstructured[all-docs]
|
|
- name: Install packages and dependencies for RetrieveChat
|
|
run: |
|
|
pip install -e .[retrievechat]
|
|
pip uninstall -y openai
|
|
- name: Test RetrieveChat
|
|
run: |
|
|
pytest test/test_retrieve_utils.py test/agentchat/contrib/test_retrievechat.py test/agentchat/contrib/test_qdrant_retrievechat.py
|
|
- name: Coverage
|
|
if: matrix.python-version == '3.10'
|
|
run: |
|
|
pip install coverage>=5.3
|
|
coverage run -a -m pytest test/test_retrieve_utils.py test/agentchat/contrib
|
|
coverage xml
|
|
- name: Upload coverage to Codecov
|
|
if: matrix.python-version == '3.10'
|
|
uses: codecov/codecov-action@v3
|
|
with:
|
|
file: ./coverage.xml
|
|
flags: unittests
|
|
CompressionTest:
|
|
runs-on: ${{ matrix.os }}
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
os: [ubuntu-latest, macos-latest, windows-2019]
|
|
python-version: ["3.8", "3.9", "3.10", "3.11"]
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
- name: Set up Python ${{ matrix.python-version }}
|
|
uses: actions/setup-python@v4
|
|
with:
|
|
python-version: ${{ matrix.python-version }}
|
|
- name: Install packages and dependencies for all tests
|
|
run: |
|
|
python -m pip install --upgrade pip wheel
|
|
pip install pytest
|
|
- name: Install packages and dependencies for Compression
|
|
run: |
|
|
pip install -e .
|
|
pip uninstall -y openai
|
|
- name: Test Compression
|
|
if: matrix.python-version != '3.10'
|
|
run: |
|
|
pytest test/agentchat/contrib/test_compressible_agent.py
|
|
|
|
GPTAssistantAgent:
|
|
runs-on: ${{ matrix.os }}
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
os: [ubuntu-latest, macos-latest, windows-2019]
|
|
python-version: ["3.8", "3.9", "3.10", "3.11"]
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
- name: Set up Python ${{ matrix.python-version }}
|
|
uses: actions/setup-python@v4
|
|
with:
|
|
python-version: ${{ matrix.python-version }}
|
|
- name: Install packages and dependencies for all tests
|
|
run: |
|
|
python -m pip install --upgrade pip wheel
|
|
pip install pytest
|
|
- name: Install packages and dependencies for GPTAssistantAgent
|
|
run: |
|
|
pip install -e .
|
|
pip uninstall -y openai
|
|
- name: Test GPTAssistantAgent
|
|
run: |
|
|
pytest test/agentchat/contrib/test_gpt_assistant.py
|
|
|
|
TeachableAgent:
|
|
runs-on: ${{ matrix.os }}
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
os: [ubuntu-latest, macos-latest, windows-2019]
|
|
python-version: ["3.8", "3.9", "3.10", "3.11"]
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
- name: Set up Python ${{ matrix.python-version }}
|
|
uses: actions/setup-python@v4
|
|
with:
|
|
python-version: ${{ matrix.python-version }}
|
|
- name: Install packages and dependencies for all tests
|
|
run: |
|
|
python -m pip install --upgrade pip wheel
|
|
pip install pytest
|
|
- name: Install packages and dependencies for TeachableAgent
|
|
run: |
|
|
pip install -e .[teachable]
|
|
pip uninstall -y openai
|
|
- name: Test TeachableAgent
|
|
run: |
|
|
pytest test/agentchat/contrib/test_teachable_agent.py
|