nomagick commited on
Commit
481d1a2
·
unverified ·
1 Parent(s): 1748a5b

fix: internal serp does not support variants

Browse files
Files changed (2) hide show
  1. src/api/searcher.ts +5 -5
  2. thinapps-shared +1 -1
src/api/searcher.ts CHANGED
@@ -693,24 +693,24 @@ export class SearcherHost extends RPCHost {
693
  }
694
  }
695
 
696
- *iterProviders(preference?: string) {
697
  if (preference === 'bing') {
698
  yield this.serperBing;
699
- yield this.jinaSerp;
700
  yield this.serperGoogle;
701
 
702
  return;
703
  }
704
 
705
  if (preference === 'google') {
706
- yield this.jinaSerp;
707
  yield this.serperGoogle;
708
  yield this.serperGoogle;
709
 
710
  return;
711
  }
712
 
713
- yield this.jinaSerp;
714
  yield this.serperGoogle;
715
  yield this.serperGoogle;
716
  }
@@ -743,7 +743,7 @@ export class SearcherHost extends RPCHost {
743
  let r: any[] | undefined;
744
  let lastError;
745
  outerLoop:
746
- for (const client of this.iterProviders(provider)) {
747
  const t0 = Date.now();
748
  try {
749
  switch (variant) {
 
693
  }
694
  }
695
 
696
+ *iterProviders(preference?: string, variant?: string) {
697
  if (preference === 'bing') {
698
  yield this.serperBing;
699
+ yield variant === 'web' ? this.jinaSerp : this.serperGoogle;
700
  yield this.serperGoogle;
701
 
702
  return;
703
  }
704
 
705
  if (preference === 'google') {
706
+ yield variant === 'web' ? this.jinaSerp : this.serperGoogle;
707
  yield this.serperGoogle;
708
  yield this.serperGoogle;
709
 
710
  return;
711
  }
712
 
713
+ yield variant === 'web' ? this.jinaSerp : this.serperGoogle;
714
  yield this.serperGoogle;
715
  yield this.serperGoogle;
716
  }
 
743
  let r: any[] | undefined;
744
  let lastError;
745
  outerLoop:
746
+ for (const client of this.iterProviders(provider, variant)) {
747
  const t0 = Date.now();
748
  try {
749
  switch (variant) {
thinapps-shared CHANGED
@@ -1 +1 @@
1
- Subproject commit a677cbd23ffba78ac34d92d732be1945e016b6c7
 
1
+ Subproject commit c48c226fbb595773cb08baee26a9fce299dc275e