Add ability to choose chinese endpoint for Moonshot provider (#4924)

* Add ability to choose chinese endpoint for Moonshot provider

* Create fluffy-planes-prove.md
This commit is contained in:
Saoud Rizwan authored and GitHub committed 2025-07-15 03:33:17 -07:00
1 parent 47b5df14d7
commit cb9a339442
11 files changed
+44 -1

No files matched your search

+1
View File
@@ -191,6 +191,7 @@ function createHandlerForProvider(apiProvider: string | undefined, options: Omit
case "moonshot":
return new MoonshotHandler({
moonshotApiKey: options.moonshotApiKey,
moonshotApiLine: options.moonshotApiLine,
apiModelId: options.apiModelId,
})
case "nebius":
+3 -1
View File
@@ -8,6 +8,7 @@ import { ModelInfo, MoonshotModelId, moonshotModels, moonshotDefaultModelId } fr
interface MoonshotHandlerOptions {
moonshotApiKey?: string
moonshotApiLine?: string
apiModelId?: string
}
@@ -23,7 +24,8 @@ export class MoonshotHandler implements ApiHandler {
}
try {
this.client = new OpenAI({
baseURL: "https://api.moonshot.ai/v1",
baseURL:
this.options.moonshotApiLine === "china" ? "https://api.moonshot.cn/v1" : "https://api.moonshot.ai/v1",
apiKey: this.options.moonshotApiKey,
})
} catch (error) {