mirror of
https://github.com/microsoft/autogen.git
synced 2026-02-18 06:21:24 -05:00
* first pass at offline agent eval integration * Integrating AgentEval for offline scenarios * removing old changes * fixing notebook, updating docs * fixing subcriteria bug * updating class comment * cleaning up agent constructors * moving AgentEval agents to separate folder and adding a brief README * fixing build breaks * fixing formatting break * fixing comments * consolidating files in the agenteval folder under contrib and cleaning up imports * fixing import ordering * adding basic agenteval tests and fixing criteria parsing bug * first try at adding openai agenteval tests to build process * adding non-openai agenteval tests to build process * updating test settings * updating openai test * Update test/agentchat/contrib/agent_eval/test_agent_eval.py Co-authored-by: Wael Karkoub <wael.karkoub96@gmail.com> * Update .github/workflows/contrib-openai.yml Co-authored-by: Wael Karkoub <wael.karkoub96@gmail.com> * test commit * updating typing and converting to pydantic objects * fixing test file --------- Co-authored-by: Beibin Li <BeibinLi@users.noreply.github.com> Co-authored-by: Chi Wang <wang.chi@microsoft.com> Co-authored-by: Wael Karkoub <wael.karkoub96@gmail.com>
419 lines
14 KiB
YAML
419 lines
14 KiB
YAML
# This workflow will install Python dependencies and run tests
|
|
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
|
|
|
|
name: OpenAI4ContribTests
|
|
|
|
on:
|
|
pull_request:
|
|
branches: ["main"]
|
|
paths:
|
|
- "autogen/**"
|
|
- "test/agentchat/contrib/**"
|
|
- ".github/workflows/contrib-openai.yml"
|
|
- "setup.py"
|
|
permissions:
|
|
{}
|
|
# actions: read
|
|
# checks: read
|
|
# contents: read
|
|
# deployments: read
|
|
jobs:
|
|
RetrieveChatTest:
|
|
strategy:
|
|
matrix:
|
|
os: [ubuntu-latest]
|
|
python-version: ["3.10"]
|
|
runs-on: ${{ matrix.os }}
|
|
environment: openai1
|
|
services:
|
|
pgvector:
|
|
image: ankane/pgvector
|
|
env:
|
|
POSTGRES_DB: postgres
|
|
POSTGRES_USER: postgres
|
|
POSTGRES_PASSWORD: ${{ secrets.POSTGRES_PASSWORD }}
|
|
POSTGRES_HOST_AUTH_METHOD: trust
|
|
options: >-
|
|
--health-cmd pg_isready
|
|
--health-interval 10s
|
|
--health-timeout 5s
|
|
--health-retries 5
|
|
ports:
|
|
- 5432:5432
|
|
steps:
|
|
# checkout to pr branch
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
with:
|
|
ref: ${{ github.event.pull_request.head.sha }}
|
|
- name: Set up Python ${{ matrix.python-version }}
|
|
uses: actions/setup-python@v5
|
|
with:
|
|
python-version: ${{ matrix.python-version }}
|
|
- name: Install packages and dependencies
|
|
run: |
|
|
docker --version
|
|
python -m pip install --upgrade pip wheel
|
|
pip install -e .
|
|
python -c "import autogen"
|
|
pip install pytest-cov>=5 pytest-asyncio
|
|
- name: Install packages for test when needed
|
|
run: |
|
|
pip install docker
|
|
pip install -e .[retrievechat,retrievechat-qdrant,retrievechat-pgvector]
|
|
- name: Coverage
|
|
env:
|
|
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
|
|
AZURE_OPENAI_API_KEY: ${{ secrets.AZURE_OPENAI_API_KEY }}
|
|
AZURE_OPENAI_API_BASE: ${{ secrets.AZURE_OPENAI_API_BASE }}
|
|
OAI_CONFIG_LIST: ${{ secrets.OAI_CONFIG_LIST }}
|
|
run: |
|
|
pytest test/agentchat/contrib/retrievechat/ test/agentchat/contrib/retrievechat
|
|
- name: Upload coverage to Codecov
|
|
uses: codecov/codecov-action@v3
|
|
with:
|
|
file: ./coverage.xml
|
|
flags: unittests
|
|
AgentEvalTest:
|
|
strategy:
|
|
matrix:
|
|
os: [ubuntu-latest]
|
|
python-version: ["3.10"]
|
|
runs-on: ${{ matrix.os }}
|
|
environment: openai1
|
|
steps:
|
|
# checkout to pr branch
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
with:
|
|
ref: ${{ github.event.pull_request.head.sha }}
|
|
- name: Set up Python ${{ matrix.python-version }}
|
|
uses: actions/setup-python@v5
|
|
with:
|
|
python-version: ${{ matrix.python-version }}
|
|
- name: Install packages and dependencies
|
|
run: |
|
|
docker --version
|
|
python -m pip install --upgrade pip wheel
|
|
pip install -e .
|
|
python -c "import autogen"
|
|
pip install pytest-cov>=5 pytest-asyncio
|
|
- name: Coverage
|
|
env:
|
|
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
|
|
AZURE_OPENAI_API_KEY: ${{ secrets.AZURE_OPENAI_API_KEY }}
|
|
AZURE_OPENAI_API_BASE: ${{ secrets.AZURE_OPENAI_API_BASE }}
|
|
OAI_CONFIG_LIST: ${{ secrets.OAI_CONFIG_LIST }}
|
|
run: |
|
|
pytest test/agentchat/contrib/agent_eval/test_agent_eval.py
|
|
- name: Upload coverage to Codecov
|
|
uses: codecov/codecov-action@v3
|
|
with:
|
|
file: ./coverage.xml
|
|
flags: unittests
|
|
CompressionTest:
|
|
strategy:
|
|
matrix:
|
|
os: [ubuntu-latest]
|
|
python-version: ["3.9"]
|
|
runs-on: ${{ matrix.os }}
|
|
environment: openai1
|
|
steps:
|
|
# checkout to pr branch
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
with:
|
|
ref: ${{ github.event.pull_request.head.sha }}
|
|
- name: Set up Python ${{ matrix.python-version }}
|
|
uses: actions/setup-python@v5
|
|
with:
|
|
python-version: ${{ matrix.python-version }}
|
|
- name: Install packages and dependencies
|
|
run: |
|
|
docker --version
|
|
python -m pip install --upgrade pip wheel
|
|
pip install -e .
|
|
python -c "import autogen"
|
|
pip install pytest-cov>=5 pytest-asyncio
|
|
- name: Install packages for test when needed
|
|
run: |
|
|
pip install docker
|
|
- name: Coverage
|
|
env:
|
|
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
|
|
AZURE_OPENAI_API_KEY: ${{ secrets.AZURE_OPENAI_API_KEY }}
|
|
AZURE_OPENAI_API_BASE: ${{ secrets.AZURE_OPENAI_API_BASE }}
|
|
OAI_CONFIG_LIST: ${{ secrets.OAI_CONFIG_LIST }}
|
|
run: |
|
|
pytest test/agentchat/contrib/test_compressible_agent.py
|
|
- name: Upload coverage to Codecov
|
|
uses: codecov/codecov-action@v3
|
|
with:
|
|
file: ./coverage.xml
|
|
flags: unittests
|
|
GPTAssistantAgent:
|
|
strategy:
|
|
matrix:
|
|
os: [ubuntu-latest]
|
|
python-version: ["3.11"]
|
|
runs-on: ${{ matrix.os }}
|
|
environment: openai1
|
|
steps:
|
|
# checkout to pr branch
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
with:
|
|
ref: ${{ github.event.pull_request.head.sha }}
|
|
- name: Set up Python ${{ matrix.python-version }}
|
|
uses: actions/setup-python@v5
|
|
with:
|
|
python-version: ${{ matrix.python-version }}
|
|
- name: Install packages and dependencies
|
|
run: |
|
|
docker --version
|
|
python -m pip install --upgrade pip wheel
|
|
pip install -e .
|
|
python -c "import autogen"
|
|
pip install pytest-cov>=5 pytest-asyncio
|
|
- name: Install packages for test when needed
|
|
run: |
|
|
pip install docker
|
|
- name: Coverage
|
|
env:
|
|
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
|
|
AZURE_OPENAI_API_KEY: ${{ secrets.AZURE_OPENAI_API_KEY }}
|
|
AZURE_OPENAI_API_BASE: ${{ secrets.AZURE_OPENAI_API_BASE }}
|
|
OAI_CONFIG_LIST: ${{ secrets.OAI_CONFIG_LIST }}
|
|
run: |
|
|
pytest test/agentchat/contrib/test_gpt_assistant.py
|
|
- name: Upload coverage to Codecov
|
|
uses: codecov/codecov-action@v3
|
|
with:
|
|
file: ./coverage.xml
|
|
flags: unittests
|
|
TeachableAgent:
|
|
strategy:
|
|
matrix:
|
|
os: [ubuntu-latest]
|
|
python-version: ["3.11"]
|
|
runs-on: ${{ matrix.os }}
|
|
environment: openai1
|
|
steps:
|
|
# checkout to pr branch
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
with:
|
|
ref: ${{ github.event.pull_request.head.sha }}
|
|
- name: Set up Python ${{ matrix.python-version }}
|
|
uses: actions/setup-python@v5
|
|
with:
|
|
python-version: ${{ matrix.python-version }}
|
|
- name: Install packages and dependencies
|
|
run: |
|
|
docker --version
|
|
python -m pip install --upgrade pip wheel
|
|
pip install -e .[teachable]
|
|
python -c "import autogen"
|
|
pip install pytest-cov>=5
|
|
- name: Coverage
|
|
env:
|
|
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
|
|
AZURE_OPENAI_API_KEY: ${{ secrets.AZURE_OPENAI_API_KEY }}
|
|
AZURE_OPENAI_API_BASE: ${{ secrets.AZURE_OPENAI_API_BASE }}
|
|
OAI_CONFIG_LIST: ${{ secrets.OAI_CONFIG_LIST }}
|
|
run: |
|
|
pytest test/agentchat/contrib/capabilities/test_teachable_agent.py
|
|
- name: Upload coverage to Codecov
|
|
uses: codecov/codecov-action@v3
|
|
with:
|
|
file: ./coverage.xml
|
|
flags: unittests
|
|
AgentBuilder:
|
|
strategy:
|
|
matrix:
|
|
os: [ubuntu-latest]
|
|
python-version: ["3.11"]
|
|
runs-on: ${{ matrix.os }}
|
|
environment: openai1
|
|
steps:
|
|
# checkout to pr branch
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
with:
|
|
ref: ${{ github.event.pull_request.head.sha }}
|
|
- name: Set up Python ${{ matrix.python-version }}
|
|
uses: actions/setup-python@v5
|
|
with:
|
|
python-version: ${{ matrix.python-version }}
|
|
- name: Install packages and dependencies
|
|
run: |
|
|
docker --version
|
|
python -m pip install --upgrade pip wheel
|
|
pip install -e .
|
|
python -c "import autogen"
|
|
pip install pytest-cov>=5 pytest-asyncio
|
|
- name: Install packages for test when needed
|
|
run: |
|
|
pip install -e .[autobuild]
|
|
- name: Coverage
|
|
env:
|
|
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
|
|
AZURE_OPENAI_API_KEY: ${{ secrets.AZURE_OPENAI_API_KEY }}
|
|
AZURE_OPENAI_API_BASE: ${{ secrets.AZURE_OPENAI_API_BASE }}
|
|
OAI_CONFIG_LIST: ${{ secrets.OAI_CONFIG_LIST }}
|
|
run: |
|
|
pytest test/agentchat/contrib/test_agent_builder.py
|
|
- name: Upload coverage to Codecov
|
|
uses: codecov/codecov-action@v3
|
|
with:
|
|
file: ./coverage.xml
|
|
flags: unittests
|
|
WebSurfer:
|
|
strategy:
|
|
matrix:
|
|
os: [ubuntu-latest]
|
|
python-version: ["3.11"]
|
|
runs-on: ${{ matrix.os }}
|
|
environment: openai1
|
|
steps:
|
|
# checkout to pr branch
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
with:
|
|
ref: ${{ github.event.pull_request.head.sha }}
|
|
- name: Set up Python ${{ matrix.python-version }}
|
|
uses: actions/setup-python@v5
|
|
with:
|
|
python-version: ${{ matrix.python-version }}
|
|
- name: Install packages and dependencies
|
|
run: |
|
|
docker --version
|
|
python -m pip install --upgrade pip wheel
|
|
pip install -e .[websurfer]
|
|
python -c "import autogen"
|
|
pip install pytest-cov>=5
|
|
- name: Coverage
|
|
env:
|
|
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
|
|
AZURE_OPENAI_API_KEY: ${{ secrets.AZURE_OPENAI_API_KEY }}
|
|
AZURE_OPENAI_API_BASE: ${{ secrets.AZURE_OPENAI_API_BASE }}
|
|
OAI_CONFIG_LIST: ${{ secrets.OAI_CONFIG_LIST }}
|
|
BING_API_KEY: ${{ secrets.BING_API_KEY }}
|
|
run: |
|
|
pytest test/agentchat/contrib/test_web_surfer.py
|
|
- name: Upload coverage to Codecov
|
|
uses: codecov/codecov-action@v3
|
|
with:
|
|
file: ./coverage.xml
|
|
flags: unittests
|
|
ContextHandling:
|
|
strategy:
|
|
matrix:
|
|
os: [ubuntu-latest]
|
|
python-version: ["3.11"]
|
|
runs-on: ${{ matrix.os }}
|
|
environment: openai1
|
|
steps:
|
|
# checkout to pr branch
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
with:
|
|
ref: ${{ github.event.pull_request.head.sha }}
|
|
- name: Set up Python ${{ matrix.python-version }}
|
|
uses: actions/setup-python@v5
|
|
with:
|
|
python-version: ${{ matrix.python-version }}
|
|
- name: Install packages and dependencies
|
|
run: |
|
|
docker --version
|
|
python -m pip install --upgrade pip wheel
|
|
pip install -e .
|
|
python -c "import autogen"
|
|
pip install pytest-cov>=5
|
|
- name: Coverage
|
|
env:
|
|
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
|
|
AZURE_OPENAI_API_KEY: ${{ secrets.AZURE_OPENAI_API_KEY }}
|
|
AZURE_OPENAI_API_BASE: ${{ secrets.AZURE_OPENAI_API_BASE }}
|
|
OAI_CONFIG_LIST: ${{ secrets.OAI_CONFIG_LIST }}
|
|
BING_API_KEY: ${{ secrets.BING_API_KEY }}
|
|
run: |
|
|
pytest test/agentchat/contrib/capabilities/test_context_handling.py
|
|
- name: Upload coverage to Codecov
|
|
uses: codecov/codecov-action@v3
|
|
with:
|
|
file: ./coverage.xml
|
|
flags: unittests
|
|
ImageGen:
|
|
strategy:
|
|
matrix:
|
|
os: [ubuntu-latest]
|
|
python-version: ["3.12"]
|
|
runs-on: ${{ matrix.os }}
|
|
environment: openai1
|
|
steps:
|
|
# checkout to pr branch
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
with:
|
|
ref: ${{ github.event.pull_request.head.sha }}
|
|
- name: Set up Python ${{ matrix.python-version }}
|
|
uses: actions/setup-python@v5
|
|
with:
|
|
python-version: ${{ matrix.python-version }}
|
|
- name: Install packages and dependencies
|
|
run: |
|
|
docker --version
|
|
python -m pip install --upgrade pip wheel
|
|
pip install -e .[lmm]
|
|
python -c "import autogen"
|
|
pip install pytest-cov>=5
|
|
- name: Coverage
|
|
env:
|
|
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
|
|
run: |
|
|
pytest test/agentchat/contrib/capabilities/test_image_generation_capability.py
|
|
- name: Upload coverage to Codecov
|
|
uses: codecov/codecov-action@v3
|
|
with:
|
|
file: ./coverage.xml
|
|
flags: unittests
|
|
|
|
AgentOptimizer:
|
|
strategy:
|
|
matrix:
|
|
os: [ubuntu-latest]
|
|
python-version: ["3.11"]
|
|
runs-on: ${{ matrix.os }}
|
|
environment: openai1
|
|
steps:
|
|
# checkout to pr branch
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
with:
|
|
ref: ${{ github.event.pull_request.head.sha }}
|
|
- name: Set up Python ${{ matrix.python-version }}
|
|
uses: actions/setup-python@v5
|
|
with:
|
|
python-version: ${{ matrix.python-version }}
|
|
- name: Install packages and dependencies
|
|
run: |
|
|
docker --version
|
|
python -m pip install --upgrade pip wheel
|
|
pip install -e .
|
|
python -c "import autogen"
|
|
pip install pytest-cov>=5
|
|
- name: Coverage
|
|
env:
|
|
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
|
|
AZURE_OPENAI_API_KEY: ${{ secrets.AZURE_OPENAI_API_KEY }}
|
|
AZURE_OPENAI_API_BASE: ${{ secrets.AZURE_OPENAI_API_BASE }}
|
|
OAI_CONFIG_LIST: ${{ secrets.OAI_CONFIG_LIST }}
|
|
run: |
|
|
pytest test/agentchat/contrib/test_agent_optimizer.py
|
|
- name: Upload coverage to Codecov
|
|
uses: codecov/codecov-action@v3
|
|
with:
|
|
file: ./coverage.xml
|
|
flags: unittests
|