33 mainlandZAiModels ,
44 internationalZAiDefaultModelId ,
55 mainlandZAiDefaultModelId ,
6- type InternationalZAiModelId ,
7- type MainlandZAiModelId ,
86 ZAI_DEFAULT_TEMPERATURE ,
97 zaiApiLineConfigs ,
108} from "@roo-code/types"
@@ -13,19 +11,22 @@ import type { ApiHandlerOptions } from "../../shared/api"
1311
1412import { BaseOpenAiCompatibleProvider } from "./base-openai-compatible-provider"
1513
16- export class ZAiHandler extends BaseOpenAiCompatibleProvider < InternationalZAiModelId | MainlandZAiModelId > {
14+ export class ZAiHandler extends BaseOpenAiCompatibleProvider < string > {
1715 constructor ( options : ApiHandlerOptions ) {
1816 const isChina = zaiApiLineConfigs [ options . zaiApiLine ?? "international_coding" ] . isChina
19- const models = isChina ? mainlandZAiModels : internationalZAiModels
20- const defaultModelId = isChina ? mainlandZAiDefaultModelId : internationalZAiDefaultModelId
17+ const models = ( isChina ? mainlandZAiModels : internationalZAiModels ) as Record <
18+ string ,
19+ import ( "@roo-code/types" ) . ModelInfo
20+ >
21+ const defaultModelId = ( isChina ? mainlandZAiDefaultModelId : internationalZAiDefaultModelId ) as string
2122
2223 super ( {
2324 ...options ,
2425 providerName : "Z AI" ,
2526 baseURL : zaiApiLineConfigs [ options . zaiApiLine ?? "international_coding" ] . baseUrl ,
2627 apiKey : options . zaiApiKey ?? "not-provided" ,
27- defaultProviderModelId : defaultModelId ,
28- providerModels : models ,
28+ defaultProviderModelId : defaultModelId as any ,
29+ providerModels : models as any ,
2930 defaultTemperature : ZAI_DEFAULT_TEMPERATURE ,
3031 } )
3132 }
0 commit comments