mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-18 01:10:14 +01:00
🤖 fix: Minor Assistants Endpoint Fixes (#2472)
* fix(useCreateAssistantMutation): force re-render of assistants map by avoiding use shallow reference of listRes.data * fix(AppService): regression by not including azure assistant defaults when no assistant endpoint values are set
This commit is contained in:
parent
3d1dec62a4
commit
e6310c806a
4 changed files with 48 additions and 17 deletions
|
|
@ -6,11 +6,23 @@ const {
|
|||
const { logger } = require('~/config');
|
||||
|
||||
/**
|
||||
* Sets up the Assistants configuration from the config (`librechat.yaml`) file.
|
||||
* @param {TCustomConfig} config - The loaded custom configuration.
|
||||
* Sets up the minimum, default Assistants configuration if Azure OpenAI Assistants option is enabled.
|
||||
* @returns {Partial<TAssistantEndpoint>} The Assistants endpoint configuration.
|
||||
*/
|
||||
function assistantsConfigSetup(config) {
|
||||
function azureAssistantsDefaults() {
|
||||
return {
|
||||
capabilities: [Capabilities.tools, Capabilities.actions, Capabilities.code_interpreter],
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets up the Assistants configuration from the config (`librechat.yaml`) file.
|
||||
* @param {TCustomConfig} config - The loaded custom configuration.
|
||||
* @param {Partial<TAssistantEndpoint>} [prevConfig]
|
||||
* - The previously loaded assistants configuration from Azure OpenAI Assistants option.
|
||||
* @returns {Partial<TAssistantEndpoint>} The Assistants endpoint configuration.
|
||||
*/
|
||||
function assistantsConfigSetup(config, prevConfig = {}) {
|
||||
const assistantsConfig = config.endpoints[EModelEndpoint.assistants];
|
||||
const parsedConfig = assistantEndpointSchema.parse(assistantsConfig);
|
||||
if (assistantsConfig.supportedIds?.length && assistantsConfig.excludedIds?.length) {
|
||||
|
|
@ -19,12 +31,6 @@ function assistantsConfigSetup(config) {
|
|||
);
|
||||
}
|
||||
|
||||
const prevConfig = config.endpoints[EModelEndpoint.azureOpenAI]?.assistants
|
||||
? {
|
||||
capabilities: [Capabilities.tools, Capabilities.actions, Capabilities.code_interpreter],
|
||||
}
|
||||
: {};
|
||||
|
||||
return {
|
||||
...prevConfig,
|
||||
retrievalModels: parsedConfig.retrievalModels,
|
||||
|
|
@ -37,4 +43,4 @@ function assistantsConfigSetup(config) {
|
|||
};
|
||||
}
|
||||
|
||||
module.exports = { assistantsConfigSetup };
|
||||
module.exports = { azureAssistantsDefaults, assistantsConfigSetup };
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue