feat: add GLM-4.7 model support to Z.ai provider

This commit is contained in:
Roo Code 2025-12-22 16:27:03 +00:00
parent 2bb375534c
commit 004d4099bc

View file

@ -5,6 +5,7 @@ import { ZaiApiLine } from "../provider-settings.js"
// https://docs.z.ai/guides/llm/glm-4-32b-0414-128k
// https://docs.z.ai/guides/llm/glm-4.5
// https://docs.z.ai/guides/llm/glm-4.6
// https://docs.z.ai/guides/llm/glm-4.7
// https://docs.z.ai/guides/overview/pricing
// https://bigmodel.cn/pricing
@ -107,6 +108,20 @@ export const internationalZAiModels = {
description:
"GLM-4.6 is Zhipu's newest model with an extended context window of up to 200k tokens, providing enhanced capabilities for processing longer documents and conversations.",
},
"glm-4.7": {
maxTokens: 98_304,
contextWindow: 200_000,
supportsImages: false,
supportsPromptCache: true,
supportsNativeTools: true,
defaultToolProtocol: "native",
inputPrice: 0.6,
outputPrice: 2.2,
cacheWritesPrice: 0,
cacheReadsPrice: 0.11,
description:
"GLM-4.7 is Zhipu's latest model with enhanced capabilities for reasoning, coding, and agent tasks, building upon the GLM-4.6 foundation with improved performance.",
},
"glm-4-32b-0414-128k": {
maxTokens: 98_304,
contextWindow: 131_072,
@ -221,6 +236,20 @@ export const mainlandZAiModels = {
description:
"GLM-4.6 is Zhipu's newest model with an extended context window of up to 200k tokens, providing enhanced capabilities for processing longer documents and conversations.",
},
"glm-4.7": {
maxTokens: 98_304,
contextWindow: 204_800,
supportsImages: false,
supportsPromptCache: true,
supportsNativeTools: true,
defaultToolProtocol: "native",
inputPrice: 0.29,
outputPrice: 1.14,
cacheWritesPrice: 0,
cacheReadsPrice: 0.057,
description:
"GLM-4.7 is Zhipu's latest model with enhanced capabilities for reasoning, coding, and agent tasks, building upon the GLM-4.6 foundation with improved performance.",
},
} as const satisfies Record<string, ModelInfo>
export const ZAI_DEFAULT_TEMPERATURE = 0.6