Register two web search providers that reuse an existing chat provider's API key instead of requiring their own connection: - ollama-search (POST ollama.com/api/web_search) reuses the `ollama` key - zai-search (POST api.z.ai MCP web_search_prime) reuses the `glm` key A new `credentialFallback` registry field drives this: when a search provider has no connection of its own, the search handler falls back to the linked chat provider's credentials. Also teach getProviderIconSrc to serve .svg logos for providers that ship vector art.
35 lines
950 B
JavaScript
35 lines
950 B
JavaScript
export default {
|
|
id: "zai-search",
|
|
alias: "zai-search",
|
|
display: {
|
|
name: "GLM Coding Search",
|
|
icon: "travel_explore",
|
|
color: "#2563EB",
|
|
textIcon: "GS",
|
|
website: "https://z.ai",
|
|
notice: {
|
|
text: "Web search via the Z.AI Coding plan MCP endpoint. Reuses the API key from the GLM Coding provider.",
|
|
apiKeyUrl: "https://open.bigmodel.cn/usercenter/apikeys",
|
|
},
|
|
},
|
|
category: "apikey",
|
|
authType: "apikey",
|
|
authModes: ["apikey"],
|
|
serviceKinds: ["webSearch"],
|
|
// Credential fallback: reuses the GLM Coding plan API key — one key, chat + search.
|
|
credentialFallback: "glm",
|
|
searchConfig: {
|
|
baseUrl: "https://api.z.ai/api/mcp/web_search_prime/mcp",
|
|
method: "POST",
|
|
authType: "apikey",
|
|
authHeader: "bearer",
|
|
costPerQuery: 0,
|
|
freeMonthlyQuota: 0,
|
|
searchTypes: ["web"],
|
|
defaultMaxResults: 5,
|
|
maxMaxResults: 50,
|
|
timeoutMs: 10000,
|
|
cacheTTLMs: 300000,
|
|
},
|
|
};
|