Dingpenghui-good/dsh-web-search-serper ↗★ 1
@dingpenghui/dsh-web-search-serper
基于Serper.dev的网页搜索能力提供商。 适合需要为智能体接入谷歌搜索数据以获取实时信息的任务。
安裝
此插件尚未提供可驗證的 bundle,或相容性檢查未通過。請先閱讀倉庫說明。 閱讀完整 README ↗
說明文件
閱讀完整 README ↗Configuration Options
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
apiKey | string | No | $SERPER_API_KEY, then credential reference SERPER_API_KEY | Serper API key |
baseURL | string | No | https://google.serper.dev | API endpoint base |
gl | string | No | - | Country code (e.g., us, cn, jp) |
cr | string | No | - | Region code (e.g., us; sent as the cr parameter) |
numResults | number | No | omitted (Serper defaults to 10) | Default result count, capped at 100 |
Usage Examples
Basic Search
import { apply } from '@dingpenghui/dsh-web-search-serper'
// Use in a Cordis plugin
apply(ctx, {
apiKey: 'your-api-key',
gl: 'cn',
})
Search via ctx.web
const result = await ctx.web.search({
query: 'latest AI developments 2026',
maxResults: 5,
})
console.log(result.sources)
// [
// { url: '...', title: '...', snippet: '...' },
// ...
// ]