Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions api/server/controllers/agents/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -836,6 +836,7 @@ class AgentClient extends BaseClient {
requestBody: config.configurable.requestBody,
user: createSafeUser(this.options.req?.user),
summarizationConfig: appConfig?.summarization,
appConfig,
tokenCounter,
});

Expand Down
1 change: 1 addition & 0 deletions api/server/controllers/agents/openai.js
Original file line number Diff line number Diff line change
Expand Up @@ -477,6 +477,7 @@ const OpenAIChatCompletionController = async (req, res) => {
initialSummary,
runId: responseId,
summarizationConfig,
appConfig,
signal: abortController.signal,
customHandlers: handlers,
requestBody: {
Expand Down
16 changes: 3 additions & 13 deletions api/server/controllers/agents/responses.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,17 +41,6 @@ const { loadAgentTools, loadToolsForExecution } = require('~/server/services/Too
const { findAccessibleResources } = require('~/server/services/PermissionService');
const db = require('~/models');

/** @type {import('@librechat/api').AppConfig | null} */
let appConfig = null;

/**
* Set the app config for the controller
* @param {import('@librechat/api').AppConfig} config
*/
function setAppConfig(config) {
appConfig = config;
}

/**
* Creates a tool loader function for the agent.
* @param {AbortSignal} signal - The abort signal
Expand Down Expand Up @@ -333,7 +322,7 @@ const createResponse = async (req, res) => {

// Build allowed providers set
const allowedProviders = new Set(
appConfig?.endpoints?.[EModelEndpoint.agents]?.allowedProviders,
req.config?.endpoints?.[EModelEndpoint.agents]?.allowedProviders,
);

// Create tool loader
Expand Down Expand Up @@ -492,6 +481,7 @@ const createResponse = async (req, res) => {
initialSummary,
runId: responseId,
summarizationConfig,
appConfig: req.config,
signal: abortController.signal,
customHandlers: handlers,
requestBody: {
Expand Down Expand Up @@ -655,6 +645,7 @@ const createResponse = async (req, res) => {
initialSummary,
runId: responseId,
summarizationConfig,
appConfig: req.config,
signal: abortController.signal,
customHandlers: handlers,
requestBody: {
Expand Down Expand Up @@ -939,5 +930,4 @@ module.exports = {
createResponse,
getResponse,
listModels,
setAppConfig,
};
Loading
Loading