File tree 3 files changed +28
-1
lines changed
3 files changed +28
-1
lines changed Original file line number Diff line number Diff line change @@ -253,6 +253,10 @@ AZURE_AI_SEARCH_SEARCH_OPTION_SELECT=
253
253
GOOGLE_SEARCH_API_KEY =
254
254
GOOGLE_CSE_ID =
255
255
256
+ # SearchApi
257
+ # -----------------
258
+ SEARCHAPI_API_KEY =
259
+
256
260
# SerpAPI
257
261
# -----------------
258
262
SERPAPI_API_KEY =
Original file line number Diff line number Diff line change 82
82
}
83
83
]
84
84
},
85
+ {
86
+ "name" : " SearchApi" ,
87
+ "pluginKey" : " searchapi" ,
88
+ "description" : " SearchApi is a robust real-time SERP API delivering structured data from a collection of search engines." ,
89
+ "icon" : " https://www.searchapi.io/press/searchapi-logo-symbol-screen.png" ,
90
+ "authConfig" : [
91
+ {
92
+ "authField" : " SEARCHAPI_API_KEY" ,
93
+ "label" : " SearchApi Private API Key" ,
94
+ "description" : " Private Key for SearchApi. Register at <a href='https://www.searchapi.io/'>SearchApi</a> to obtain a private key."
95
+ }
96
+ ]
97
+ },
85
98
{
86
99
"name" : " Serpapi" ,
87
100
"pluginKey" : " serpapi" ,
Original file line number Diff line number Diff line change 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 { SerpAPI, ZapierNLAWrapper } = require ( 'langchain/tools' ) ;
4
+ const { SerpAPI, ZapierNLAWrapper, SearchApi } = require ( 'langchain/tools' ) ;
5
5
const { createCodeExecutionTool, EnvVar } = require ( '@librechat/agents' ) ;
6
6
const { getUserPluginAuthValue } = require ( '~/server/services/PluginService' ) ;
7
7
const {
@@ -197,6 +197,16 @@ const loadTools = async ({
197
197
options,
198
198
} ) ;
199
199
} ,
200
+ searchapi : async ( ) => {
201
+ let apiKey = process . env . SEARCHAPI_API_KEY ;
202
+ if ( ! apiKey ) {
203
+ apiKey = await getUserPluginAuthValue ( user , 'SEARCHAPI_API_KEY' ) ;
204
+ }
205
+ return new SearchApi ( apiKey , {
206
+ hl : 'en' ,
207
+ gl : 'us' ,
208
+ } ) ;
209
+ } ,
200
210
serpapi : async ( ) => {
201
211
let apiKey = process . env . SERPAPI_API_KEY ;
202
212
if ( ! apiKey ) {
You can’t perform that action at this time.
0 commit comments