@@ -324,31 +324,58 @@ class DenseVectorIndexOptions(AttrDict[Any]):
324
324
`int4_flat` index types.
325
325
:arg ef_construction: The number of candidates to track while
326
326
assembling the list of nearest neighbors for each new node. Only
327
- applicable to `hnsw`, `int8_hnsw`, and `int4_hnsw` index types.
328
- Defaults to `100` if omitted.
327
+ applicable to `hnsw`, `int8_hnsw`, `bbq_hnsw`, and `int4_hnsw`
328
+ index types. Defaults to `100` if omitted.
329
329
:arg m: The number of neighbors each node will be connected to in the
330
- HNSW graph. Only applicable to `hnsw`, `int8_hnsw`, and
331
- `int4_hnsw` index types. Defaults to `16` if omitted.
330
+ HNSW graph. Only applicable to `hnsw`, `int8_hnsw`, `bbq_hnsw`,
331
+ and `int4_hnsw` index types. Defaults to `16` if omitted.
332
+ :arg rescore_vector: The rescore vector options. This is only
333
+ applicable to `bbq_hnsw`, `int4_hnsw`, `int8_hnsw`, `bbq_flat`,
334
+ `int4_flat`, and `int8_flat` index types.
332
335
"""
333
336
334
337
type : Union [
335
- Literal ["flat" , "hnsw" , "int4_flat" , "int4_hnsw" , "int8_flat" , "int8_hnsw" ],
338
+ Literal [
339
+ "bbq_flat" ,
340
+ "bbq_hnsw" ,
341
+ "flat" ,
342
+ "hnsw" ,
343
+ "int4_flat" ,
344
+ "int4_hnsw" ,
345
+ "int8_flat" ,
346
+ "int8_hnsw" ,
347
+ ],
336
348
DefaultType ,
337
349
]
338
350
confidence_interval : Union [float , DefaultType ]
339
351
ef_construction : Union [int , DefaultType ]
340
352
m : Union [int , DefaultType ]
353
+ rescore_vector : Union [
354
+ "DenseVectorIndexOptionsRescoreVector" , Dict [str , Any ], DefaultType
355
+ ]
341
356
342
357
def __init__ (
343
358
self ,
344
359
* ,
345
360
type : Union [
346
- Literal ["flat" , "hnsw" , "int4_flat" , "int4_hnsw" , "int8_flat" , "int8_hnsw" ],
361
+ Literal [
362
+ "bbq_flat" ,
363
+ "bbq_hnsw" ,
364
+ "flat" ,
365
+ "hnsw" ,
366
+ "int4_flat" ,
367
+ "int4_hnsw" ,
368
+ "int8_flat" ,
369
+ "int8_hnsw" ,
370
+ ],
347
371
DefaultType ,
348
372
] = DEFAULT ,
349
373
confidence_interval : Union [float , DefaultType ] = DEFAULT ,
350
374
ef_construction : Union [int , DefaultType ] = DEFAULT ,
351
375
m : Union [int , DefaultType ] = DEFAULT ,
376
+ rescore_vector : Union [
377
+ "DenseVectorIndexOptionsRescoreVector" , Dict [str , Any ], DefaultType
378
+ ] = DEFAULT ,
352
379
** kwargs : Any ,
353
380
):
354
381
if type is not DEFAULT :
@@ -359,6 +386,29 @@ def __init__(
359
386
kwargs ["ef_construction" ] = ef_construction
360
387
if m is not DEFAULT :
361
388
kwargs ["m" ] = m
389
+ if rescore_vector is not DEFAULT :
390
+ kwargs ["rescore_vector" ] = rescore_vector
391
+ super ().__init__ (kwargs )
392
+
393
+
394
+ class DenseVectorIndexOptionsRescoreVector (AttrDict [Any ]):
395
+ """
396
+ :arg oversample: (required) The oversampling factor to use when
397
+ searching for the nearest neighbor. This is only applicable to the
398
+ quantized formats: `bbq_*`, `int4_*`, and `int8_*`. When provided,
399
+ `oversample * k` vectors will be gathered and then their scores
400
+ will be re-computed with the original vectors. valid values are
401
+ between `1.0` and `10.0` (inclusive), or `0` exactly to disable
402
+ oversampling.
403
+ """
404
+
405
+ oversample : Union [float , DefaultType ]
406
+
407
+ def __init__ (
408
+ self , * , oversample : Union [float , DefaultType ] = DEFAULT , ** kwargs : Any
409
+ ):
410
+ if oversample is not DEFAULT :
411
+ kwargs ["oversample" ] = oversample
362
412
super ().__init__ (kwargs )
363
413
364
414
0 commit comments