mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-19 01:40:15 +01:00
🔗 feat: Custom Jina API URL for Web Search Reranking (#9236)
* feat: added support for custom JINA_API_URL * fixed tests * chore: Update @librechat/agents dependency to version 2.4.77 in package-lock.json and package.json files * fix: Update Jina API URL to use environment variable in configuration files * Refactor AppService, web.ts, and config.ts to replace hardcoded Jina API URL with an environment variable placeholder. * Ensure consistency across tests and configuration for Jina API URL. * chore: alphabetical order translation.json * fix: alphabetical order --------- Co-authored-by: Danny Avila <danny@librechat.ai>
This commit is contained in:
parent
fff1f1cf27
commit
6f6a34d126
13 changed files with 68 additions and 8 deletions
|
|
@ -21,6 +21,7 @@ export function loadWebSearchConfig(
|
|||
const firecrawlApiKey = config?.firecrawlApiKey ?? '${FIRECRAWL_API_KEY}';
|
||||
const firecrawlApiUrl = config?.firecrawlApiUrl ?? '${FIRECRAWL_API_URL}';
|
||||
const jinaApiKey = config?.jinaApiKey ?? '${JINA_API_KEY}';
|
||||
const jinaApiUrl = config?.jinaApiUrl ?? '${JINA_API_URL}';
|
||||
const cohereApiKey = config?.cohereApiKey ?? '${COHERE_API_KEY}';
|
||||
const safeSearch = config?.safeSearch ?? SafeSearchTypes.MODERATE;
|
||||
|
||||
|
|
@ -28,6 +29,7 @@ export function loadWebSearchConfig(
|
|||
...config,
|
||||
safeSearch,
|
||||
jinaApiKey,
|
||||
jinaApiUrl,
|
||||
cohereApiKey,
|
||||
serperApiKey,
|
||||
searxngInstanceUrl,
|
||||
|
|
@ -44,6 +46,7 @@ export type TWebSearchKeys =
|
|||
| 'firecrawlApiKey'
|
||||
| 'firecrawlApiUrl'
|
||||
| 'jinaApiKey'
|
||||
| 'jinaApiUrl'
|
||||
| 'cohereApiKey';
|
||||
|
||||
export type TWebSearchCategories =
|
||||
|
|
@ -70,7 +73,11 @@ export const webSearchAuth = {
|
|||
},
|
||||
},
|
||||
rerankers: {
|
||||
jina: { jinaApiKey: 1 as const },
|
||||
jina: {
|
||||
jinaApiKey: 1 as const,
|
||||
/** Optional (0) */
|
||||
jinaApiUrl: 0 as const,
|
||||
},
|
||||
cohere: { cohereApiKey: 1 as const },
|
||||
},
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue