@@ -77,7 +77,7 @@ class GenerateManager<T, V> implements Generate<T, V> {
7777 opts ?: FetchObjectsOptions < T , V >
7878 ) : Promise < GenerativeReturn < T , V , C > > {
7979 return Promise . all ( [
80- this . check . fetchObjects ( opts ) ,
80+ this . check . fetchObjects ( ) ,
8181 this . check . supportForSingleGroupedGenerative ( ) ,
8282 this . check . supportForGenerativeConfigRuntime ( generate . config ) ,
8383 ] )
@@ -116,7 +116,7 @@ class GenerateManager<T, V> implements Generate<T, V> {
116116 C extends GenerativeConfigRuntime | undefined = undefined
117117 > ( query : string , generate : GenerateOptions < T , C > , opts ?: Bm25Options < T , I > ) : GenerateReturn < T , RV , C > {
118118 return Promise . all ( [
119- this . check . bm25 ( opts ) ,
119+ this . check . bm25 ( ) ,
120120 this . check . supportForSingleGroupedGenerative ( ) ,
121121 this . check . supportForGenerativeConfigRuntime ( generate . config ) ,
122122 ] )
@@ -159,27 +159,19 @@ class GenerateManager<T, V> implements Generate<T, V> {
159159 this . check . supportForSingleGroupedGenerative ( ) ,
160160 this . check . supportForGenerativeConfigRuntime ( generate . config ) ,
161161 ] )
162- . then (
163- async ( [
164- { search, supportsTargets, supportsVectorsForTargets, supportsWeightsForTargets, supportsVectors } ,
165- supportsSingleGrouped ,
166- ] ) => ( {
167- search,
168- args : {
169- ...( await Serialize . search . hybrid (
170- {
171- query,
172- supportsTargets,
173- supportsVectorsForTargets,
174- supportsWeightsForTargets,
175- supportsVectors,
176- } ,
177- opts
178- ) ) ,
179- generative : await Serialize . generative ( { supportsSingleGrouped } , generate ) ,
180- } ,
181- } )
182- )
162+ . then ( async ( [ { search, supportsVectors } , supportsSingleGrouped ] ) => ( {
163+ search,
164+ args : {
165+ ...( await Serialize . search . hybrid (
166+ {
167+ query,
168+ supportsVectors,
169+ } ,
170+ opts
171+ ) ) ,
172+ generative : await Serialize . generative ( { supportsSingleGrouped } , generate ) ,
173+ } ,
174+ } ) )
183175 . then ( ( { search, args } ) => search . withHybrid ( args ) )
184176 . then ( ( reply ) => this . parseGroupByReply ( opts , reply ) ) ;
185177 }
@@ -212,18 +204,16 @@ class GenerateManager<T, V> implements Generate<T, V> {
212204 opts ?: NearOptions < T , V , I >
213205 ) : GenerateReturn < T , RV , C > {
214206 return Promise . all ( [
215- this . check . nearSearch ( opts ) ,
207+ this . check . nearSearch ( ) ,
216208 this . check . supportForSingleGroupedGenerative ( ) ,
217209 this . check . supportForGenerativeConfigRuntime ( generate . config ) ,
218210 ] )
219- . then ( async ( [ { search, supportsTargets , supportsWeightsForTargets } , supportsSingleGrouped ] ) => ( {
211+ . then ( async ( [ { search } , supportsSingleGrouped ] ) => ( {
220212 search,
221213 args : {
222214 ...Serialize . search . nearImage (
223215 {
224216 image : await toBase64FromMedia ( image ) ,
225- supportsTargets,
226- supportsWeightsForTargets,
227217 } ,
228218 opts
229219 ) ,
@@ -258,18 +248,16 @@ class GenerateManager<T, V> implements Generate<T, V> {
258248 C extends GenerativeConfigRuntime | undefined = undefined
259249 > ( id : string , generate : GenerateOptions < T , C > , opts ?: NearOptions < T , V , I > ) : GenerateReturn < T , RV , C > {
260250 return Promise . all ( [
261- this . check . nearSearch ( opts ) ,
251+ this . check . nearSearch ( ) ,
262252 this . check . supportForSingleGroupedGenerative ( ) ,
263253 this . check . supportForGenerativeConfigRuntime ( generate . config ) ,
264254 ] )
265- . then ( async ( [ { search, supportsTargets , supportsWeightsForTargets } , supportsSingleGrouped ] ) => ( {
255+ . then ( async ( [ { search } , supportsSingleGrouped ] ) => ( {
266256 search,
267257 args : {
268258 ...Serialize . search . nearObject (
269259 {
270260 id,
271- supportsTargets,
272- supportsWeightsForTargets,
273261 } ,
274262 opts
275263 ) ,
@@ -308,18 +296,16 @@ class GenerateManager<T, V> implements Generate<T, V> {
308296 opts ?: NearOptions < T , V , I >
309297 ) : GenerateReturn < T , RV , C > {
310298 return Promise . all ( [
311- this . check . nearSearch ( opts ) ,
299+ this . check . nearSearch ( ) ,
312300 this . check . supportForSingleGroupedGenerative ( ) ,
313301 this . check . supportForGenerativeConfigRuntime ( generate . config ) ,
314302 ] )
315- . then ( async ( [ { search, supportsTargets , supportsWeightsForTargets } , supportsSingleGrouped ] ) => ( {
303+ . then ( async ( [ { search } , supportsSingleGrouped ] ) => ( {
316304 search,
317305 args : {
318306 ...Serialize . search . nearText (
319307 {
320308 query,
321- supportsTargets,
322- supportsWeightsForTargets,
323309 } ,
324310 opts
325311 ) ,
@@ -362,27 +348,19 @@ class GenerateManager<T, V> implements Generate<T, V> {
362348 this . check . supportForSingleGroupedGenerative ( ) ,
363349 this . check . supportForGenerativeConfigRuntime ( generate . config ) ,
364350 ] )
365- . then (
366- async ( [
367- { search, supportsTargets, supportsVectorsForTargets, supportsWeightsForTargets, supportsVectors } ,
368- supportsSingleGrouped ,
369- ] ) => ( {
370- search,
371- args : {
372- ...( await Serialize . search . nearVector (
373- {
374- vector,
375- supportsTargets,
376- supportsVectorsForTargets,
377- supportsWeightsForTargets,
378- supportsVectors,
379- } ,
380- opts
381- ) ) ,
382- generative : await Serialize . generative ( { supportsSingleGrouped } , generate ) ,
383- } ,
384- } )
385- )
351+ . then ( async ( [ { search, supportsVectors } , supportsSingleGrouped ] ) => ( {
352+ search,
353+ args : {
354+ ...( await Serialize . search . nearVector (
355+ {
356+ vector,
357+ supportsVectors,
358+ } ,
359+ opts
360+ ) ) ,
361+ generative : await Serialize . generative ( { supportsSingleGrouped } , generate ) ,
362+ } ,
363+ } ) )
386364 . then ( ( { search, args } ) => search . withNearVector ( args ) )
387365 . then ( ( reply ) => this . parseGroupByReply ( opts , reply ) ) ;
388366 }
@@ -418,56 +396,52 @@ class GenerateManager<T, V> implements Generate<T, V> {
418396 opts ?: NearOptions < T , V , I >
419397 ) : GenerateReturn < T , RV , C > {
420398 return Promise . all ( [
421- this . check . nearSearch ( opts ) ,
399+ this . check . nearSearch ( ) ,
422400 this . check . supportForSingleGroupedGenerative ( ) ,
423401 this . check . supportForGenerativeConfigRuntime ( generate . config ) ,
424402 ] )
425- . then ( ( [ { search, supportsTargets, supportsWeightsForTargets } , supportsSingleGrouped ] ) => {
426- const args = {
427- supportsTargets,
428- supportsWeightsForTargets,
429- } ;
403+ . then ( ( [ { search } , supportsSingleGrouped ] ) => {
430404 let send : ( media : string , generative : GenerativeSearch ) => Promise < SearchReply > ;
431405 switch ( type ) {
432406 case 'audio' :
433407 send = ( media , generative ) =>
434408 search . withNearAudio ( {
435- ...Serialize . search . nearAudio ( { audio : media , ... args } , opts ) ,
409+ ...Serialize . search . nearAudio ( { audio : media } , opts ) ,
436410 generative,
437411 } ) ;
438412 break ;
439413 case 'depth' :
440414 send = ( media , generative ) =>
441415 search . withNearDepth ( {
442- ...Serialize . search . nearDepth ( { depth : media , ... args } , opts ) ,
416+ ...Serialize . search . nearDepth ( { depth : media } , opts ) ,
443417 generative,
444418 } ) ;
445419 break ;
446420 case 'image' :
447421 send = ( media , generative ) =>
448422 search . withNearImage ( {
449- ...Serialize . search . nearImage ( { image : media , ... args } , opts ) ,
423+ ...Serialize . search . nearImage ( { image : media } , opts ) ,
450424 generative,
451425 } ) ;
452426 break ;
453427 case 'imu' :
454428 send = ( media , generative ) =>
455429 search . withNearIMU ( {
456- ...Serialize . search . nearIMU ( { imu : media , ... args } , opts ) ,
430+ ...Serialize . search . nearIMU ( { imu : media } , opts ) ,
457431 generative,
458432 } ) ;
459433 break ;
460434 case 'thermal' :
461435 send = ( media , generative ) =>
462436 search . withNearThermal ( {
463- ...Serialize . search . nearThermal ( { thermal : media , ... args } , opts ) ,
437+ ...Serialize . search . nearThermal ( { thermal : media } , opts ) ,
464438 generative,
465439 } ) ;
466440 break ;
467441 case 'video' :
468442 send = ( media , generative ) =>
469443 search . withNearVideo ( {
470- ...Serialize . search . nearVideo ( { video : media , ... args } ) ,
444+ ...Serialize . search . nearVideo ( { video : media } ) ,
471445 generative,
472446 } ) ;
473447 break ;
0 commit comments