File tree Expand file tree Collapse file tree 3 files changed +28
-1
lines changed Expand file tree Collapse file tree 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=
253253GOOGLE_SEARCH_API_KEY =
254254GOOGLE_CSE_ID =
255255
256+ # SearchApi
257+ # -----------------
258+ SEARCHAPI_API_KEY =
259+
256260# SerpAPI
257261# -----------------
258262SERPAPI_API_KEY =
Original file line number Diff line number Diff line change 8282 }
8383 ]
8484 },
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+ },
8598 {
8699 "name" : " Serpapi" ,
87100 "pluginKey" : " serpapi" ,
Original file line number Diff line number Diff line change 11const { Tools } = require ( 'librechat-data-provider' ) ;
22const { ZapierToolKit } = require ( 'langchain/agents' ) ;
33const { Calculator } = require ( 'langchain/tools/calculator' ) ;
4- const { SerpAPI, ZapierNLAWrapper } = require ( 'langchain/tools' ) ;
4+ const { SerpAPI, ZapierNLAWrapper, SearchApi } = require ( 'langchain/tools' ) ;
55const { createCodeExecutionTool, EnvVar } = require ( '@librechat/agents' ) ;
66const { getUserPluginAuthValue } = require ( '~/server/services/PluginService' ) ;
77const {
@@ -197,6 +197,16 @@ const loadTools = async ({
197197 options,
198198 } ) ;
199199 } ,
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+ } ,
200210 serpapi : async ( ) => {
201211 let apiKey = process . env . SERPAPI_API_KEY ;
202212 if ( ! apiKey ) {
You can’t perform that action at this time.
0 commit comments