From c39a1fc23ab37f95cf785d932205560433fcd6e6 Mon Sep 17 00:00:00 2001 From: yyhhyyyyyy Date: Wed, 30 Jul 2025 14:59:32 +0800 Subject: [PATCH 1/2] feat: add support for Zhipu GLM 4.5 series models --- .../configPresenter/modelDefaultSettings.ts | 57 ++++++++++++++++++ .../configPresenter/providerModelSettings.ts | 59 ++++++++++++++++++- .../providers/zhipuProvider.ts | 45 ++++++++++++++ 3 files changed, 160 insertions(+), 1 deletion(-) diff --git a/src/main/presenter/configPresenter/modelDefaultSettings.ts b/src/main/presenter/configPresenter/modelDefaultSettings.ts index 4274d8e41..83999d19f 100644 --- a/src/main/presenter/configPresenter/modelDefaultSettings.ts +++ b/src/main/presenter/configPresenter/modelDefaultSettings.ts @@ -1367,6 +1367,63 @@ export const defaultModelsSettings: DefaultModelSetting[] = [ functionCall: true, reasoning: false }, + + // Zhipu + { + id: 'glm-4.5', + name: 'GLM-4.5', + temperature: 0.7, + maxTokens: 8192, + contextLength: 128000, + match: ['glm-4.5'], + vision: false, + functionCall: true, + reasoning: true + }, + { + id: 'glm-4.5-air', + name: 'GLM-4.5-Air', + temperature: 0.7, + maxTokens: 8192, + contextLength: 128000, + match: ['glm-4.5-air'], + vision: false, + functionCall: true, + reasoning: true + }, + { + id: 'glm-4.5-x', + name: 'GLM-4.5-X', + temperature: 0.7, + maxTokens: 8192, + contextLength: 128000, + match: ['glm-4.5-x'], + vision: false, + functionCall: true, + reasoning: true + }, + { + id: 'glm-4.5-airx', + name: 'GLM-4.5-AirX', + temperature: 0.7, + maxTokens: 8192, + contextLength: 128000, + match: ['glm-4.5-airx'], + vision: false, + functionCall: true, + reasoning: true + }, + { + id: 'glm-4.5-flash', + name: 'GLM-4.5-Flash', + temperature: 0.7, + maxTokens: 8192, + contextLength: 128000, + match: ['glm-4.5-flash'], + vision: false, + functionCall: true, + reasoning: true + }, { id: 'glm-4-plus', name: 'GLM-4-Plus', diff --git a/src/main/presenter/configPresenter/providerModelSettings.ts b/src/main/presenter/configPresenter/providerModelSettings.ts index 9869f7329..1cebdd469 100644 --- a/src/main/presenter/configPresenter/providerModelSettings.ts +++ b/src/main/presenter/configPresenter/providerModelSettings.ts @@ -237,7 +237,64 @@ export const providerModelSettings: Record { return [ // 语言模型 + { + id: 'glm-4.5', + name: 'GLM-4.5', + group: 'zhipu', + providerId: this.provider.id, + isCustom: false, + contextLength: 128000, + maxTokens: 8192 + }, + { + id: 'glm-4.5-air', + name: 'GLM-4.5-Air', + group: 'zhipu', + providerId: this.provider.id, + isCustom: false, + contextLength: 128000, + maxTokens: 8192 + }, + { + id: 'glm-4.5-x', + name: 'GLM-4.5-X', + group: 'zhipu', + providerId: this.provider.id, + isCustom: false, + contextLength: 128000, + maxTokens: 8192 + }, + { + id: 'glm-4.5-airx', + name: 'GLM-4.5-AirX', + group: 'zhipu', + providerId: this.provider.id, + isCustom: false, + contextLength: 128000, + maxTokens: 8192 + }, + { + id: 'glm-4.5-flash', + name: 'GLM-4.5-Flash', + group: 'zhipu', + providerId: this.provider.id, + isCustom: false, + contextLength: 128000, + maxTokens: 8192 + }, { id: 'glm-4-plus', name: 'GLM-4-Plus', From ae6ca29cfbbf808a7eb25d72ce5d016594e2699e Mon Sep 17 00:00:00 2001 From: yyhhyyyyyy Date: Wed, 30 Jul 2025 15:03:30 +0800 Subject: [PATCH 2/2] style: code fmt --- src/main/presenter/configPresenter/modelDefaultSettings.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/presenter/configPresenter/modelDefaultSettings.ts b/src/main/presenter/configPresenter/modelDefaultSettings.ts index 83999d19f..d0e6ca104 100644 --- a/src/main/presenter/configPresenter/modelDefaultSettings.ts +++ b/src/main/presenter/configPresenter/modelDefaultSettings.ts @@ -1367,7 +1367,7 @@ export const defaultModelsSettings: DefaultModelSetting[] = [ functionCall: true, reasoning: false }, - + // Zhipu { id: 'glm-4.5',