Add Serper API as an alternative search provider option for faster speeds and no rate limitations from Google

This commit is contained in:
Roger M 2024-04-29 19:44:53 +01:00
parent ab6cda690f
commit 4cd0778094
12 changed files with 137 additions and 32 deletions

View file

@ -11,7 +11,7 @@ import {
} from '@langchain/core/runnables';
import { StringOutputParser } from '@langchain/core/output_parsers';
import { Document } from '@langchain/core/documents';
import { searchSearxng } from '../lib/searxng';
import { search } from '../lib/search';
import type { StreamEvent } from '@langchain/core/tracers/log_stream';
import type { BaseChatModel } from '@langchain/core/language_models/chat_models';
import type { Embeddings } from '@langchain/core/embeddings';
@ -111,7 +111,7 @@ const createBasicRedditSearchRetrieverChain = (llm: BaseChatModel) => {
return { query: '', docs: [] };
}
const res = await searchSearxng(input, {
const res = await search(input, {
language: 'en',
engines: ['reddit'],
});