diff --git a/README.md b/README.md index a96e47f70f..862dcbc467 100644 --- a/README.md +++ b/README.md @@ -76,6 +76,7 @@ - Search the internet and retrieve relevant information to enhance your AI context - Combines search providers, content scrapers, and result rerankers for optimal results - **Customizable Jina Reranking**: Configure custom Jina API URLs for reranking services + - Run local reranking with open source models through the rag_api. - **[Learn More →](https://www.librechat.ai/docs/features/web_search)** - 🪄 **Generative UI with Code Artifacts**: diff --git a/client/src/components/SidePanel/Agents/Search/ApiKeyDialog.tsx b/client/src/components/SidePanel/Agents/Search/ApiKeyDialog.tsx index a7ec8fdc17..efce72d614 100644 --- a/client/src/components/SidePanel/Agents/Search/ApiKeyDialog.tsx +++ b/client/src/components/SidePanel/Agents/Search/ApiKeyDialog.tsx @@ -117,6 +117,11 @@ export default function ApiKeyDialog({ }, }, }, + { + key: RerankerTypes.SIMPLE, + label: localize('com_ui_web_search_reranker_simple'), + inputs: {}, + }, ]; const scraperOptions: DropdownOption[] = [ diff --git a/client/src/locales/en/translation.json b/client/src/locales/en/translation.json index a82e931072..f644813bdf 100644 --- a/client/src/locales/en/translation.json +++ b/client/src/locales/en/translation.json @@ -1316,6 +1316,7 @@ "com_ui_web_search_reranker_jina": "Jina AI", "com_ui_web_search_reranker_jina_key": "Get your Jina API key", "com_ui_web_search_reranker_jina_url_help": "Learn about Jina Rerank API", + "com_ui_web_search_reranker_simple": "Simple", "com_ui_web_search_scraper": "Scraper", "com_ui_web_search_scraper_firecrawl": "Firecrawl API", "com_ui_web_search_scraper_firecrawl_key": "Get your Firecrawl API key", diff --git a/packages/api/src/web/web.ts b/packages/api/src/web/web.ts index ad172e187f..190b94f421 100644 --- a/packages/api/src/web/web.ts +++ b/packages/api/src/web/web.ts @@ -120,7 +120,8 @@ export async function loadWebSearchAuth({ } } - if (requiredKeys.length === 0) continue; + const simpleReRankerChosen = specificService && service === 'simple'; + if (!simpleReRankerChosen && requiredKeys.length === 0) continue; const requiredAuthFields = extractWebSearchEnvVars({ keys: requiredKeys, diff --git a/packages/data-provider/src/config.ts b/packages/data-provider/src/config.ts index be8cfe0d62..296924a883 100644 --- a/packages/data-provider/src/config.ts +++ b/packages/data-provider/src/config.ts @@ -707,6 +707,7 @@ export enum ScraperProviders { export enum RerankerTypes { JINA = 'jina', COHERE = 'cohere', + SIMPLE = 'simple', } export enum SafeSearchTypes { diff --git a/packages/data-provider/src/types/web.ts b/packages/data-provider/src/types/web.ts index 26a9b71689..95494a7cc5 100644 --- a/packages/data-provider/src/types/web.ts +++ b/packages/data-provider/src/types/web.ts @@ -12,7 +12,7 @@ export enum DATE_RANGE { } export type SearchProvider = 'serper' | 'searxng'; -export type RerankerType = 'infinity' | 'jina' | 'cohere' | 'none'; +export type RerankerType = 'infinity' | 'jina' | 'cohere' | 'simple' | 'none'; export interface Highlight { score: number; diff --git a/packages/data-schemas/src/app/web.ts b/packages/data-schemas/src/app/web.ts index a61e1f1611..7e7695c0cc 100644 --- a/packages/data-schemas/src/app/web.ts +++ b/packages/data-schemas/src/app/web.ts @@ -31,6 +31,7 @@ export const webSearchAuth = { jinaApiUrl: 0 as const, }, cohere: { cohereApiKey: 1 as const }, + simple: { }, }, };