Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
42 changes: 19 additions & 23 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,17 @@ on:
- main

schedule:
- cron: "0 2 * * *" # 2 AM UTC nightly
- cron: "0 2 * * *" # 2 AM UTC nightly

workflow_dispatch:

env:
PYTHON_VERSION: "3.11"
POETRY_VERSION: "1.8.3"

jobs:
prime-cache:
name: Prime HuggingFace Model Cache
service-tests:
name: Service Tests
runs-on: ubuntu-latest
env:
HF_HOME: ${{ github.workspace }}/hf_cache
Expand All @@ -38,10 +38,10 @@ jobs:
mkdir -p ~/.huggingface
echo '{"token":"${{ secrets.HF_TOKEN }}"}' > ~/.huggingface/token

- name: Set up Python 3.9
- name: Set up Python 3.11
uses: actions/setup-python@v4
with:
python-version: 3.9
python-version: 3.11
cache: pip

- name: Install Poetry
Expand All @@ -58,7 +58,7 @@ jobs:
with:
credentials_json: ${{ secrets.GOOGLE_CREDENTIALS }}

- name: Run full test suite to prime cache
- name: Run full test suite and prime the HF cache
env:
HF_TOKEN: ${{ secrets.HF_TOKEN }}
HF_HOME: ${{ github.workspace }}/hf_cache
Expand All @@ -80,15 +80,16 @@ jobs:
test:
name: Python ${{ matrix.python-version }} - ${{ matrix.connection }} [redis ${{ matrix.redis-version }}]
runs-on: ubuntu-latest
needs: prime-cache
needs: service-tests
env:
HF_HOME: ${{ github.workspace }}/hf_cache
strategy:
fail-fast: false
matrix:
python-version: ['3.10', '3.11', 3.12, 3.13]
connection: ['hiredis', 'plain']
redis-version: ['6.2.6-v9', 'latest', '8.0-M03']
# 3.11 tests are run in the service-tests job
python-version: ["3.9", "3.10", 3.12, 3.13]
connection: ["hiredis", "plain"]
redis-version: ["6.2.6-v9", "latest", "8.0-M03"]

steps:
- name: Check out repository
Expand Down Expand Up @@ -137,20 +138,10 @@ jobs:
if: matrix.connection == 'plain' && matrix.redis-version == 'latest'
env:
HF_HOME: ${{ github.workspace }}/hf_cache
OPENAI_API_KEY: ${{ secrets.OPENAI_KEY }}
GCP_LOCATION: ${{ secrets.GCP_LOCATION }}
GCP_PROJECT_ID: ${{ secrets.GCP_PROJECT_ID }}
COHERE_API_KEY: ${{ secrets.COHERE_API_KEY }}
MISTRAL_API_KEY: ${{ secrets.MISTRAL_API_KEY }}
VOYAGE_API_KEY: ${{ secrets.VOYAGE_API_KEY }}
AZURE_OPENAI_API_KEY: ${{ secrets.AZURE_OPENAI_API_KEY }}
AZURE_OPENAI_ENDPOINT: ${{ secrets.AZURE_OPENAI_ENDPOINT }}
AZURE_OPENAI_DEPLOYMENT_NAME: ${{ secrets.AZURE_OPENAI_DEPLOYMENT_NAME }}
OPENAI_API_VERSION: ${{ secrets.OPENAI_API_VERSION }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
run: |
make test-all
make test

- name: Run tests (alternate)
if: matrix.connection != 'plain' || matrix.redis-version != 'latest'
Expand All @@ -173,9 +164,14 @@ jobs:
OPENAI_API_VERSION: ${{ secrets.OPENAI_API_VERSION }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
HF_TOKEN: ${{ secrets.HF_TOKEN }}
run: |
docker run -d --name redis -p 6379:6379 redis/redis-stack-server:latest
make test-notebooks
if [[ "${{ matrix.python-version }}" > "3.9" ]]; then
make test-notebooks
else
poetry run test-notebooks --ignore ./docs/user_guide/09_threshold_optimization.ipynb --ignore ./docs/user_guide/release_guide/0_5_0_release.ipynb
fi

docs:
runs-on: ubuntu-latest
Expand Down
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,11 @@ embeddings = co.embed_many(
### Rerankers
[Integrate with popular reranking providers](https://docs.redisvl.com/en/stable/user_guide/06_rerankers.html) to improve the relevancy of the initial search results from Redis

### Threshold Optimization
[Optimize distance thresholds for cache and router](https://docs.redisvl.com/en/stable/user_guide/09_threshold_optimization.html) with the utility `ThresholdOptimizer` classes.

**Note:** only available for `python > 3.9`.



## 💫 Extensions
Expand Down
1 change: 1 addition & 0 deletions docs/api/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,6 @@ reranker
cache
session_manager
router
threshold_optimizer
```

28 changes: 28 additions & 0 deletions docs/api/query.rst
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,34 @@ VectorRangeQuery
:show-inheritance:
:exclude-members: add_filter,get_args,highlight,return_field,summarize

HybridQuery
================


.. currentmodule:: redisvl.query


.. autoclass:: HybridQuery
:members:
:inherited-members:
:show-inheritance:
:exclude-members: add_filter,get_args,highlight,return_field,summarize


TextQuery
================


.. currentmodule:: redisvl.query


.. autoclass:: TextQuery
:members:
:inherited-members:
:show-inheritance:
:exclude-members: add_filter,get_args,highlight,return_field,summarize


FilterQuery
===========

Expand Down
1 change: 0 additions & 1 deletion docs/api/session_manager.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
LLM Session Manager
*******************


SemanticSessionManager
======================

Expand Down
26 changes: 26 additions & 0 deletions docs/api/threshold_optimizer.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
********************
Threshold Optimizers
********************

CacheThresholdOptimizer
=======================

.. _cachethresholdoptimizer_api:

.. currentmodule:: redisvl.utils.optimize.cache

.. autoclass:: CacheThresholdOptimizer
:show-inheritance:
:members:


RouterThresholdOptimizer
========================

.. _routerthresholdoptimizer_api:

.. currentmodule:: redisvl.utils.optimize.router

.. autoclass:: RouterThresholdOptimizer
:show-inheritance:
:members:
Loading