1
1
const { Tools } = require ( 'librechat-data-provider' ) ;
2
2
const { ZapierToolKit } = require ( 'langchain/agents' ) ;
3
3
const { Calculator } = require ( 'langchain/tools/calculator' ) ;
4
- const { WebBrowser } = require ( 'langchain/tools/webbrowser' ) ;
5
4
const { SerpAPI, ZapierNLAWrapper } = require ( 'langchain/tools' ) ;
6
- const { OpenAIEmbeddings } = require ( 'langchain/embeddings/openai' ) ;
7
5
const { createCodeExecutionTool, EnvVar } = require ( '@librechat/agents' ) ;
8
6
const { getUserPluginAuthValue } = require ( '~/server/services/PluginService' ) ;
9
7
const {
@@ -31,12 +29,6 @@ const { loadToolSuite } = require('./loadToolSuite');
31
29
const { loadSpecs } = require ( './loadSpecs' ) ;
32
30
const { logger } = require ( '~/config' ) ;
33
31
34
- const getOpenAIKey = async ( options , user ) => {
35
- let openAIApiKey = options . openAIApiKey ?? process . env . OPENAI_API_KEY ;
36
- openAIApiKey = openAIApiKey === 'user_provided' ? null : openAIApiKey ;
37
- return openAIApiKey || ( await getUserPluginAuthValue ( user , 'OPENAI_API_KEY' ) ) ;
38
- } ;
39
-
40
32
/**
41
33
* Validates the availability and authentication of tools for a user based on environment variables or user-specific plugin authentication values.
42
34
* Tools without required authentication or with valid authentication are considered valid.
@@ -177,8 +169,6 @@ const loadTools = async ({
177
169
traversaal_search : TraversaalSearch ,
178
170
} ;
179
171
180
- const openAIApiKey = await getOpenAIKey ( options , user ) ;
181
-
182
172
const customConstructors = {
183
173
e2b_code_interpreter : async ( ) => {
184
174
if ( ! functions ) {
@@ -191,7 +181,6 @@ const loadTools = async ({
191
181
user,
192
182
options : {
193
183
model,
194
- openAIApiKey,
195
184
...options ,
196
185
} ,
197
186
} ) ;
@@ -208,14 +197,6 @@ const loadTools = async ({
208
197
options,
209
198
} ) ;
210
199
} ,
211
- 'web-browser' : async ( ) => {
212
- // let openAIApiKey = options.openAIApiKey ?? process.env.OPENAI_API_KEY;
213
- // openAIApiKey = openAIApiKey === 'user_provided' ? null : openAIApiKey;
214
- // openAIApiKey = openAIApiKey || (await getUserPluginAuthValue(user, 'OPENAI_API_KEY'));
215
- const browser = new WebBrowser ( { model, embeddings : new OpenAIEmbeddings ( { openAIApiKey } ) } ) ;
216
- browser . description_for_model = browser . description ;
217
- return browser ;
218
- } ,
219
200
serpapi : async ( ) => {
220
201
let apiKey = process . env . SERPAPI_API_KEY ;
221
202
if ( ! apiKey ) {
0 commit comments