mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-17 08:50:15 +01:00
🧠 feat: Cohere support as Custom Endpoint (#2328)
* chore: bump cohere-ai, fix firebase vulnerabilities by going down versions * feat: cohere rates and context windows * feat(createCoherePayload): transform openai payload for cohere compatibility * feat: cohere backend support * refactor(UnknownIcon): optimize icon render and add cohere * docs: add cohere to Compatible AI Endpoints * Update ai_endpoints.md
This commit is contained in:
parent
daa5f43ac6
commit
cd7f3a51e1
18 changed files with 1007 additions and 622 deletions
|
|
@ -1,3 +1,5 @@
|
|||
const { CohereConstants } = require('librechat-data-provider');
|
||||
|
||||
/**
|
||||
* Extracts a valid OpenAI baseURL from a given string, matching "url/v1," followed by an optional suffix.
|
||||
* The suffix can be one of several predefined values (e.g., 'openai', 'azure-openai', etc.),
|
||||
|
|
@ -19,6 +21,10 @@ function extractBaseURL(url) {
|
|||
return undefined;
|
||||
}
|
||||
|
||||
if (url.startsWith(CohereConstants.API_URL)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (!url.includes('/v1')) {
|
||||
return url;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue