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:
1 parent
47b5df14d7
commit
cb9a339442
11 files changed
+44
-1
No files matched your search
@@ -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":
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in new issue
Block a user