refactor(search): fold zai-search into the glm provider

The separate zai-search entry showed "No connections" on the web search
page because credentials live on the `glm` connection, not on it. Every
other provider that does both chat and search (antigravity, kimi, xai,
gemini) declares webSearch on the provider itself, so do the same here.

- glm gains serviceKinds ["llm", "webSearch"] and the MCP searchConfig
- the request builder / normalizer move from "zai-search" to "glm"
- drop the zai-search registry entry and its svg logo, which also
  removes the only need for svg logo support in getProviderIconSrc

ollama-search keeps its own entry and credentialFallback: its search
endpoint is unrelated to the ollama chat transport.
This commit is contained in:
decolua
2026-08-28 16:12:04 +07:00
parent 5a86f6a8d2
commit 9dbdca0e5e
7 changed files with 22 additions and 55 deletions

View File

@@ -53,6 +53,20 @@ export default {
{ id: "glm-4.7", name: "GLM 4.7" },
{ id: "glm-4.6v", name: "GLM 4.6V (Vision)" },
],
serviceKinds: ["llm", "webSearch"],
// Coding plan bundles web search on the same API key as chat.
searchConfig: {
baseUrl: "https://api.z.ai/api/mcp/web_search_prime/mcp",
method: "POST",
authType: "apikey",
authHeader: "bearer",
costPerQuery: 0,
searchTypes: ["web"],
defaultMaxResults: 5,
maxMaxResults: 50,
timeoutMs: 10000,
cacheTTLMs: 300000,
},
features: {
usage: true,
usageApikey: true,

View File

@@ -98,7 +98,6 @@ import p95 from "./xai.js";
import p96 from "./xiaomi-mimo.js";
import p97 from "./xiaomi-tokenplan.js";
import p98 from "./youcom.js";
import p124 from "./zai-search.js";
import p99 from "./alims-intl.js";
import p100 from "./codebuddy-intl.js";
// Temporarily hidden — no tool calling support (trae SOLO agent / windsurf gRPC skip ToolCallChunk).
@@ -225,7 +224,6 @@ export default [
p96,
p97,
p98,
p124,
p99,
p100,
// p102, // trae — hidden, no tool calling

View File

@@ -1,34 +0,0 @@
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,
},
};