mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-01-11 04:58:51 +01:00
refactor: update appConfig access to use endpoints structure across various services
This commit is contained in:
parent
89fb9c7e1c
commit
240e3bd59e
36 changed files with 591 additions and 510 deletions
|
|
@ -51,9 +51,11 @@ async function processFileCitations({ user, toolArtifact, toolCallId, metadata }
|
|||
}
|
||||
|
||||
const appConfig = await getAppConfig({ role: user?.role });
|
||||
const maxCitations = appConfig?.[EModelEndpoint.agents]?.maxCitations ?? 30;
|
||||
const maxCitationsPerFile = appConfig?.[EModelEndpoint.agents]?.maxCitationsPerFile ?? 5;
|
||||
const minRelevanceScore = appConfig?.[EModelEndpoint.agents]?.minRelevanceScore ?? 0.45;
|
||||
const maxCitations = appConfig.endpoints?.[EModelEndpoint.agents]?.maxCitations ?? 30;
|
||||
const maxCitationsPerFile =
|
||||
appConfig.endpoints?.[EModelEndpoint.agents]?.maxCitationsPerFile ?? 5;
|
||||
const minRelevanceScore =
|
||||
appConfig.endpoints?.[EModelEndpoint.agents]?.minRelevanceScore ?? 0.45;
|
||||
|
||||
const sources = toolArtifact[Tools.file_search].sources || [];
|
||||
const filteredSources = sources.filter((source) => source.relevance >= minRelevanceScore);
|
||||
|
|
|
|||
|
|
@ -165,7 +165,7 @@ const processDeleteRequest = async ({ req, files }) => {
|
|||
/** @type {Record<string, OpenAI | undefined>} */
|
||||
const client = { [FileSources.openai]: undefined, [FileSources.azure]: undefined };
|
||||
const initializeClients = async () => {
|
||||
if (appConfig[EModelEndpoint.assistants]) {
|
||||
if (appConfig.endpoints?.[EModelEndpoint.assistants]) {
|
||||
const openAIClient = await getOpenAIClient({
|
||||
req,
|
||||
overrideEndpoint: EModelEndpoint.assistants,
|
||||
|
|
@ -173,7 +173,7 @@ const processDeleteRequest = async ({ req, files }) => {
|
|||
client[FileSources.openai] = openAIClient.openai;
|
||||
}
|
||||
|
||||
if (!appConfig[EModelEndpoint.azureOpenAI]?.assistants) {
|
||||
if (!appConfig.endpoints?.[EModelEndpoint.azureOpenAI]?.assistants) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue