mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-16 03:31:10 +00:00
36 lines
1.4 KiB
TypeScript
36 lines
1.4 KiB
TypeScript
import {
|
|
enablePluginInConfig,
|
|
getScopedCredentialValue,
|
|
resolveProviderWebSearchPluginConfig,
|
|
setProviderWebSearchPluginConfigValue,
|
|
setScopedCredentialValue,
|
|
type WebSearchProviderPlugin,
|
|
} from "openclaw/plugin-sdk/provider-web-search-contract";
|
|
|
|
export function createTavilyWebSearchProvider(): WebSearchProviderPlugin {
|
|
return {
|
|
id: "tavily",
|
|
label: "Tavily Search",
|
|
hint: "Structured results with domain filters and AI answer summaries",
|
|
onboardingScopes: ["text-inference"],
|
|
credentialLabel: "Tavily API key",
|
|
envVars: ["TAVILY_API_KEY"],
|
|
placeholder: "tvly-...",
|
|
signupUrl: "https://tavily.com/",
|
|
docsUrl: "https://docs.openclaw.ai/tools/tavily",
|
|
autoDetectOrder: 70,
|
|
credentialPath: "plugins.entries.tavily.config.webSearch.apiKey",
|
|
inactiveSecretPaths: ["plugins.entries.tavily.config.webSearch.apiKey"],
|
|
getCredentialValue: (searchConfig) => getScopedCredentialValue(searchConfig, "tavily"),
|
|
setCredentialValue: (searchConfigTarget, value) =>
|
|
setScopedCredentialValue(searchConfigTarget, "tavily", value),
|
|
getConfiguredCredentialValue: (config) =>
|
|
resolveProviderWebSearchPluginConfig(config, "tavily")?.apiKey,
|
|
setConfiguredCredentialValue: (configTarget, value) => {
|
|
setProviderWebSearchPluginConfigValue(configTarget, "tavily", "apiKey", value);
|
|
},
|
|
applySelectionConfig: (config) => enablePluginInConfig(config, "tavily").config,
|
|
createTool: () => null,
|
|
};
|
|
}
|