Commit 5a25f91
authored
feat: implement Approximate Nearest Neighbor support for DDL (CREATE TABLE, CREATE VECTOR INDEX) (googleapis#124)
* fix(testing+linting): add nox lint+format directives
This change introduces new nox directives:
* blacken: `nox -s blacken`
* format: `nox -s format` to apply formatting to files
* lint: `nox -s lint` to flag linting issues
* unit: to run unit tests locally
which are the basis to enable scalable development
and continuous testing as I prepare to bring in
Approximate Nearest Neighors (ANN) functionality into
this package.
Also while here, fixed a typo in the README.rst file
that didn't have the correct import path.
* feat: add Approximate Nearest Neighbor support to distance strategies
This change adds ANN distance strategies for GoogleSQL semantics.
While here started unit tests to effectively test out components
without having to have a running Cloud Spanner instance.
Updates googleapis#94
* Ensure vector fits within limits in sample
* Update ANN query names + test expectations
* Pass in strategy inferred from initialization
* Hook up get_documents_from_query_results
* Link up __search_by_ANN to similarity_search_by_vector
* Incorporate pre_filter and post_filter plus update tests
* Review addressing
* Simplified checking if using ANN
* Reduce the amount of changes
* More reductions
* More reductions to ease code review
* Fit with get_rows_by_similarity_search_ann
* Updates from nox
* Fix PostGreSQL1 parent b10dc28 commit 5a25f91
File tree
9 files changed
+767
-55
lines changed- src/langchain_google_spanner
- tests
- integration
- unit
9 files changed
+767
-55
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
253 | 253 | | |
254 | 254 | | |
255 | 255 | | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
23 | 22 | | |
24 | 23 | | |
25 | 24 | | |
| |||
33 | 32 | | |
34 | 33 | | |
35 | 34 | | |
| 35 | + | |
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | | - | |
| 1 | + | |
| 2 | + | |
3 | 3 | | |
4 | 4 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
288 | 288 | | |
289 | 289 | | |
290 | 290 | | |
| 291 | + | |
291 | 292 | | |
292 | 293 | | |
293 | 294 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
225 | 225 | | |
226 | 226 | | |
227 | 227 | | |
228 | | - | |
| 228 | + | |
229 | 229 | | |
230 | 230 | | |
231 | 231 | | |
| |||
0 commit comments