refactor(web-search): move providers into company plugins

This commit is contained in:
Peter Steinberger
2026-03-16 01:06:12 +00:00
parent 3aa5f2703c
commit 579d0ebe2b
14 changed files with 45 additions and 49 deletions

View File

@@ -0,0 +1,33 @@
import {
createPluginBackedWebSearchProvider,
getScopedCredentialValue,
setScopedCredentialValue,
} from "../../src/agents/tools/web-search-plugin-factory.js";
import { emptyPluginConfigSchema } from "../../src/plugins/config-schema.js";
import type { OpenClawPluginApi } from "../../src/plugins/types.js";
const googlePlugin = {
id: "google",
name: "Google Plugin",
description: "Bundled Google plugin",
configSchema: emptyPluginConfigSchema(),
register(api: OpenClawPluginApi) {
api.registerWebSearchProvider(
createPluginBackedWebSearchProvider({
id: "gemini",
label: "Gemini (Google Search)",
hint: "Google Search grounding · AI-synthesized",
envVars: ["GEMINI_API_KEY"],
placeholder: "AIza...",
signupUrl: "https://aistudio.google.com/apikey",
docsUrl: "https://docs.openclaw.ai/tools/web",
autoDetectOrder: 20,
getCredentialValue: (searchConfig) => getScopedCredentialValue(searchConfig, "gemini"),
setCredentialValue: (searchConfigTarget, value) =>
setScopedCredentialValue(searchConfigTarget, "gemini", value),
}),
);
},
};
export default googlePlugin;

View File

@@ -0,0 +1,8 @@
{
"id": "google",
"configSchema": {
"type": "object",
"additionalProperties": false,
"properties": {}
}
}

View File

@@ -0,0 +1,12 @@
{
"name": "@openclaw/google-plugin",
"version": "2026.3.14",
"private": true,
"description": "OpenClaw Google plugin",
"type": "module",
"openclaw": {
"extensions": [
"./index.ts"
]
}
}