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 @@ -233,6 +233,10 @@ AZURE_AI_SEARCH_SEARCH_OPTION_SELECT=
233
233
GOOGLE_SEARCH_API_KEY =
234
234
GOOGLE_CSE_ID =
235
235
236
+ # SearchApi
237
+ # -----------------
238
+ SEARCHAPI_API_KEY =
239
+
236
240
# SerpAPI
237
241
# -----------------
238
242
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 { ZapierToolKit } = require ( 'langchain/agents' ) ;
2
2
const { Calculator } = require ( 'langchain/tools/calculator' ) ;
3
3
const { WebBrowser } = require ( 'langchain/tools/webbrowser' ) ;
4
- const { SerpAPI, ZapierNLAWrapper } = require ( 'langchain/tools' ) ;
4
+ const { SerpAPI, ZapierNLAWrapper, SearchApi } = require ( 'langchain/tools' ) ;
5
5
const { OpenAIEmbeddings } = require ( 'langchain/embeddings/openai' ) ;
6
6
const { getUserPluginAuthValue } = require ( '~/server/services/PluginService' ) ;
7
7
const {
@@ -208,6 +208,16 @@ const loadTools = async ({
208
208
browser . description_for_model = browser . description ;
209
209
return browser ;
210
210
} ,
211
+ searchapi : async ( ) => {
212
+ let apiKey = process . env . SEARCHAPI_API_KEY ;
213
+ if ( ! apiKey ) {
214
+ apiKey = await getUserPluginAuthValue ( user , 'SEARCHAPI_API_KEY' ) ;
215
+ }
216
+ return new SearchApi ( apiKey , {
217
+ hl : 'en' ,
218
+ gl : 'us' ,
219
+ } ) ;
220
+ } ,
211
221
serpapi : async ( ) => {
212
222
let apiKey = process . env . SERPAPI_API_KEY ;
213
223
if ( ! apiKey ) {
You can’t perform that action at this time.
0 commit comments