@@ -37,20 +37,20 @@ const makeVectorIndex = (opts?: {
3737 }
3838 conf = conf
3939 ? {
40- ...conf ,
41- multiVector : conf . multiVector
42- ? {
43- ...conf . multiVector ,
44- encoding : conf . multiVector . encoding
45- ? { ...conf . multiVector . encoding , ...opts . encoding }
46- : opts . encoding ,
47- }
48- : vectorIndex . multiVector . multiVector ( { encoding : opts . encoding } ) ,
49- }
40+ ...conf ,
41+ multiVector : conf . multiVector
42+ ? {
43+ ...conf . multiVector ,
44+ encoding : conf . multiVector . encoding
45+ ? { ...conf . multiVector . encoding , ...opts . encoding }
46+ : opts . encoding ,
47+ }
48+ : vectorIndex . multiVector . multiVector ( { encoding : opts . encoding } ) ,
49+ }
5050 : {
51- multiVector : vectorIndex . multiVector . multiVector ( { encoding : opts . encoding } ) ,
52- type : 'hnsw' ,
53- } ;
51+ multiVector : vectorIndex . multiVector . multiVector ( { encoding : opts . encoding } ) ,
52+ type : 'hnsw' ,
53+ } ;
5454 }
5555 if ( opts ?. quantizer ) {
5656 if ( ! conf ) {
@@ -201,16 +201,16 @@ export const legacyVectors = {
201201 Object . keys ( config ) . length === 0
202202 ? undefined
203203 : {
204- ...config ,
205- audioFields : audioFields ?. map ( ( f ) => f . name ) ,
206- depthFields : depthFields ?. map ( ( f ) => f . name ) ,
207- imageFields : imageFields ?. map ( ( f ) => f . name ) ,
208- IMUFields : IMUFields ?. map ( ( f ) => f . name ) ,
209- textFields : textFields ?. map ( ( f ) => f . name ) ,
210- thermalFields : thermalFields ?. map ( ( f ) => f . name ) ,
211- videoFields : videoFields ?. map ( ( f ) => f . name ) ,
212- weights : Object . keys ( weights ) . length === 0 ? undefined : weights ,
213- } ,
204+ ...config ,
205+ audioFields : audioFields ?. map ( ( f ) => f . name ) ,
206+ depthFields : depthFields ?. map ( ( f ) => f . name ) ,
207+ imageFields : imageFields ?. map ( ( f ) => f . name ) ,
208+ IMUFields : IMUFields ?. map ( ( f ) => f . name ) ,
209+ textFields : textFields ?. map ( ( f ) => f . name ) ,
210+ thermalFields : thermalFields ?. map ( ( f ) => f . name ) ,
211+ videoFields : videoFields ?. map ( ( f ) => f . name ) ,
212+ weights : Object . keys ( weights ) . length === 0 ? undefined : weights ,
213+ } ,
214214 } ,
215215 } ) ;
216216 } ,
@@ -240,11 +240,11 @@ export const legacyVectors = {
240240 Object . keys ( config ) . length === 0
241241 ? undefined
242242 : {
243- ...config ,
244- imageFields : imageFields ?. map ( ( f ) => f . name ) ,
245- textFields : textFields ?. map ( ( f ) => f . name ) ,
246- weights : Object . keys ( weights ) . length === 0 ? undefined : weights ,
247- } ,
243+ ...config ,
244+ imageFields : imageFields ?. map ( ( f ) => f . name ) ,
245+ textFields : textFields ?. map ( ( f ) => f . name ) ,
246+ weights : Object . keys ( weights ) . length === 0 ? undefined : weights ,
247+ } ,
248248 } ,
249249 } ) ;
250250 } ,
@@ -274,11 +274,11 @@ export const legacyVectors = {
274274 Object . keys ( config ) . length === 0
275275 ? undefined
276276 : {
277- ...config ,
278- imageFields : imageFields ?. map ( ( f ) => f . name ) ,
279- textFields : textFields ?. map ( ( f ) => f . name ) ,
280- weights : Object . keys ( weights ) . length === 0 ? undefined : weights ,
281- } ,
277+ ...config ,
278+ imageFields : imageFields ?. map ( ( f ) => f . name ) ,
279+ textFields : textFields ?. map ( ( f ) => f . name ) ,
280+ weights : Object . keys ( weights ) . length === 0 ? undefined : weights ,
281+ } ,
282282 } ,
283283 } ) ;
284284 } ,
@@ -309,11 +309,11 @@ export const legacyVectors = {
309309 Object . keys ( config ) . length === 0
310310 ? undefined
311311 : {
312- ...config ,
313- imageFields : imageFields ?. map ( ( f ) => f . name ) ,
314- textFields : textFields ?. map ( ( f ) => f . name ) ,
315- weights : Object . keys ( weights ) . length === 0 ? undefined : weights ,
316- } ,
312+ ...config ,
313+ imageFields : imageFields ?. map ( ( f ) => f . name ) ,
314+ textFields : textFields ?. map ( ( f ) => f . name ) ,
315+ weights : Object . keys ( weights ) . length === 0 ? undefined : weights ,
316+ } ,
317317 } ,
318318 } ) ;
319319 } ,
@@ -413,11 +413,11 @@ export const legacyVectors = {
413413 Object . keys ( config ) . length === 0
414414 ? undefined
415415 : {
416- ...config ,
417- imageFields : imageFields ?. map ( ( f ) => f . name ) ,
418- textFields : textFields ?. map ( ( f ) => f . name ) ,
419- weights : Object . keys ( weights ) . length === 0 ? undefined : weights ,
420- } ,
416+ ...config ,
417+ imageFields : imageFields ?. map ( ( f ) => f . name ) ,
418+ textFields : textFields ?. map ( ( f ) => f . name ) ,
419+ weights : Object . keys ( weights ) . length === 0 ? undefined : weights ,
420+ } ,
421421 } ,
422422 } ) ;
423423 } ,
@@ -814,9 +814,9 @@ export const legacyVectors = {
814814} ;
815815
816816/** __vectors_shaded modifies some parameters in legacy vectorizer configuration.
817- *
818- * - Hide `vectorizeCollectionName` parameter from all constructors in `legacyVectors` where it was previously accepted.
819- * - Rename `modelId` to `model` for `text2vec-google` and `multi2vec-google` vectorizers.
817+ *
818+ * - Hide `vectorizeCollectionName` parameter from all constructors in `legacyVectors` where it was previously accepted.
819+ * - Rename `modelId` to `model` for `text2vec-google` and `multi2vec-google` vectorizers.
820820 * */
821821// eslint-disable-next-line @typescript-eslint/naming-convention
822822const __vectors_shaded = {
@@ -840,7 +840,15 @@ const __vectors_shaded = {
840840 model ?: string ;
841841 modelId ?: never ; // hard-deprecated in `vectors`
842842 }
843- ) => legacyVectors . text2VecGoogle ( { ...opts , modelId : opts ?. modelId || opts ?. model } ) ,
843+ ) =>
844+ legacyVectors . text2VecGoogle (
845+ opts
846+ ? {
847+ ...opts ,
848+ ...( opts ?. modelId || opts ?. model ? { modelId : opts ?. modelId || opts ?. model } : undefined ) ,
849+ }
850+ : undefined
851+ ) ,
844852 text2VecOpenAI : < T , N extends string | undefined = undefined , I extends VectorIndexType = 'hnsw' > (
845853 opts ?: Omit < ConfigureTextVectorizerOptions < T , N , I , 'text2vec-openai' > , 'vectorizeCollectionName' >
846854 ) => legacyVectors . text2VecOpenAI ( opts ) ,
@@ -902,7 +910,9 @@ export const vectorizer = legacyVectors;
902910// Remove deprecated vectorizers and module configuration parameters:
903911// - PaLM vectorizers are called -Google now.
904912// - __vectors_shaded hide/rename some parameters
905- export const vectors = ( ( { text2VecPalm, multi2VecPalm, ...rest } ) => ( { ...rest , ...__vectors_shaded } ) ) ( legacyVectors ) ;
913+ export const vectors = ( ( { text2VecPalm, multi2VecPalm, ...rest } ) => ( { ...rest , ...__vectors_shaded } ) ) (
914+ legacyVectors
915+ ) ;
906916
907917export const multiVectors = {
908918 /**
0 commit comments