Skip to content

Commit

Permalink
Add CompressibleAgent (microsoft#443)
Browse files Browse the repository at this point in the history
* api_base -> base_url (microsoft#383)

* InvalidRequestError -> BadRequestError (microsoft#389)

* remove api_key_path; close microsoft#388

* close microsoft#402 (microsoft#403)

* openai client (microsoft#419)

* openai client

* client test

* _client -> client

* _client -> client

* extra kwargs

* Completion -> client (microsoft#426)

* Completion -> client

* Completion -> client

* Completion -> client

* Completion -> client

* support aoai

* fix test error

* remove commented code

* support aoai

* annotations

* import

* reduce test

* skip test

* skip test

* skip test

* debug test

* rename test

* update workflow

* update workflow

* env

* py version

* doc improvement

* docstr update

* openai<1

* add compressibleagent

* revise doc, add tests, add example

* fix link

* fix link

* fix link

* remove test

* update doc

* update doc

* add tiktoken to dependency

* filter_func

* async test

* dependency

* revision

* migration guide (microsoft#477)

* migration guide

* change in kwargs

* simplify header

* update optigude description

* update for dev

* revision

* revision

* allow not compressing last n msgs

* update

* correct merge

* update test workflow

* check test

* update for test

* update

* update notebook

* update

* fix bug

* update

* update

* update

* check to "pull_request_target" in contrib-openai

---------

Co-authored-by: Chi Wang <wang.chi@microsoft.com>
  • Loading branch information
yiranwu0 and sonichi committed Nov 10, 2023
1 parent a503171 commit 23fcc03
Show file tree
Hide file tree
Showing 5 changed files with 1,993 additions and 0 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/contrib-openai.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,44 @@ jobs:
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@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
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 coverage 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: |
coverage run -a -m pytest test/agentchat/contrib/test_compressible_agent.py
coverage xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
file: ./coverage.xml
flags: unittests
25 changes: 25 additions & 0 deletions .github/workflows/contrib-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,28 @@ jobs:
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
Loading

0 comments on commit 23fcc03

Please sign in to comment.