From 481d1a21affd2d11ab89782bfd10014a68fac9cf Mon Sep 17 00:00:00 2001 From: Yanlong Wang Date: Fri, 25 Apr 2025 10:24:47 +0800 Subject: [PATCH] fix: internal serp does not support variants --- src/api/searcher.ts | 10 +++++----- thinapps-shared | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/api/searcher.ts b/src/api/searcher.ts index 7486331..fe00c30 100644 --- a/src/api/searcher.ts +++ b/src/api/searcher.ts @@ -693,24 +693,24 @@ export class SearcherHost extends RPCHost { } } - *iterProviders(preference?: string) { + *iterProviders(preference?: string, variant?: string) { if (preference === 'bing') { yield this.serperBing; - yield this.jinaSerp; + yield variant === 'web' ? this.jinaSerp : this.serperGoogle; yield this.serperGoogle; return; } if (preference === 'google') { - yield this.jinaSerp; + yield variant === 'web' ? this.jinaSerp : this.serperGoogle; yield this.serperGoogle; yield this.serperGoogle; return; } - yield this.jinaSerp; + yield variant === 'web' ? this.jinaSerp : this.serperGoogle; yield this.serperGoogle; yield this.serperGoogle; } @@ -743,7 +743,7 @@ export class SearcherHost extends RPCHost { let r: any[] | undefined; let lastError; outerLoop: - for (const client of this.iterProviders(provider)) { + for (const client of this.iterProviders(provider, variant)) { const t0 = Date.now(); try { switch (variant) { diff --git a/thinapps-shared b/thinapps-shared index a677cbd..c48c226 160000 --- a/thinapps-shared +++ b/thinapps-shared @@ -1 +1 @@ -Subproject commit a677cbd23ffba78ac34d92d732be1945e016b6c7 +Subproject commit c48c226fbb595773cb08baee26a9fce299dc275e