🔃 refactor: rename all server endpoints to use same file names (#4364)

This commit is contained in:
adrianfagerland 2024-10-19 14:24:07 +02:00 committed by GitHub
parent f3e2bd0a12
commit 20fb7f05ae
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
31 changed files with 26 additions and 26 deletions

View file

@ -0,0 +1,38 @@
const { removeNullishValues } = require('librechat-data-provider');
const generateArtifactsPrompt = require('~/app/clients/prompts/artifacts');
const buildOptions = (endpoint, parsedBody) => {
const {
modelLabel,
promptPrefix,
maxContextTokens,
resendFiles = true,
promptCache = true,
iconURL,
greeting,
spec,
artifacts,
...modelOptions
} = parsedBody;
const endpointOption = removeNullishValues({
endpoint,
modelLabel,
promptPrefix,
resendFiles,
promptCache,
iconURL,
greeting,
spec,
maxContextTokens,
modelOptions,
});
if (typeof artifacts === 'string') {
endpointOption.artifactsPrompt = generateArtifactsPrompt({ endpoint, artifacts });
}
return endpointOption;
};
module.exports = buildOptions;