Skip to content

Commit 2a8ff71

Browse files
rbs333abrookins
authored andcommitted
Add distance threshold optimizer classes (#292)
- add base, router, and cache threshold optimizer - uses ranx to support eval metrics - class is designed to receive a optimizer class in the case where someone wants to supply their own without us having to make a release to support something custom
1 parent 161a287 commit 2a8ff71

19 files changed

+2965
-844
lines changed

Diff for: .github/workflows/test.yml

+10-5
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ on:
88
- main
99

1010
schedule:
11-
- cron: "0 2 * * *" # 2 AM UTC nightly
12-
11+
- cron: "0 2 * * *" # 2 AM UTC nightly
12+
1313
workflow_dispatch:
1414

1515
env:
@@ -86,9 +86,9 @@ jobs:
8686
strategy:
8787
fail-fast: false
8888
matrix:
89-
python-version: ['3.10', '3.11', 3.12, 3.13]
90-
connection: ['hiredis', 'plain']
91-
redis-version: ['6.2.6-v9', 'latest', '8.0-M03']
89+
python-version: ["3.10", "3.11", 3.12, 3.13]
90+
connection: ["hiredis", "plain"]
91+
redis-version: ["6.2.6-v9", "latest", "8.0-M03"]
9292

9393
steps:
9494
- name: Check out repository
@@ -176,6 +176,11 @@ jobs:
176176
run: |
177177
docker run -d --name redis -p 6379:6379 redis/redis-stack-server:latest
178178
make test-notebooks
179+
if [[ "${{ matrix.python-version }}" > "3.9" ]]; then
180+
make test-notebooks
181+
else
182+
poetry run test-notebooks --ignore ./docs/user_guide/09_threshold_optimization.ipynb
183+
fi
179184
180185
docs:
181186
runs-on: ubuntu-latest

Diff for: README.md

+5
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,11 @@ embeddings = co.embed_many(
222222
### Rerankers
223223
[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
224224

225+
### Threshold Optimization
226+
[Optimize distance thresholds for cache and router](https://docs.redisvl.com/en/stable/user_guide/09_threshold_optimization.html) with the utility `ThresholdOptimizer` classes.
227+
228+
**Note:** only available for `python > 3.9`.
229+
225230

226231

227232
## 💫 Extensions

0 commit comments

Comments
 (0)