跳轉到主要內容

Documentation Index

Fetch the complete documentation index at: https://docs.openclaw.ai/llms.txt

Use this file to discover all available pages before exploring further.

OpenClaw 支援 Exa AI 作為 web_search 提供者。Exa 提供神經、關鍵字與混合搜尋模式,並內建內容 擷取功能(重點、文字、摘要)。

取得 API 金鑰

1

建立帳戶

exa.ai 註冊,並從你的 儀表板產生 API 金鑰。
2

儲存金鑰

在 Gateway 環境中設定 EXA_API_KEY,或透過下列方式設定:
openclaw configure --section web

設定

{
  plugins: {
    entries: {
      exa: {
        config: {
          webSearch: {
            apiKey: "exa-...", // optional if EXA_API_KEY is set
          },
        },
      },
    },
  },
  tools: {
    web: {
      search: {
        provider: "exa",
      },
    },
  },
}
環境替代方式: 在 Gateway 環境中設定 EXA_API_KEY。 若是 gateway 安裝,請放在 ~/.openclaw/.env

工具參數

query
string
必填
搜尋查詢。
count
number
要傳回的結果數量 (1–100)。
type
'auto' | 'neural' | 'fast' | 'deep' | 'deep-reasoning' | 'instant'
搜尋模式。
freshness
'day' | 'week' | 'month' | 'year'
時間篩選器。
date_after
string
此日期之後的結果 (YYYY-MM-DD)。
date_before
string
此日期之前的結果 (YYYY-MM-DD)。
contents
object
內容擷取選項(見下方)。

內容擷取

Exa 可以在搜尋結果旁一併傳回擷取的內容。傳入 contents 物件即可啟用:
await web_search({
  query: "transformer architecture explained",
  type: "neural",
  contents: {
    text: true, // full page text
    highlights: { numSentences: 3 }, // key sentences
    summary: true, // AI summary
  },
});
內容選項類型說明
textboolean | { maxCharacters }擷取完整頁面文字
highlightsboolean | { maxCharacters, query, numSentences, highlightsPerUrl }擷取關鍵句子
summaryboolean | { query }AI 產生的摘要

搜尋模式

模式說明
autoExa 選擇最佳模式(預設)
neural語意/以意義為基礎的搜尋
fast快速關鍵字搜尋
deep完整的深度搜尋
deep-reasoning具推理能力的深度搜尋
instant最快的結果

備註

  • 如果未提供 contents 選項,Exa 預設為 { highlights: true }, 因此結果會包含關鍵句摘錄
  • 可用時,結果會保留 Exa API 回應中的 highlightScoressummary 欄位
  • 結果描述會先從重點解析,再從摘要解析,最後才從 完整文字解析,視何者可用而定
  • freshnessdate_after/date_before 不能合併使用,請使用一種 時間篩選模式
  • 每個查詢最多可傳回 100 筆結果(受 Exa 搜尋類型 限制影響)
  • 結果預設快取 15 分鐘(可透過 cacheTtlMinutes 設定)
  • Exa 是官方 API 整合,提供結構化 JSON 回應

相關