mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-04-07 00:15:23 +02:00
feat: add COHERE_BASE_URL configuration support for custom Cohere rerank endpoints
- Add cohereBaseUrl to webSearchSchema configuration - Update loadWebSearchConfig to load cohereBaseUrl from environment - Add cohereBaseUrl to TWebSearchKeys type definition - Configure cohereBaseUrl as optional parameter for cohere reranker - Add COHERE_BASE_URL documentation to .env.example This enables configuration of custom Cohere endpoints (such as LiteLLM proxy) for web search reranking. The configuration infrastructure is ready for when the @librechat/agents package supports custom base URLs. Usage: COHERE_BASE_URL=http://litellm:8000/v1 COHERE_API_KEY=your_api_key
This commit is contained in:
parent
2a50c372ef
commit
00a99aca0a
4 changed files with 11 additions and 2 deletions
|
|
@ -814,6 +814,7 @@ OPENWEATHER_API_KEY=
|
|||
# JINA_API_KEY=your_jina_api_key
|
||||
# or
|
||||
# COHERE_API_KEY=your_cohere_api_key
|
||||
# COHERE_BASE_URL=your_custom_cohere_base_url
|
||||
|
||||
#======================#
|
||||
# MCP Configuration #
|
||||
|
|
|
|||
|
|
@ -836,6 +836,7 @@ export const webSearchSchema = z.object({
|
|||
jinaApiKey: z.string().optional().default('${JINA_API_KEY}'),
|
||||
jinaApiUrl: z.string().optional().default('${JINA_API_URL}'),
|
||||
cohereApiKey: z.string().optional().default('${COHERE_API_KEY}'),
|
||||
cohereBaseUrl: z.string().optional().default('${COHERE_BASE_URL}'),
|
||||
searchProvider: z.nativeEnum(SearchProviders).optional(),
|
||||
scraperProvider: z.nativeEnum(ScraperProviders).optional(),
|
||||
rerankerType: z.nativeEnum(RerankerTypes).optional(),
|
||||
|
|
|
|||
|
|
@ -30,7 +30,11 @@ export const webSearchAuth = {
|
|||
/** Optional (0) */
|
||||
jinaApiUrl: 0 as const,
|
||||
},
|
||||
cohere: { cohereApiKey: 1 as const },
|
||||
cohere: {
|
||||
cohereApiKey: 1 as const,
|
||||
/** Optional (0) */
|
||||
cohereBaseUrl: 0 as const,
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
|
|
@ -72,6 +76,7 @@ export function loadWebSearchConfig(
|
|||
const jinaApiKey = config?.jinaApiKey ?? '${JINA_API_KEY}';
|
||||
const jinaApiUrl = config?.jinaApiUrl ?? '${JINA_API_URL}';
|
||||
const cohereApiKey = config?.cohereApiKey ?? '${COHERE_API_KEY}';
|
||||
const cohereBaseUrl = config?.cohereBaseUrl ?? '${COHERE_BASE_URL}';
|
||||
const safeSearch = config?.safeSearch ?? SafeSearchTypes.MODERATE;
|
||||
|
||||
return {
|
||||
|
|
@ -80,6 +85,7 @@ export function loadWebSearchConfig(
|
|||
jinaApiKey,
|
||||
jinaApiUrl,
|
||||
cohereApiKey,
|
||||
cohereBaseUrl,
|
||||
serperApiKey,
|
||||
searxngApiKey,
|
||||
firecrawlApiKey,
|
||||
|
|
|
|||
|
|
@ -9,7 +9,8 @@ export type TWebSearchKeys =
|
|||
| 'firecrawlVersion'
|
||||
| 'jinaApiKey'
|
||||
| 'jinaApiUrl'
|
||||
| 'cohereApiKey';
|
||||
| 'cohereApiKey'
|
||||
| 'cohereBaseUrl';
|
||||
|
||||
export type TWebSearchCategories =
|
||||
| SearchCategories.PROVIDERS
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue