mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-17 17:00:15 +01:00
🤖 fix(assistants): Default Capabilities and Retrieval Models (#2102)
This commit is contained in:
parent
5cd5c3bef8
commit
f769077ab4
2 changed files with 14 additions and 3 deletions
|
|
@ -29,7 +29,7 @@ module.exports = {
|
|||
userProvidedOpenAI,
|
||||
googleKey,
|
||||
[EModelEndpoint.openAI]: generateConfig(openAIApiKey, OPENAI_REVERSE_PROXY),
|
||||
[EModelEndpoint.assistants]: generateConfig(assistantsApiKey, ASSISTANTS_BASE_URL),
|
||||
[EModelEndpoint.assistants]: generateConfig(assistantsApiKey, ASSISTANTS_BASE_URL, true),
|
||||
[EModelEndpoint.azureOpenAI]: generateConfig(azureOpenAIApiKey, AZURE_OPENAI_BASEURL),
|
||||
[EModelEndpoint.chatGPTBrowser]: generateConfig(chatGPTToken),
|
||||
[EModelEndpoint.anthropic]: generateConfig(anthropicApiKey),
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue