mirror of
https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web.git
synced 2025-11-13 12:43:42 +08:00
@@ -19,6 +19,8 @@ import { WebBrowser } from "langchain/tools/webbrowser";
|
||||
import { Calculator } from "langchain/tools/calculator";
|
||||
import { DynamicTool, Tool } from "langchain/tools";
|
||||
import { DallEAPIWrapper } from "@/app/api/langchain-tools/dalle_image_generator";
|
||||
import { BaiduSearch } from "@/app/api/langchain-tools/baidu_search";
|
||||
import { GoogleSearch } from "@/app/api/langchain-tools/google_search";
|
||||
|
||||
const serverConfig = getServerSideConfig();
|
||||
|
||||
@@ -173,6 +175,16 @@ async function handle(req: NextRequest) {
|
||||
});
|
||||
|
||||
let searchTool: Tool = new DuckDuckGo();
|
||||
if (process.env.CHOOSE_SEARCH_ENGINE) {
|
||||
switch (process.env.CHOOSE_SEARCH_ENGINE) {
|
||||
case "google":
|
||||
searchTool = new GoogleSearch();
|
||||
break;
|
||||
case "baidu":
|
||||
searchTool = new BaiduSearch();
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (process.env.BING_SEARCH_API_KEY) {
|
||||
let bingSearchTool = new langchainTools["BingSerpAPI"](
|
||||
process.env.BING_SEARCH_API_KEY,
|
||||
|
||||
Reference in New Issue
Block a user