林黛玉倒拔垂杨柳 (@Qiner)🌋【超简单】零门槛!NextChat 一键调用 Google 联网搜索!免费!! 中发帖

终于蹲到了!早就写好了这个脚本一直用不上。原理贴: 

和 GCP Vertex AI 一样,但 GCP 要 $35/1000次! 无法普及,且走 Vertex AI 渠道的用户群远不如 AI Studio 的多。现在 Gemini 2.0 免费量大管饱 Google 联网搜索集成终于可以飞入寻常百姓家了!
直接上代码:
// 保存原始的 fetch 函数
const originalFetch = window.fetch;

// 重写 fetch 函数
window.fetch = async function(...args) {
const [url, options] = args;

// 检查 URL 是否以 'gemini-2.0-flash-exp' 结尾
if (url.endsWith('gemini-2.0-flash-exp:...