mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-17 08:50:15 +01:00
🦙 refactor: Normalize Ollama Config Names (#4657)
This commit is contained in:
parent
c27b26cc31
commit
d60a0af878
3 changed files with 17 additions and 14 deletions
|
|
@ -7,6 +7,7 @@ const {
|
|||
defaultRetrievalModels,
|
||||
defaultAssistantsVersion,
|
||||
} = require('librechat-data-provider');
|
||||
const { Providers } = require('@librechat/agents');
|
||||
const { getCitations, citeText } = require('./citations');
|
||||
const partialRight = require('lodash/partialRight');
|
||||
const { sendMessage } = require('./streamResponse');
|
||||
|
|
@ -212,13 +213,23 @@ function generateConfig(key, baseURL, endpoint) {
|
|||
return config;
|
||||
}
|
||||
|
||||
/**
|
||||
* Normalize the endpoint name to system-expected value.
|
||||
* @param {string} name
|
||||
* @returns {string}
|
||||
*/
|
||||
function normalizeEndpointName(name = '') {
|
||||
return name.toLowerCase() === Providers.OLLAMA ? Providers.OLLAMA : name;
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
createOnProgress,
|
||||
isEnabled,
|
||||
handleText,
|
||||
formatSteps,
|
||||
formatAction,
|
||||
addSpaceIfNeeded,
|
||||
isUserProvided,
|
||||
generateConfig,
|
||||
addSpaceIfNeeded,
|
||||
createOnProgress,
|
||||
normalizeEndpointName,
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue