@@ -11,6 +11,7 @@ import {
1111 DEFAULT_OLLAMA_CONFIG ,
1212 DEFAULT_OPENAI_CONFIG ,
1313 DEFAULT_OPENROUTER_CONFIG ,
14+ DEFAULT_ZAI_CONFIG ,
1415} from "src/Services/DefaultConfigs" ;
1516import { getDefaultToolWhitelist } from "src/Services/ToolSupportDetector" ;
1617
@@ -49,6 +50,8 @@ export interface ApiKeySettings {
4950 anthropicApiKey : string ;
5051 /** API Key for Gemini - used for Google Gemini models */
5152 geminiApiKey : string ;
53+ /** API Key for Z.AI - used for GLM models (both Standard API and Coding Plan) */
54+ zaiApiKey : string ;
5255}
5356
5457/**
@@ -154,6 +157,18 @@ export interface LmStudioFrontmatterSettings {
154157 lmstudioDefaultFrequencyPenalty : number ;
155158}
156159
160+ /**
161+ * Provider-specific frontmatter settings for Z.AI
162+ */
163+ export interface ZaiFrontmatterSettings {
164+ /** Default model for Z.AI chats */
165+ zaiDefaultModel : string ;
166+ /** Default temperature for Z.AI chats */
167+ zaiDefaultTemperature : number ;
168+ /** Default max tokens for Z.AI chats */
169+ zaiDefaultMaxTokens : number ;
170+ }
171+
157172/**
158173 * Chat template settings
159174 */
@@ -178,6 +193,8 @@ export interface ServiceUrlSettings {
178193 anthropicUrl : string ;
179194 /** URL for Gemini API */
180195 geminiUrl : string ;
196+ /** URL for Z.AI API (Standard: /api/paas/v4, Coding Plan: /api/anthropic) */
197+ zaiUrl : string ;
181198}
182199
183200/**
@@ -211,7 +228,8 @@ export interface ChatGPT_MDSettings
211228 GeminiFrontmatterSettings ,
212229 OpenRouterFrontmatterSettings ,
213230 OllamaFrontmatterSettings ,
214- LmStudioFrontmatterSettings { }
231+ LmStudioFrontmatterSettings ,
232+ ZaiFrontmatterSettings { }
215233
216234/**
217235 * Default settings
@@ -222,6 +240,7 @@ export const DEFAULT_SETTINGS: ChatGPT_MDSettings = {
222240 openrouterApiKey : "" ,
223241 anthropicApiKey : "" ,
224242 geminiApiKey : "" ,
243+ zaiApiKey : "" ,
225244
226245 // Service URLs
227246 openaiUrl : DEFAULT_OPENAI_CONFIG . url ,
@@ -230,6 +249,7 @@ export const DEFAULT_SETTINGS: ChatGPT_MDSettings = {
230249 lmstudioUrl : DEFAULT_LMSTUDIO_CONFIG . url ,
231250 anthropicUrl : DEFAULT_ANTHROPIC_CONFIG . url ,
232251 geminiUrl : DEFAULT_GEMINI_CONFIG . url ,
252+ zaiUrl : DEFAULT_ZAI_CONFIG . url ,
233253
234254 // Folders
235255 chatFolder : "ChatGPT_MD/chats" ,
@@ -294,4 +314,9 @@ export const DEFAULT_SETTINGS: ChatGPT_MDSettings = {
294314 lmstudioDefaultTopP : DEFAULT_LMSTUDIO_CONFIG . top_p ,
295315 lmstudioDefaultPresencePenalty : DEFAULT_LMSTUDIO_CONFIG . presence_penalty ,
296316 lmstudioDefaultFrequencyPenalty : DEFAULT_LMSTUDIO_CONFIG . frequency_penalty ,
317+
318+ // Z.AI Defaults
319+ zaiDefaultModel : DEFAULT_ZAI_CONFIG . model ,
320+ zaiDefaultTemperature : DEFAULT_ZAI_CONFIG . temperature ,
321+ zaiDefaultMaxTokens : DEFAULT_ZAI_CONFIG . max_tokens ,
297322} ;
0 commit comments