更新 README.md、manifest.json、openapi.json 和 plugin.json 文件,重构为 Google Custom Search 插件,添加设置步骤、认证方式和限制信息,更新 API 相关参数和描述。

This commit is contained in:
foryoung365 2025-04-28 18:38:21 +08:00
parent 6e187fd927
commit 00a04bc016
4 changed files with 99 additions and 33 deletions

View File

@ -1,6 +1,41 @@
Formatting [Serper](https://serper.dev/) search API with OpenAPI format.
# LobeChat Google Custom Search 插件
Designed for [LobeChat](https://github.com/lobehub/lobe-chat).
See this plugin [on their plugin store page](https://lobechat.com/discover/plugin/search-engine-serper).
使用 [Google Custom Search API](https://developers.google.com/custom-search) 的LobeChat搜索插件。
`(Not affliated with any entities above.)`
## 设置步骤
1. 创建 Google Custom Search Engine
- 访问 [Google Programmable Search Engine](https://programmablesearch.google.com/create)
- 创建一个自定义搜索引擎
- 获取您的搜索引擎ID (cx参数)
2. 获取 Google API 密钥
- 访问 [Google Cloud Console](https://console.cloud.google.com/)
- 创建一个项目
- 启用 "Custom Search API"
- 创建API密钥 (key参数)
3. 在LobeChat中配置插件
- 将此插件添加到LobeChat
- 在配置页面中提供您的API密钥和搜索引擎ID
- 这些凭据会作为安全参数自动添加到每个请求中
## 认证方式
此插件使用以下两个安全参数:
- `key`: 您的Google API密钥
- `cx`: 您的自定义搜索引擎ID
这两个参数会作为查询参数添加到API请求中。
## 限制
- Google Custom Search API 免费版每天限制100次查询
- 付费版可获得更多配额
## 隐私
- 您的搜索查询将发送到Google
- 此插件不会收集或存储您的个人数据
`(与上述任何实体无关联)`

View File

@ -1,18 +1,18 @@
{
"api": {
"type": "openapi",
"url": "https://raw.githubusercontent.com/GithuBarry/chat-plugin-search-engine/main/public/openapi.json",
"url": "https://raw.githubusercontent.com/foryoung365/lobechat-plugin-google/main/public/openapi.json",
"is_user_authenticated": false
},
"auth": {
"type": "none"
},
"contact_email": "33831597+GithuBarry@users.noreply.github.com",
"description_for_human": "Google search engine via Serper.dev free API (2500x🆓/month)",
"description_for_model": "Plugin for performing web searches using the Serper.dev API to access Google search results.",
"legal_info_url": "https://serper.dev/terms",
"logo_url": "https://serper.dev/favicon.ico",
"name_for_human": "Search Google via Serper",
"name_for_model": "search-engine-serper",
"contact_email": "1758359+foryoung365@users.noreply.github.com",
"description_for_human": "Google custom search engine API (100🆓/day)",
"description_for_model": "Plugin for performing web searches using the Google custom search engine API.",
"legal_info_url": "https://developers.google.com/custom-search/v1/introduction",
"logo_url": "https://www.google.com/favicon.ico",
"name_for_human": "Search Google via Google Custom Search",
"name_for_model": "search-engine-google-custom-search",
"schema_version": "v1"
}

View File

@ -1,10 +1,17 @@
{
"components": {
"securitySchemes": {
"apiAuth": {
"googleApiKey": {
"type": "apiKey",
"name": "X-API-KEY",
"in": "header"
"name": "key",
"in": "query",
"description": "API key for Google Custom Search API"
},
"customSearchId": {
"type": "apiKey",
"name": "cx",
"in": "query",
"description": "The custom search engine ID to use for this request"
}
}
},
@ -14,9 +21,9 @@
},
"openapi": "3.0.0",
"paths": {
"/search": {
"post": {
"summary": "Search Google and return top 10 results",
"/customsearch/v1": {
"get": {
"summary": "Search Google using Custom Search API",
"operationId": "searchGoogle",
"parameters": [
{
@ -28,6 +35,16 @@
"required": true,
"description": "Search query string"
},
{
"in": "query",
"name": "num",
"schema": {
"type": "integer",
"default": 10
},
"required": false,
"description": "Number of search results to return (1-10)"
},
{
"in": "query",
"name": "gl",
@ -35,7 +52,7 @@
"type": "string"
},
"required": false,
"description": "Google Geo location parameter"
"description": "Geolocation of end user (country code)"
},
{
"in": "query",
@ -44,7 +61,7 @@
"type": "string"
},
"required": false,
"description": "Google Geo locale parameter"
"description": "Interface language"
}
],
"responses": {
@ -54,14 +71,26 @@
"application/json": {
"schema": {
"type": "object",
"required": [
"result"
],
"properties": {
"result": {
"type": "string",
"description": "Top 10 search results",
"example": "\"title\": \"周末游推荐\",\n\"link\": \"https://www.example.com/destinations-for-weekends\",\n\"snippet\": \"周末去哪玩?周末旅游频道,精心推荐数百个周末游经典线路\",\n\"position\": 1"
"items": {
"type": "array",
"items": {
"type": "object",
"properties": {
"title": {
"type": "string",
"description": "The title of the search result"
},
"link": {
"type": "string",
"description": "The URL of the search result"
},
"snippet": {
"type": "string",
"description": "A snippet of text from the search result"
}
}
}
}
}
}
@ -71,7 +100,8 @@
},
"security": [
{
"apiAuth": []
"googleApiKey": [],
"customSearchId": []
}
]
}
@ -79,12 +109,13 @@
},
"security": [
{
"apiAuth": []
"googleApiKey": [],
"customSearchId": []
}
],
"servers": [
{
"url": "https://google.serper.dev"
"url": "https://www.googleapis.com"
}
]
}

View File

@ -1,13 +1,13 @@
{
"author": "Barry",
"homepage": "https://github.com/GithuBarry/chat-plugin-search-engine",
"identifier": "search-engine-serper",
"identifier": "search-engine-google-custom",
"manifest": "https://raw.githubusercontent.com/GithuBarry/chat-plugin-search-engine/main/public/manifest.json",
"meta": {
"avatar": "🔍",
"description": "Google search engine via Serper.dev free API (2500x🆓/month)",
"description": "Google search engine via Google Custom Search API (100🆓/day)",
"tags": ["web", "search"],
"title": "Search Google via Serper"
"title": "Search Google via Custom Search"
},
"schemaVersion": 1
}