mirror of
https://git.mirrors.martin98.com/https://github.com/jina-ai/reader
synced 2025-08-19 14:19:08 +08:00
fix: internal serp does not support variants
This commit is contained in:
parent
1748a5b130
commit
481d1a21af
@ -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) {
|
||||
|
@ -1 +1 @@
|
||||
Subproject commit a677cbd23ffba78ac34d92d732be1945e016b6c7
|
||||
Subproject commit c48c226fbb595773cb08baee26a9fce299dc275e
|
Loading…
x
Reference in New Issue
Block a user