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

2447 fix pgvector tests and notebook #2455

Merged
merged 85 commits into from
Apr 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
85 commits
Select commit Hold shift + click to select a range
790838e
Re-added missing notebook
Knucklessg1 Apr 19, 2024
7c61250
Test installing postgres
Knucklessg1 Apr 19, 2024
887926a
Error handle the connection.
Knucklessg1 Apr 19, 2024
c84e98b
Fixed import.
Knucklessg1 Apr 19, 2024
b5f0b5d
Fixed import.
Knucklessg1 Apr 19, 2024
a8cfdac
Fixed creation of collection without client.
Knucklessg1 Apr 19, 2024
88e19a9
PGVector portion working. OpenAI untested.
Knucklessg1 Apr 19, 2024
e2ccfa2
Fixed prints.
Knucklessg1 Apr 19, 2024
303d3c6
Added output.
Knucklessg1 Apr 19, 2024
e579026
Fixed pre-commits.
Knucklessg1 Apr 19, 2024
1887e40
Run pgvector notebook
thinkall Apr 20, 2024
b4d9572
Improve efficiency of get_collection
thinkall Apr 20, 2024
e751b9a
Fix delete_collection
thinkall Apr 20, 2024
99e33e4
Fixed issues with pytests and validated functions.
Knucklessg1 Apr 22, 2024
e74e6e8
Validated pytests.
Knucklessg1 Apr 22, 2024
3cb4cb9
Fixed pre-commits
Knucklessg1 Apr 22, 2024
5e5468d
Merge branch 'main' into 2447-fix-pgvector-tests-and-notebook
Knucklessg1 Apr 22, 2024
d3e87d4
Separated extra_requires to allow more logic. Retrieve_chat base depe…
Knucklessg1 Apr 22, 2024
78566aa
Fixed setup for pgvector, Hard dependency on chromadb
Knucklessg1 Apr 22, 2024
200f99c
Fixed extra newline.
Knucklessg1 Apr 22, 2024
805f062
Added username and password fields.
Knucklessg1 Apr 22, 2024
18a2b47
URL Encode the connection string parameters to support symbols like %
Knucklessg1 Apr 22, 2024
d4432b1
Merge branch '2447-fix-pgvector-tests-and-notebook' of https://github…
Knucklessg1 Apr 22, 2024
19e5bb1
Fixed pre-commits.
Knucklessg1 Apr 22, 2024
c53f40b
Merge branch 'main' into 2447-fix-pgvector-tests-and-notebook
thinkall Apr 22, 2024
29fdadd
Added pgvector service
Knucklessg1 Apr 23, 2024
f651786
Merge branch '2447-fix-pgvector-tests-and-notebook' of https://github…
Knucklessg1 Apr 23, 2024
0ed0016
pgvector doesn't have health intervals.
Knucklessg1 Apr 23, 2024
00cc6f6
Switched to colon based key values.
Knucklessg1 Apr 23, 2024
b391f16
Run on Ubuntu only. Linux is only option with container service support.
Knucklessg1 Apr 23, 2024
b409806
Using default credentials instead.
Knucklessg1 Apr 23, 2024
af1ddf5
Fix postgres setup
thinkall Apr 23, 2024
e2aaffe
Fix postgres setup
thinkall Apr 23, 2024
e5c2d34
Don't skip tests on win and mac
thinkall Apr 23, 2024
4712b1e
Fix command error
thinkall Apr 23, 2024
7252329
Try apt install postgresql
thinkall Apr 23, 2024
4cb3e90
Assert table does not exist when deleted.
Knucklessg1 Apr 23, 2024
609087a
Raise value error on a empty list or None value provided for IDs
Knucklessg1 Apr 23, 2024
acd0c3e
Merge branch '2447-fix-pgvector-tests-and-notebook' of https://github…
Knucklessg1 Apr 23, 2024
ce54c59
pre-commit
Knucklessg1 Apr 23, 2024
32bf296
Add install pgvector
thinkall Apr 23, 2024
a2db6e2
Add install pgvector
thinkall Apr 23, 2024
bd6d5ce
Reorg test files, create a separate job for test pgvector
thinkall Apr 23, 2024
d301609
Fix format
thinkall Apr 23, 2024
50fd9dc
Fix env format
thinkall Apr 23, 2024
3c660f1
Simplify job name, enable test_retrieve_config
thinkall Apr 23, 2024
6785d6f
Fix test_retrieve_config
thinkall Apr 23, 2024
f98c224
Corrected behavior for get_docs_by_ids with no ids returning all docs.
Knucklessg1 Apr 23, 2024
4c528e2
Merge branch '2447-fix-pgvector-tests-and-notebook' of https://github…
Knucklessg1 Apr 23, 2024
32956fb
Merge branch 'main' into 2447-fix-pgvector-tests-and-notebook
Knucklessg1 Apr 23, 2024
f3d6fa1
Corrected behavior for get_docs_by_ids with no ids returning all docs.
Knucklessg1 Apr 23, 2024
ccbbb06
Merge branches '2447-fix-pgvector-tests-and-notebook' and '2447-fix-p…
Knucklessg1 Apr 23, 2024
0973004
Fixed pre-commits.
Knucklessg1 Apr 23, 2024
1e015db
Merge branch 'main' into 2447-fix-pgvector-tests-and-notebook
Knucklessg1 Apr 23, 2024
f4db47a
Added return values for all functions.
Knucklessg1 Apr 23, 2024
98a4a51
Validated distance search is implemented correctly.
Knucklessg1 Apr 24, 2024
65d3fd8
Validated all pytests
Knucklessg1 Apr 24, 2024
855018b
Removed print.
Knucklessg1 Apr 24, 2024
dd2f7d8
Added default clause.
Knucklessg1 Apr 24, 2024
313db3e
Merge branch 'main' into 2447-fix-pgvector-tests-and-notebook
Knucklessg1 Apr 24, 2024
d7078f2
Make ids optional
thinkall Apr 24, 2024
7e9c49d
Fix test, make it more robust
thinkall Apr 24, 2024
2119334
Bump version of openai for the vector_store support
Knucklessg1 Apr 24, 2024
c56368c
Added support for choosing the sentence transformer model.
Knucklessg1 Apr 24, 2024
03f01e5
Added error handling for model name entered.
Knucklessg1 Apr 24, 2024
f209f87
Updated model info.
Knucklessg1 Apr 24, 2024
8e640ad
Added model_name db_config param.
Knucklessg1 Apr 24, 2024
c0a5fdc
pre-commit fixes and last link fix.
Knucklessg1 Apr 24, 2024
998a745
Use secrets password.
Knucklessg1 Apr 24, 2024
5d67343
fix: link fixed
Hk669 Apr 24, 2024
6017b04
updated tests
Hk669 Apr 24, 2024
b514838
Updated config_list.
Knucklessg1 Apr 24, 2024
a7ac3e2
pre-commit fix.
Knucklessg1 Apr 24, 2024
1d0444d
Added chat_result to all output.
Knucklessg1 Apr 24, 2024
34fe843
Pre-commit fix detected this requirement.
Knucklessg1 Apr 24, 2024
4c2b83c
Merge branch '2447-fix-pgvector-tests-and-notebook' of https://github…
Knucklessg1 Apr 24, 2024
60ddb24
Fix python 3.8 and 3.9 not supported for macos
thinkall Apr 25, 2024
e505bd3
Fix python 3.8 and 3.9 not supported for macos
thinkall Apr 25, 2024
1261dbf
Fix format
thinkall Apr 25, 2024
b0aa62a
Reran notebook with MetaLlama3Instruct7BQ4_k_M
Knucklessg1 Apr 25, 2024
9fb06ea
added gpt model.
Knucklessg1 Apr 25, 2024
86471f2
Reran notebook
thinkall Apr 25, 2024
644fed5
Merge branch 'main' into 2447-fix-pgvector-tests-and-notebook
Knucklessg1 Apr 25, 2024
fc297ce
Merge branch 'main' into 2447-fix-pgvector-tests-and-notebook
Knucklessg1 Apr 26, 2024
3ff9972
Merge branch 'main' into 2447-fix-pgvector-tests-and-notebook
Knucklessg1 Apr 27, 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
25 changes: 18 additions & 7 deletions .github/workflows/contrib-openai.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,21 @@ jobs:
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
Expand All @@ -41,29 +56,25 @@ jobs:
pip install -e .
python -c "import autogen"
pip install coverage pytest-asyncio
- name: Install PostgreSQL
run: |
sudo apt install postgresql -y
- name: Start PostgreSQL service
run: sudo service postgresql start
- name: Install packages for test when needed
run: |
pip install docker
pip install -e .[retrievechat-qdrant,retrievechat-pgvector]
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: |
coverage run -a -m pytest test/agentchat/contrib/test_retrievechat.py::test_retrievechat test/agentchat/contrib/test_qdrant_retrievechat.py::test_retrievechat test/agentchat/contrib/test_pgvector_retrievechat.py::test_retrievechat
coverage run -a -m pytest -k test_retrievechat test/agentchat/contrib/retrievechat
coverage xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
file: ./coverage.xml
flags: unittests

