Spaces:
Sleeping
Sleeping
Update index.js
Browse files
index.js
CHANGED
@@ -29,7 +29,7 @@ const CONFIG = {
|
|
29 |
MAX_ATTEMPTS: 3,//重试次数
|
30 |
DELAY_BASE: 1000 // 基础延迟时间(毫秒)
|
31 |
},
|
32 |
-
ISSHOW_SEARCH_RESULTS: process.env.ISSHOW_SEARCH_RESULTS
|
33 |
CHROME_PATH: process.env.CHROME_PATH || "/usr/bin/chromium"//chrome路径
|
34 |
};
|
35 |
|
@@ -536,6 +536,7 @@ async function handleStreamResponse(response, model, res) {
|
|
536 |
}
|
537 |
}
|
538 |
if (linejosn.response === "webSearchResults" && CONFIG.ISSHOW_SEARCH_RESULTS) {
|
|
|
539 |
const searchResults = await Utils.organizeSearchResults(linejosn.webSearchResults);
|
540 |
const responseData = MessageProcessor.createChatResponse(`<thinking>\r\n${searchResults}\r\n</thinking>\r\n`, model, true);
|
541 |
res.write(`data: ${JSON.stringify(responseData)}\n\n`);
|
|
|
29 |
MAX_ATTEMPTS: 3,//重试次数
|
30 |
DELAY_BASE: 1000 // 基础延迟时间(毫秒)
|
31 |
},
|
32 |
+
ISSHOW_SEARCH_RESULTS: process.env.ISSHOW_SEARCH_RESULTS,//是否显示搜索结果,默认开启
|
33 |
CHROME_PATH: process.env.CHROME_PATH || "/usr/bin/chromium"//chrome路径
|
34 |
};
|
35 |
|
|
|
536 |
}
|
537 |
}
|
538 |
if (linejosn.response === "webSearchResults" && CONFIG.ISSHOW_SEARCH_RESULTS) {
|
539 |
+
console.log("显示搜索结果");
|
540 |
const searchResults = await Utils.organizeSearchResults(linejosn.webSearchResults);
|
541 |
const responseData = MessageProcessor.createChatResponse(`<thinking>\r\n${searchResults}\r\n</thinking>\r\n`, model, true);
|
542 |
res.write(`data: ${JSON.stringify(responseData)}\n\n`);
|