@@ -324,31 +324,58 @@ class DenseVectorIndexOptions(AttrDict[Any]):
324324 `int4_flat` index types.
325325 :arg ef_construction: The number of candidates to track while
326326 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.
329329 :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.
332335 """
333336
334337 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+ ],
336348 DefaultType ,
337349 ]
338350 confidence_interval : Union [float , DefaultType ]
339351 ef_construction : Union [int , DefaultType ]
340352 m : Union [int , DefaultType ]
353+ rescore_vector : Union [
354+ "DenseVectorIndexOptionsRescoreVector" , Dict [str , Any ], DefaultType
355+ ]
341356
342357 def __init__ (
343358 self ,
344359 * ,
345360 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+ ],
347371 DefaultType ,
348372 ] = DEFAULT ,
349373 confidence_interval : Union [float , DefaultType ] = DEFAULT ,
350374 ef_construction : Union [int , DefaultType ] = DEFAULT ,
351375 m : Union [int , DefaultType ] = DEFAULT ,
376+ rescore_vector : Union [
377+ "DenseVectorIndexOptionsRescoreVector" , Dict [str , Any ], DefaultType
378+ ] = DEFAULT ,
352379 ** kwargs : Any ,
353380 ):
354381 if type is not DEFAULT :
@@ -359,6 +386,29 @@ def __init__(
359386 kwargs ["ef_construction" ] = ef_construction
360387 if m is not DEFAULT :
361388 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
362412 super ().__init__ (kwargs )
363413
364414
0 commit comments