@@ -21,7 +21,7 @@ import { HunyuanApi } from "./platforms/tencent";
2121import { MoonshotApi } from "./platforms/moonshot" ;
2222import { SparkApi } from "./platforms/iflytek" ;
2323import { XAIApi } from "./platforms/xai" ;
24- import { GLMApi } from "./platforms/glm" ;
24+ import { ChatGLMApi } from "./platforms/glm" ;
2525
2626export const ROLES = [ "system" , "user" , "assistant" ] as const ;
2727export type MessageRole = ( typeof ROLES ) [ number ] ;
@@ -157,8 +157,8 @@ export class ClientApi {
157157 case ModelProvider . XAI :
158158 this . llm = new XAIApi ( ) ;
159159 break ;
160- case ModelProvider . GLM :
161- this . llm = new GLMApi ( ) ;
160+ case ModelProvider . ChatGLM :
161+ this . llm = new ChatGLMApi ( ) ;
162162 break ;
163163 default :
164164 this . llm = new ChatGPTApi ( ) ;
@@ -248,7 +248,7 @@ export function getHeaders(ignoreHeaders: boolean = false) {
248248 const isMoonshot = modelConfig . providerName === ServiceProvider . Moonshot ;
249249 const isIflytek = modelConfig . providerName === ServiceProvider . Iflytek ;
250250 const isXAI = modelConfig . providerName === ServiceProvider . XAI ;
251- const isGLM = modelConfig . providerName === ServiceProvider . GLM ;
251+ const isChatGLM = modelConfig . providerName === ServiceProvider . ChatGLM ;
252252 const isEnabledAccessControl = accessStore . enabledAccessControl ( ) ;
253253 const apiKey = isGoogle
254254 ? accessStore . googleApiKey
@@ -264,8 +264,8 @@ export function getHeaders(ignoreHeaders: boolean = false) {
264264 ? accessStore . moonshotApiKey
265265 : isXAI
266266 ? accessStore . xaiApiKey
267- : isGLM
268- ? accessStore . glmApiKey
267+ : isChatGLM
268+ ? accessStore . chatglmApiKey
269269 : isIflytek
270270 ? accessStore . iflytekApiKey && accessStore . iflytekApiSecret
271271 ? accessStore . iflytekApiKey + ":" + accessStore . iflytekApiSecret
@@ -281,7 +281,7 @@ export function getHeaders(ignoreHeaders: boolean = false) {
281281 isMoonshot,
282282 isIflytek,
283283 isXAI,
284- isGLM ,
284+ isChatGLM ,
285285 apiKey,
286286 isEnabledAccessControl,
287287 } ;
@@ -346,8 +346,8 @@ export function getClientApi(provider: ServiceProvider): ClientApi {
346346 return new ClientApi ( ModelProvider . Iflytek ) ;
347347 case ServiceProvider . XAI :
348348 return new ClientApi ( ModelProvider . XAI ) ;
349- case ServiceProvider . GLM :
350- return new ClientApi ( ModelProvider . GLM ) ;
349+ case ServiceProvider . ChatGLM :
350+ return new ClientApi ( ModelProvider . ChatGLM ) ;
351351 default :
352352 return new ClientApi ( ModelProvider . GPT ) ;
353353 }
0 commit comments