From 6d307261133d1e92cf9f077af17e70369e8d0b0e Mon Sep 17 00:00:00 2001 From: Danny Avila Date: Sun, 1 Sep 2024 09:29:14 -0400 Subject: [PATCH] fix: declare endpoint in initialization step --- api/server/controllers/bedrock/client.js | 16 ---------------- .../services/Endpoints/agents/initialize.js | 1 + .../services/Endpoints/bedrock/initialize.js | 1 + 3 files changed, 2 insertions(+), 16 deletions(-) delete mode 100644 api/server/controllers/bedrock/client.js diff --git a/api/server/controllers/bedrock/client.js b/api/server/controllers/bedrock/client.js deleted file mode 100644 index 0dcb1dda87..0000000000 --- a/api/server/controllers/bedrock/client.js +++ /dev/null @@ -1,16 +0,0 @@ -const { EModelEndpoint } = require('librechat-data-provider'); -const AgentClient = require('~/server/controllers/agents/client'); -const { logger } = require('~/config'); - -class BedrockClient extends AgentClient { - constructor(options = {}) { - super(options); - this.options.endpoint = EModelEndpoint.bedrock; - } - - setOptions(options) { - logger.info('[api/server/controllers/bedrock/client.js] setOptions', options); - } -} - -module.exports = BedrockClient; diff --git a/api/server/services/Endpoints/agents/initialize.js b/api/server/services/Endpoints/agents/initialize.js index 8627775ce5..e6ba3f7ca8 100644 --- a/api/server/services/Endpoints/agents/initialize.js +++ b/api/server/services/Endpoints/agents/initialize.js @@ -108,6 +108,7 @@ const initializeClient = async ({ req, res, endpointOption }) => { toolMap, modelOptions, eventHandlers, + endpoint: EModelEndpoint.agents, configOptions: options.configOptions, maxContextTokens: agent.max_context_tokens ?? diff --git a/api/server/services/Endpoints/bedrock/initialize.js b/api/server/services/Endpoints/bedrock/initialize.js index 13d12004e5..abb731a6e8 100644 --- a/api/server/services/Endpoints/bedrock/initialize.js +++ b/api/server/services/Endpoints/bedrock/initialize.js @@ -47,6 +47,7 @@ const initializeClient = async ({ req, res, endpointOption }) => { modelOptions, eventHandlers, maxContextTokens, + endpoint: EModelEndpoint.bedrock, configOptions: options.configOptions, }); return { client };