Commit c07c9b2
authored
INTPYTHON-838 Allow additional arguments to vector_search_index_definition (#267)
This pull request adds support for passing custom vector index options
throughout the vector search index creation and update workflows in the
MongoDB integration. This enhancement allows users to specify additional
parameters for vector index configuration, increasing flexibility and
control over index behavior.
Enhancements to vector index configuration:
* Added a new `vector_index_options` parameter to the
`_vector_search_index_definition`, `create_vector_search_index`, and
`update_vector_search_index` functions in `index.py`, enabling custom
options to be merged into the index definition.
[[1]](diffhunk://#diff-ded4d757aa6ceaa72da4d733902d2754b87d8e30294ac133b52d93345a2a6492R18-R29)
[[2]](diffhunk://#diff-ded4d757aa6ceaa72da4d733902d2754b87d8e30294ac133b52d93345a2a6492R47)
[[3]](diffhunk://#diff-ded4d757aa6ceaa72da4d733902d2754b87d8e30294ac133b52d93345a2a6492R79)
[[4]](diffhunk://#diff-ded4d757aa6ceaa72da4d733902d2754b87d8e30294ac133b52d93345a2a6492R130)
[[5]](diffhunk://#diff-ded4d757aa6ceaa72da4d733902d2754b87d8e30294ac133b52d93345a2a6492R160)
* Updated the `MongoDBAtlasVectorSearch` class in `vectorstores.py` to
accept and forward the `vector_index_options` parameter during
initialization and index creation, ensuring consistent propagation of
custom options.
[[1]](diffhunk://#diff-6dc2a6cf887e0d19be789087d31e249730d5f33112e0f784defb71eb92ad2a4eR215)
[[2]](diffhunk://#diff-6dc2a6cf887e0d19be789087d31e249730d5f33112e0f784defb71eb92ad2a4eR260)
[[3]](diffhunk://#diff-6dc2a6cf887e0d19be789087d31e249730d5f33112e0f784defb71eb92ad2a4eR846)
[[4]](diffhunk://#diff-6dc2a6cf887e0d19be789087d31e249730d5f33112e0f784defb71eb92ad2a4eR885)[Issue
Key](https://jira.mongodb.org/browse/{ISSUE_KEY})1 parent cce6df2 commit c07c9b2
File tree
2 files changed
+7
-0
lines changed- libs/langchain-mongodb/langchain_mongodb
2 files changed
+7
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| 23 | + | |
23 | 24 | | |
24 | 25 | | |
25 | 26 | | |
| 27 | + | |
26 | 28 | | |
27 | 29 | | |
28 | 30 | | |
29 | 31 | | |
30 | 32 | | |
31 | 33 | | |
| 34 | + | |
32 | 35 | | |
33 | 36 | | |
34 | 37 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
213 | 213 | | |
214 | 214 | | |
215 | 215 | | |
| 216 | + | |
216 | 217 | | |
217 | 218 | | |
218 | 219 | | |
| |||
257 | 258 | | |
258 | 259 | | |
259 | 260 | | |
| 261 | + | |
260 | 262 | | |
261 | 263 | | |
262 | 264 | | |
| |||
829 | 831 | | |
830 | 832 | | |
831 | 833 | | |
| 834 | + | |
832 | 835 | | |
833 | 836 | | |
834 | 837 | | |
| |||
867 | 870 | | |
868 | 871 | | |
869 | 872 | | |
| 873 | + | |
870 | 874 | | |
871 | 875 | | |
872 | 876 | | |
| |||
0 commit comments