Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Text Compression Transform #2225

Merged
merged 43 commits into from
May 6, 2024
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
472d0f8
adds implementation
WaelKarkoub Mar 31, 2024
28fa3f5
handles optional import
WaelKarkoub Mar 31, 2024
12f95f2
cleanup
WaelKarkoub Mar 31, 2024
50607eb
updates github workflows
WaelKarkoub Mar 31, 2024
de3e655
skip test if dependencies not installed
WaelKarkoub Mar 31, 2024
7ee0a55
skip test if dependencies not installed
WaelKarkoub Mar 31, 2024
aa572e3
use cpu
WaelKarkoub Mar 31, 2024
62cfd33
Merge branch 'main' into llm-lingua-transform
WaelKarkoub Mar 31, 2024
36388a9
skip openai
WaelKarkoub Mar 31, 2024
a182c34
Merge branch 'main' into llm-lingua-transform
WaelKarkoub Mar 31, 2024
51a3085
unskip openai
WaelKarkoub Apr 1, 2024
71d0447
Merge branch 'main' into llm-lingua-transform
WaelKarkoub Apr 2, 2024
b3eb1b3
Merge branch 'main' into llm-lingua-transform
WaelKarkoub Apr 4, 2024
32eb666
adds protocol
WaelKarkoub Apr 4, 2024
5a9d672
better docstr
WaelKarkoub Apr 4, 2024
93bc0eb
minor fixes
WaelKarkoub Apr 4, 2024
b1c1f37
Merge branch 'main' into llm-lingua-transform
WaelKarkoub Apr 5, 2024
268f3e8
updates optional dependencies docs
WaelKarkoub Apr 5, 2024
414b518
Merge branch 'main' into llm-lingua-transform
WaelKarkoub Apr 5, 2024
142ba37
Merge branch 'main' into llm-lingua-transform
WaelKarkoub Apr 7, 2024
6ba0526
wip
WaelKarkoub Apr 7, 2024
2cb5761
update docstrings
WaelKarkoub Apr 7, 2024
73b8092
adds compression test
WaelKarkoub Apr 22, 2024
3584aea
wip
WaelKarkoub Apr 23, 2024
d1e55c4
Merge branch 'main' into llm-lingua-transform
WaelKarkoub Apr 29, 2024
d3439dc
adds back llmlingua requirement
WaelKarkoub Apr 29, 2024
965c459
Merge branch 'main' into llm-lingua-transform
WaelKarkoub May 1, 2024
db73843
finalized protocol
WaelKarkoub May 1, 2024
2b47222
improve docstr
WaelKarkoub May 1, 2024
22b34b1
guide complete
WaelKarkoub May 1, 2024
4432e61
improve docstr
WaelKarkoub May 1, 2024
a28ac00
Merge branch 'main' into llm-lingua-transform
WaelKarkoub May 2, 2024
1fd533e
Merge branch 'main' into llm-lingua-transform
WaelKarkoub May 3, 2024
62afdfb
fix FAQ
WaelKarkoub May 3, 2024
fa94e39
added cache support
WaelKarkoub May 4, 2024
9cf65ed
improve cache key
WaelKarkoub May 4, 2024
8390dec
Merge branch 'main' into llm-lingua-transform
WaelKarkoub May 4, 2024
a3fb568
cache key fix + faq fix
WaelKarkoub May 4, 2024
d46fccf
improve docs
WaelKarkoub May 5, 2024
1cab419
Merge branch 'main' into llm-lingua-transform
WaelKarkoub May 5, 2024
8a9fc96
improve guide
WaelKarkoub May 5, 2024
ec6fe57
args -> params
WaelKarkoub May 5, 2024
98cb736
spelling
WaelKarkoub May 6, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
199 changes: 118 additions & 81 deletions .github/workflows/contrib-openai.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,15 @@ name: OpenAI4ContribTests

on:
pull_request:
branches: ['main']
branches: ["main"]
paths:
- 'autogen/**'
- 'test/agentchat/contrib/**'
- '.github/workflows/contrib-openai.yml'
- 'setup.py'
permissions: {}
# actions: read
- "autogen/**"
- "test/agentchat/contrib/**"
- ".github/workflows/contrib-openai.yml"
- "setup.py"
permissions:
{}
# actions: read
# checks: read
# contents: read
# deployments: read
Expand Down Expand Up @@ -183,8 +184,8 @@ jobs:
AgentBuilder:
strategy:
matrix:
os: [ ubuntu-latest ]
python-version: [ "3.11" ]
os: [ubuntu-latest]
python-version: ["3.11"]
runs-on: ${{ matrix.os }}
environment: openai1
steps:
Expand Down Expand Up @@ -261,76 +262,112 @@ jobs:
file: ./coverage.xml
flags: unittests
ContextHandling:
WaelKarkoub marked this conversation as resolved.
Show resolved Hide resolved
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 coverage pytest
- 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: |
coverage run -a -m pytest test/agentchat/contrib/capabilities/test_context_handling.py
coverage xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
file: ./coverage.xml
flags: unittests
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 coverage pytest
- 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: |
coverage run -a -m pytest test/agentchat/contrib/capabilities/test_context_handling.py
coverage xml
- 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 coverage pytest
- name: Coverage
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
run: |
coverage run -a -m pytest test/agentchat/contrib/capabilities/test_image_generation_capability.py
coverage xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
file: ./coverage.xml
flags: unittests
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 coverage pytest
- name: Coverage
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
run: |
coverage run -a -m pytest test/agentchat/contrib/capabilities/test_image_generation_capability.py
coverage xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
file: ./coverage.xml
flags: unittests
TransformMessages:
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 Transform Messages
run: |
pip install -e '.[long-context]'
- 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_transform_messages.py --skip-openai
WaelKarkoub marked this conversation as resolved.
Show resolved Hide resolved
coverage xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
file: ./coverage.xml
flags: unittest
2 changes: 1 addition & 1 deletion .github/workflows/contrib-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ jobs:
pip install pytest
- name: Install packages and dependencies for Transform Messages
run: |
pip install -e .
pip install -e '.[long-context]'
- name: Set AUTOGEN_USE_DOCKER based on OS
shell: bash
run: |
Expand Down
Loading
Loading