@@ -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 ) {
@@ -184,16 +184,16 @@ export const vectors = {
184184 Object . keys ( config ) . length === 0
185185 ? undefined
186186 : {
187- ...config ,
188- audioFields : audioFields ?. map ( ( f ) => f . name ) ,
189- depthFields : depthFields ?. map ( ( f ) => f . name ) ,
190- imageFields : imageFields ?. map ( ( f ) => f . name ) ,
191- IMUFields : IMUFields ?. map ( ( f ) => f . name ) ,
192- textFields : textFields ?. map ( ( f ) => f . name ) ,
193- thermalFields : thermalFields ?. map ( ( f ) => f . name ) ,
194- videoFields : videoFields ?. map ( ( f ) => f . name ) ,
195- weights : Object . keys ( weights ) . length === 0 ? undefined : weights ,
196- } ,
187+ ...config ,
188+ audioFields : audioFields ?. map ( ( f ) => f . name ) ,
189+ depthFields : depthFields ?. map ( ( f ) => f . name ) ,
190+ imageFields : imageFields ?. map ( ( f ) => f . name ) ,
191+ IMUFields : IMUFields ?. map ( ( f ) => f . name ) ,
192+ textFields : textFields ?. map ( ( f ) => f . name ) ,
193+ thermalFields : thermalFields ?. map ( ( f ) => f . name ) ,
194+ videoFields : videoFields ?. map ( ( f ) => f . name ) ,
195+ weights : Object . keys ( weights ) . length === 0 ? undefined : weights ,
196+ } ,
197197 } ,
198198 } ) ;
199199 } ,
@@ -223,11 +223,11 @@ export const vectors = {
223223 Object . keys ( config ) . length === 0
224224 ? undefined
225225 : {
226- ...config ,
227- imageFields : imageFields ?. map ( ( f ) => f . name ) ,
228- textFields : textFields ?. map ( ( f ) => f . name ) ,
229- weights : Object . keys ( weights ) . length === 0 ? undefined : weights ,
230- } ,
226+ ...config ,
227+ imageFields : imageFields ?. map ( ( f ) => f . name ) ,
228+ textFields : textFields ?. map ( ( f ) => f . name ) ,
229+ weights : Object . keys ( weights ) . length === 0 ? undefined : weights ,
230+ } ,
231231 } ,
232232 } ) ;
233233 } ,
@@ -257,32 +257,11 @@ export const vectors = {
257257 Object . keys ( config ) . length === 0
258258 ? undefined
259259 : {
260- ...config ,
261- imageFields : imageFields ?. map ( ( f ) => f . name ) ,
262- textFields : textFields ?. map ( ( f ) => f . name ) ,
263- weights : Object . keys ( weights ) . length === 0 ? undefined : weights ,
264- } ,
265- } ,
266- } ) ;
267- } ,
268-
269- /**
270- * Create a `VectorConfigCreate` object with the vectorizer set to `'multi2vec-jinaai'`.
271- *
272- * See the [documentation](https://weaviate.io/developers/weaviate/model-providers/jinaai/embeddings-multimodal) for detailed usage.
273- *
274- * @param {ConfigureNonTextVectorizerOptions<N, I, 'multi2multivec-jinaai'> } [opts] The configuration options for the `multi2multivec-jinaai` vectorizer.
275- * @returns {VectorConfigCreate<PrimitiveKeys<T>[], N, I, 'multi2multivec-jinaai'> } The configuration object.
276- */
277- multi2MultivecJinaAI : < N extends string | undefined = undefined , I extends VectorIndexType = 'hnsw' > (
278- opts ?: ConfigureNonTextVectorizerOptions < N , I , 'multi2multivec-jinaai' >
279- ) : VectorConfigCreate < never , N , I , 'multi2multivec-jinaai' > => {
280- const { name, vectorIndexConfig, ...config } = opts || { } ;
281- return makeVectorizer ( name , {
282- vectorIndexConfig,
283- vectorizerConfig : {
284- name : 'multi2multivec-jinaai' ,
285- config,
260+ ...config ,
261+ imageFields : imageFields ?. map ( ( f ) => f . name ) ,
262+ textFields : textFields ?. map ( ( f ) => f . name ) ,
263+ weights : Object . keys ( weights ) . length === 0 ? undefined : weights ,
264+ } ,
286265 } ,
287266 } ) ;
288267 } ,
@@ -313,11 +292,11 @@ export const vectors = {
313292 Object . keys ( config ) . length === 0
314293 ? undefined
315294 : {
316- ...config ,
317- imageFields : imageFields ?. map ( ( f ) => f . name ) ,
318- textFields : textFields ?. map ( ( f ) => f . name ) ,
319- weights : Object . keys ( weights ) . length === 0 ? undefined : weights ,
320- } ,
295+ ...config ,
296+ imageFields : imageFields ?. map ( ( f ) => f . name ) ,
297+ textFields : textFields ?. map ( ( f ) => f . name ) ,
298+ weights : Object . keys ( weights ) . length === 0 ? undefined : weights ,
299+ } ,
321300 } ,
322301 } ) ;
323302 } ,
@@ -417,11 +396,11 @@ export const vectors = {
417396 Object . keys ( config ) . length === 0
418397 ? undefined
419398 : {
420- ...config ,
421- imageFields : imageFields ?. map ( ( f ) => f . name ) ,
422- textFields : textFields ?. map ( ( f ) => f . name ) ,
423- weights : Object . keys ( weights ) . length === 0 ? undefined : weights ,
424- } ,
399+ ...config ,
400+ imageFields : imageFields ?. map ( ( f ) => f . name ) ,
401+ textFields : textFields ?. map ( ( f ) => f . name ) ,
402+ weights : Object . keys ( weights ) . length === 0 ? undefined : weights ,
403+ } ,
425404 } ,
426405 } ) ;
427406 } ,
@@ -870,4 +849,25 @@ export const multiVectors = {
870849 true
871850 ) ;
872851 } ,
852+
853+ /**
854+ * Create a `VectorConfigCreate` object with the vectorizer set to `'multi2multivec-jinaai'`.
855+ *
856+ * See the [documentation](https://weaviate.io/developers/weaviate/model-providers/jinaai/embeddings-multimodal) for detailed usage.
857+ *
858+ * @param {ConfigureNonTextVectorizerOptions<N, I, 'multi2multivec-jinaai'> } [opts] The configuration options for the `multi2multivec-jinaai` vectorizer.
859+ * @returns {VectorConfigCreate<PrimitiveKeys<T>[], N, I, 'multi2multivec-jinaai'> } The configuration object.
860+ */
861+ multi2MultivecJinaAI : < N extends string | undefined = undefined , I extends VectorIndexType = 'hnsw' > (
862+ opts ?: ConfigureNonTextVectorizerOptions < N , I , 'multi2multivec-jinaai' >
863+ ) : VectorConfigCreate < never , N , I , 'multi2multivec-jinaai' > => {
864+ const { name, vectorIndexConfig, ...config } = opts || { } ;
865+ return makeVectorizer ( name , {
866+ vectorIndexConfig,
867+ vectorizerConfig : {
868+ name : 'multi2multivec-jinaai' ,
869+ config,
870+ } ,
871+ } ) ;
872+ } ,
873873} ;
0 commit comments