OpenClaw 支援內建 Google Search 依據的 Gemini 模型, 可傳回由即時 Google Search 結果支援、並附有 引用來源的 AI 合成答案。Documentation Index
Fetch the complete documentation index at: https://docs2.openclaw.ai/llms.txt
Use this file to discover all available pages before exploring further.
取得 API 金鑰
建立金鑰
前往 Google AI Studio 並建立
API 金鑰。
設定
plugins.entries.google.config.webSearch.apiKey,再使用 GEMINI_API_KEY,
最後使用 models.providers.google.apiKey。對於基礎 URL,專用的
plugins.entries.google.config.webSearch.baseUrl 會優先於
models.providers.google.baseUrl。
若是 Gateway 安裝,請將環境金鑰放在 ~/.openclaw/.env。
運作方式
不同於傳統搜尋提供者會傳回連結與摘要片段清單,Gemini 使用 Google Search 依據來產生附有 行內引用來源的 AI 合成答案。結果同時包含合成答案與來源 URL。- Gemini 依據所提供的引用 URL 會自動從 Google 重新導向 URL 解析為直接 URL。
- 重新導向解析會先使用 SSRF 防護路徑(HEAD + 重新導向檢查 + http/https 驗證),再傳回最終引用 URL。
- 重新導向解析使用嚴格的 SSRF 預設值,因此會封鎖重新導向到 私有/內部目標。
支援的參數
Gemini 搜尋支援query、freshness、date_after 和 date_before。
count 可用於共用的 web_search 相容性,但 Gemini 依據
仍會傳回一個附有引用來源的合成答案,而不是 N 筆結果的
清單。
freshness 接受 day、week、month、year,以及共用快捷值
pd、pw、pm 和 py。OpenClaw 會將這些值,或明確的
date_after/date_before 範圍,轉換為 Gemini Google Search 依據的
timeRangeFilter。不支援 country、language 和 domain_filter。
模型選擇
預設模型是gemini-2.5-flash(快速且具成本效益)。任何支援依據功能的 Gemini
模型都可透過
plugins.entries.google.config.webSearch.model 使用。
基礎 URL 覆寫
當 Gemini 網頁搜尋必須透過操作員代理或自訂 Gemini 相容端點路由時,請設定plugins.entries.google.config.webSearch.baseUrl。若未設定,
Gemini 網頁搜尋會重用 models.providers.google.baseUrl。純
https://generativelanguage.googleapis.com 值會正規化為
https://generativelanguage.googleapis.com/v1beta;自訂代理路徑會在移除尾端斜線後依提供的內容保留。
相關
- 網頁搜尋概觀 — 所有提供者與自動偵測
- Brave Search — 含摘要片段的結構化結果
- Perplexity Search — 結構化結果 + 內容擷取