@@ -632,11 +632,7 @@ export async function fetchResultsByUuids(
632632}
633633
634634export async function fetchResultByUuid (
635- identifier : string ,
636- query ?: string ,
637- alpha ?: number ,
638- maxVectorDistance ?: number ,
639- maxDistanceMode : "max_distance" | "min_score" | "both" = "min_score"
635+ identifier : string
640636) : Promise < SearchResult > {
641637 console . log ( `🔗 API CALL: fetchResultByUuid(${ identifier } )` ) ;
642638 const params = new URLSearchParams ( ) ;
@@ -653,26 +649,7 @@ export async function fetchResultByUuid(
653649 params . set ( "slug" , identifier ) ;
654650 }
655651
656- // Append query parameter if provided
657- if ( query && query . trim ( ) ) {
658- params . set ( "query" , query . trim ( ) ) ;
659- }
660-
661- // Append alpha parameter if provided
662- if ( alpha !== undefined ) {
663- params . set ( "alpha" , alpha . toString ( ) ) ;
664- }
665-
666- // Add max_vector_distance and/or min_original_vector_score based on mode
667- // Always send these parameters (use default 0.4 if not provided)
668- const distanceValue = maxVectorDistance !== undefined ? maxVectorDistance : 0.4 ;
669- if ( maxDistanceMode === "max_distance" || maxDistanceMode === "both" ) {
670- params . set ( "max_vector_distance" , distanceValue . toString ( ) ) ;
671- }
672- if ( maxDistanceMode === "min_score" || maxDistanceMode === "both" ) {
673- params . set ( "min_original_vector_score" , ( 1 - distanceValue ) . toString ( ) ) ;
674- }
675-
652+ // Only pass uuid or slug - no other parameters
676653 const url = `${ API_BASE } /discover/lookup?${ params . toString ( ) } ` ;
677654 const response = await fetch ( url ) ;
678655
@@ -683,29 +660,7 @@ export async function fetchResultByUuid(
683660 const slugParams = new URLSearchParams ( ) ;
684661 slugParams . set ( "slug" , identifier ) ;
685662
686- // Append query parameter if provided
687- if ( query && query . trim ( ) ) {
688- slugParams . set ( "query" , query . trim ( ) ) ;
689- }
690-
691- // Append alpha parameter if provided
692- if ( alpha !== undefined ) {
693- slugParams . set ( "alpha" , alpha . toString ( ) ) ;
694- }
695-
696- // Add max_vector_distance and/or min_original_vector_score based on mode
697- // Always send these parameters (use default 0.4 if not provided)
698- const distanceValue = maxVectorDistance !== undefined ? maxVectorDistance : 0.4 ;
699- if ( maxDistanceMode === "max_distance" || maxDistanceMode === "both" ) {
700- slugParams . set ( "max_vector_distance" , distanceValue . toString ( ) ) ;
701- }
702- if ( maxDistanceMode === "min_score" || maxDistanceMode === "both" ) {
703- slugParams . set (
704- "min_original_vector_score" ,
705- ( 1 - distanceValue ) . toString ( )
706- ) ;
707- }
708-
663+ // Only pass slug - no other parameters
709664 const slugUrl = `${ API_BASE } /discover/lookup?${ slugParams . toString ( ) } ` ;
710665 const slugResponse = await fetch ( slugUrl ) ;
711666
0 commit comments