CompressionTest:
strategy:
matrix:
Expand Down
78 changes: 65 additions & 13 deletions .github/workflows/contrib-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-2019]
os: [macos-latest, windows-2019]
python-version: ["3.9", "3.10", "3.11"]
exclude:
- os: macos-latest
Expand All @@ -45,30 +45,82 @@ jobs:
- name: Install qdrant_client when python-version is 3.10
if: matrix.python-version == '3.10'
run: |
pip install .[retrievechat-qdrant]
pip install -e .[retrievechat-qdrant]
- 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: Coverage
run: |
pip install coverage>=5.3
coverage run -a -m pytest test/test_retrieve_utils.py test/agentchat/contrib/retrievechat test/agentchat/contrib/vectordb --skip-openai
coverage xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
file: ./coverage.xml
flags: unittests

RetrieveChatTest-Ubuntu:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.9", "3.10", "3.11"]
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:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
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 -e .[retrievechat-qdrant]
- name: Install pgvector when on linux
run: |
pip install -e .[retrievechat-pgvector]
- name: Install unstructured when python-version is 3.9 and on linux
if: matrix.python-version == '3.9'
run: |
sudo apt-get update
sudo apt-get install -y tesseract-ocr poppler-utils
pip install unstructured[all-docs]==0.13.0
- name: Install and Start PostgreSQL
runs-on: ubuntu-latest
- name: Install packages and dependencies for RetrieveChat
run: |
sudo apt install postgresql -y
sudo service postgresql start
- name: Install packages and dependencies for PGVector
run: |
pip install -e .[retrievechat-pgvector]
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
echo "AUTOGEN_USE_DOCKER=False" >> $GITHUB_ENV
- 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 test/agentchat/contrib/vectordb --skip-openai
coverage run -a -m pytest test/test_retrieve_utils.py test/agentchat/contrib/retrievechat test/agentchat/contrib/vectordb --skip-openai
coverage xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
Expand Down
Loading
Loading