mirror of
https://github.com/microsoft/autogen.git
synced 2026-02-14 15:25:34 -05:00
* adds image generation capability * add todo * readded cache * wip * fix content str bugs * removed todo: delete imshow * wip * fix circular imports * add notebook * improve prompt * improved text analyzer + notebook * notebook update * improve notebook * smaller notebook size * made changes to the wrong branch :( * resolve comments + 1 * adds doc strings * adds cache doc string * adds doc string to add_to_agent * adds doc string to ImageGeneration * instructions are not configurable * removed unnecessary imports * changed doc string location * more doc strings * improves testability * adds tests * adds cache test * added test to github workflow * compatible llm config format * configurable reply function position * skip_openai + better comments * fix test * fix test? * please fix test? * last fix test? * remove type hint * skip cache test * adds mock api key * dalle-2 test * fix dalle config * use apu key function --------- Co-authored-by: Chi Wang <wang.chi@microsoft.com>
294 lines
9.9 KiB
YAML
294 lines
9.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"]
|
|
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' }}
|
|
permissions:
|
|
{}
|
|
# actions: read
|
|
# checks: read
|
|
# contents: read
|
|
# deployments: read
|
|
jobs:
|
|
RetrieveChatTest:
|
|
runs-on: ${{ matrix.os }}
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
os: [ubuntu-latest, macos-latest, windows-2019]
|
|
python-version: ["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.10
|
|
if: matrix.python-version == '3.10'
|
|
run: |
|
|
pip install qdrant_client[fastembed]
|
|
- name: Install unstructured when python-version is 3.9 and not windows
|
|
if: matrix.python-version == '3.9' && matrix.os != 'windows-2019'
|
|
run: |
|
|
pip install unstructured[all-docs]
|
|
- name: Install packages and dependencies for RetrieveChat
|
|
run: |
|
|
pip install -e .[retrievechat]
|
|
- name: Set AUTOGEN_USE_DOCKER based on OS
|
|
shell: bash
|
|
run: |
|
|
if [[ ${{ matrix.os }} != ubuntu-latest ]]; then
|
|
echo "AUTOGEN_USE_DOCKER=False" >> $GITHUB_ENV
|
|
fi
|
|
- name: Test RetrieveChat
|
|
run: |
|
|
pytest test/test_retrieve_utils.py test/agentchat/contrib/test_retrievechat.py test/agentchat/contrib/test_qdrant_retrievechat.py --skip-openai
|
|
- name: Coverage
|
|
run: |
|
|
pip install coverage>=5.3
|
|
coverage run -a -m pytest test/test_retrieve_utils.py test/agentchat/contrib/test_retrievechat.py test/agentchat/contrib/test_qdrant_retrievechat.py --skip-openai
|
|
coverage xml
|
|
- name: Upload coverage to Codecov
|
|
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"]
|
|
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 .
|
|
- name: Set AUTOGEN_USE_DOCKER based on OS
|
|
shell: bash
|
|
run: |
|
|
if [[ ${{ matrix.os }} != ubuntu-latest ]]; then
|
|
echo "AUTOGEN_USE_DOCKER=False" >> $GITHUB_ENV
|
|
fi
|
|
- name: Coverage
|
|
run: |
|
|
pip install coverage>=5.3
|
|
coverage run -a -m pytest test/agentchat/contrib/test_compressible_agent.py --skip-openai
|
|
coverage xml
|
|
- name: Upload coverage to Codecov
|
|
uses: codecov/codecov-action@v3
|
|
with:
|
|
file: ./coverage.xml
|
|
flags: unittests
|
|
|
|
GPTAssistantAgent:
|
|
runs-on: ${{ matrix.os }}
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
os: [ubuntu-latest, macos-latest, windows-2019]
|
|
python-version: ["3.10"]
|
|
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 .
|
|
- name: Set AUTOGEN_USE_DOCKER based on OS
|
|
shell: bash
|
|
run: |
|
|
if [[ ${{ matrix.os }} != ubuntu-latest ]]; then
|
|
echo "AUTOGEN_USE_DOCKER=False" >> $GITHUB_ENV
|
|
fi
|
|
- name: Coverage
|
|
run: |
|
|
pip install coverage>=5.3
|
|
coverage run -a -m pytest test/agentchat/contrib/test_gpt_assistant.py --skip-openai
|
|
coverage xml
|
|
- name: Upload coverage to Codecov
|
|
uses: codecov/codecov-action@v3
|
|
with:
|
|
file: ./coverage.xml
|
|
flags: unittests
|
|
|
|
TeachableAgent:
|
|
runs-on: ${{ matrix.os }}
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
os: [ubuntu-latest, macos-latest, windows-2019]
|
|
python-version: ["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 Teachability
|
|
run: |
|
|
pip install -e .[teachable]
|
|
- name: Set AUTOGEN_USE_DOCKER based on OS
|
|
shell: bash
|
|
run: |
|
|
if [[ ${{ matrix.os }} != ubuntu-latest ]]; then
|
|
echo "AUTOGEN_USE_DOCKER=False" >> $GITHUB_ENV
|
|
fi
|
|
- name: Coverage
|
|
run: |
|
|
pip install coverage>=5.3
|
|
coverage run -a -m pytest test/agentchat/contrib/capabilities/test_teachable_agent.py --skip-openai
|
|
coverage xml
|
|
- name: Upload coverage to Codecov
|
|
uses: codecov/codecov-action@v3
|
|
with:
|
|
file: ./coverage.xml
|
|
flags: unittests
|
|
|
|
WebSurfer:
|
|
runs-on: ${{ matrix.os }}
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
os: [ubuntu-latest, macos-latest, windows-2019]
|
|
python-version: ["3.12"]
|
|
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 WebSurfer
|
|
run: |
|
|
pip install -e .[websurfer]
|
|
- name: Set AUTOGEN_USE_DOCKER based on OS
|
|
shell: bash
|
|
run: |
|
|
if [[ ${{ matrix.os }} != ubuntu-latest ]]; then
|
|
echo "AUTOGEN_USE_DOCKER=False" >> $GITHUB_ENV
|
|
fi
|
|
- name: Coverage
|
|
run: |
|
|
pip install coverage>=5.3
|
|
coverage run -a -m pytest test/test_browser_utils.py test/agentchat/contrib/test_web_surfer.py --skip-openai
|
|
coverage xml
|
|
- name: Upload coverage to Codecov
|
|
uses: codecov/codecov-action@v3
|
|
with:
|
|
file: ./coverage.xml
|
|
flags: unittests
|
|
|
|
LMMTest:
|
|
runs-on: ${{ matrix.os }}
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
os: [ubuntu-latest, macos-latest, windows-2019]
|
|
python-version: ["3.12"]
|
|
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 LMM
|
|
run: |
|
|
pip install -e .[lmm]
|
|
- name: Set AUTOGEN_USE_DOCKER based on OS
|
|
shell: bash
|
|
run: |
|
|
if [[ ${{ matrix.os }} != ubuntu-latest ]]; then
|
|
echo "AUTOGEN_USE_DOCKER=False" >> $GITHUB_ENV
|
|
fi
|
|
- name: Coverage
|
|
run: |
|
|
pip install coverage>=5.3
|
|
coverage run -a -m pytest test/agentchat/contrib/test_img_utils.py test/agentchat/contrib/test_lmm.py test/agentchat/contrib/test_llava.py test/agentchat/contrib/capabilities/test_image_generation_capability.py --skip-openai
|
|
coverage xml
|
|
- name: Upload coverage to Codecov
|
|
uses: codecov/codecov-action@v3
|
|
with:
|
|
file: ./coverage.xml
|
|
flags: unittests
|
|
|
|
ContextHandling:
|
|
runs-on: ${{ matrix.os }}
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
os: [ubuntu-latest, macos-latest, windows-2019]
|
|
python-version: ["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 Context Handling
|
|
run: |
|
|
pip install -e .
|
|
- name: Set AUTOGEN_USE_DOCKER based on OS
|
|
shell: bash
|
|
run: |
|
|
if [[ ${{ matrix.os }} != ubuntu-latest ]]; then
|
|
echo "AUTOGEN_USE_DOCKER=False" >> $GITHUB_ENV
|
|
fi
|
|
- name: Coverage
|
|
run: |
|
|
pip install coverage>=5.3
|
|
coverage run -a -m pytest test/agentchat/contrib/capabilities/test_context_handling.py --skip-openai
|
|
coverage xml
|
|
- name: Upload coverage to Codecov
|
|
uses: codecov/codecov-action@v3
|
|
with:
|
|
file: ./coverage.xml
|
|
flags: unittests
|