@@ -16,8 +16,6 @@ import {
1616 VectorIndexConfigHNSWUpdate ,
1717} from './types/index.js' ;
1818
19- import { parseQuantizer } from './parsing.js' ;
20-
2119const isModuleConfig = < N , C > ( config : ModuleConfig < N , C > | C ) : config is ModuleConfig < N , C > => {
2220 return config && typeof config === 'object' && 'name' in config && 'config' in config ;
2321} ;
@@ -40,7 +38,7 @@ const configure = {
4038 config : {
4139 distance,
4240 vectorCacheMaxObjects,
43- quantizer : parseQuantizer ( quantizer ) ,
41+ quantizer : quantizer ,
4442 } ,
4543 } ;
4644 } ,
@@ -62,7 +60,7 @@ const configure = {
6260 ? {
6361 ...rest ,
6462 distance : distanceMetric ,
65- quantizer : parseQuantizer ( rest . quantizer ) ,
63+ quantizer : rest . quantizer ,
6664 }
6765 : undefined ,
6866 } ;
@@ -177,10 +175,7 @@ const reconfigure = {
177175 } ) : ModuleConfig < 'flat' , VectorIndexConfigFlatUpdate > => {
178176 return {
179177 name : 'flat' ,
180- config : {
181- vectorCacheMaxObjects : options . vectorCacheMaxObjects ,
182- quantizer : parseQuantizer ( options . quantizer ) ,
183- } ,
178+ config : options ,
184179 } ;
185180 } ,
186181 /**
@@ -221,8 +216,8 @@ const reconfigure = {
221216 * NOTE: If the vector index already has a quantizer configured, you cannot change its quantizer type; only its values.
222217 * So if you want to change the quantizer type, you must recreate the collection.
223218 *
224- * @param {boolean } [options.cache] Whether to cache the quantizer. Default is false.
225- * @param {number } [options.rescoreLimit] The rescore limit. Default is 1000 .
219+ * @param {boolean } [options.cache] Whether to cache the quantizer.
220+ * @param {number } [options.rescoreLimit] The new rescore limit.
226221 * @returns {BQConfigCreate } The configuration object.
227222 */
228223 bq : ( options ?: { cache ?: boolean ; rescoreLimit ?: number } ) : BQConfigUpdate => {
@@ -237,11 +232,11 @@ const reconfigure = {
237232 * NOTE: If the vector index already has a quantizer configured, you cannot change its quantizer type; only its values.
238233 * So if you want to change the quantizer type, you must recreate the collection.
239234 *
240- * @param {number } [options.centroids] The number of centroids. Default is 256 .
241- * @param {PQEncoderDistribution } [options.pqEncoderDistribution] The encoder distribution. Default is 'log-normal' .
242- * @param {PQEncoderType } [options.pqEncoderType] The encoder type. Default is 'kmeans' .
243- * @param {number } [options.segments] The number of segments. Default is 0 .
244- * @param {number } [options.trainingLimit] The training limit. Default is 100000 .
235+ * @param {number } [options.centroids] The new number of centroids.
236+ * @param {PQEncoderDistribution } [options.pqEncoderDistribution] The new encoder distribution.
237+ * @param {PQEncoderType } [options.pqEncoderType] The new encoder type.
238+ * @param {number } [options.segments] The new number of segments.
239+ * @param {number } [options.trainingLimit] The new training limit.
245240 * @returns {PQConfigUpdate } The configuration object.
246241 */
247242 pq : ( options ?: {
@@ -270,8 +265,8 @@ const reconfigure = {
270265 * NOTE: If the vector index already has a quantizer configured, you cannot change its quantizer type; only its values.
271266 * So if you want to change the quantizer type, you must recreate the collection.
272267 *
273- * @param {number } [options.rescoreLimit] The rescore limit. Default is 1000.
274- * @param {number } [options.trainingLimit] The training limit. Default is 100000.
268+ * @param {number } [options.rescoreLimit] The rescore limit.
269+ * @param {number } [options.trainingLimit] The training limit.
275270 * @returns {SQConfigUpdate } The configuration object.
276271 */
277272 sq : ( options ?: { rescoreLimit ?: number ; trainingLimit ?: number } ) : SQConfigUpdate => {
0 commit comments