🤖 fix(assistants): Default Capabilities and Retrieval Models (#2102)

This commit is contained in:
Danny Avila 2024-03-14 20:42:56 -04:00 committed by GitHub
parent 5cd5c3bef8
commit f769077ab4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 14 additions and 3 deletions

View file

@ -1,6 +1,7 @@
const { Capabilities, defaultRetrievalModels } = require('librechat-data-provider');
const { getCitations, citeText } = require('./citations');
const partialRight = require('lodash/partialRight');
const { sendMessage } = require('./streamResponse');
const { getCitations, citeText } = require('./citations');
const citationRegex = /\[\^\d+?\^]/g;
const addSpaceIfNeeded = (text) => (text.length > 0 && !text.endsWith(' ') ? text + ' ' : text);
@ -155,7 +156,7 @@ const isUserProvided = (value) => value === 'user_provided';
* @param {string} baseURL
* @returns {boolean | { userProvide: boolean, userProvideURL?: boolean }}
*/
function generateConfig(key, baseURL) {
function generateConfig(key, baseURL, assistants = false) {
if (!key) {
return false;
}
@ -167,6 +168,16 @@ function generateConfig(key, baseURL) {
config.userProvideURL = isUserProvided(baseURL);
}
if (assistants) {
config.retrievalModels = defaultRetrievalModels;
config.capabilities = [
Capabilities.code_interpreter,
Capabilities.retrieval,
Capabilities.actions,
Capabilities.tools,
];
}
return config;
}