mirror of
https://github.com/farcasclaudiu/openclaw.git
synced 2026-06-22 07:01:44 +03:00
refactor: split minimax-cn provider
This commit is contained in:
@@ -23,6 +23,30 @@ export async function applyAuthChoiceMiniMax(
|
|||||||
): Promise<ApplyAuthChoiceResult | null> {
|
): Promise<ApplyAuthChoiceResult | null> {
|
||||||
let nextConfig = params.config;
|
let nextConfig = params.config;
|
||||||
let agentModelOverride: string | undefined;
|
let agentModelOverride: string | undefined;
|
||||||
|
const ensureMinimaxApiKey = async (opts: {
|
||||||
|
profileId: string;
|
||||||
|
promptMessage: string;
|
||||||
|
}): Promise<void> => {
|
||||||
|
let hasCredential = false;
|
||||||
|
const envKey = resolveEnvApiKey("minimax");
|
||||||
|
if (envKey) {
|
||||||
|
const useExisting = await params.prompter.confirm({
|
||||||
|
message: `Use existing MINIMAX_API_KEY (${envKey.source}, ${formatApiKeyPreview(envKey.apiKey)})?`,
|
||||||
|
initialValue: true,
|
||||||
|
});
|
||||||
|
if (useExisting) {
|
||||||
|
await setMinimaxApiKey(envKey.apiKey, params.agentDir, opts.profileId);
|
||||||
|
hasCredential = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!hasCredential) {
|
||||||
|
const key = await params.prompter.text({
|
||||||
|
message: opts.promptMessage,
|
||||||
|
validate: validateApiKeyInput,
|
||||||
|
});
|
||||||
|
await setMinimaxApiKey(normalizeApiKeyInput(String(key)), params.agentDir, opts.profileId);
|
||||||
|
}
|
||||||
|
};
|
||||||
const noteAgentModel = async (model: string) => {
|
const noteAgentModel = async (model: string) => {
|
||||||
if (!params.agentId) {
|
if (!params.agentId) {
|
||||||
return;
|
return;
|
||||||
@@ -58,25 +82,10 @@ export async function applyAuthChoiceMiniMax(
|
|||||||
) {
|
) {
|
||||||
const modelId =
|
const modelId =
|
||||||
params.authChoice === "minimax-api-lightning" ? "MiniMax-M2.5-Lightning" : "MiniMax-M2.5";
|
params.authChoice === "minimax-api-lightning" ? "MiniMax-M2.5-Lightning" : "MiniMax-M2.5";
|
||||||
let hasCredential = false;
|
await ensureMinimaxApiKey({
|
||||||
const envKey = resolveEnvApiKey("minimax");
|
profileId: "minimax:default",
|
||||||
if (envKey) {
|
promptMessage: "Enter MiniMax API key",
|
||||||
const useExisting = await params.prompter.confirm({
|
});
|
||||||
message: `Use existing MINIMAX_API_KEY (${envKey.source}, ${formatApiKeyPreview(envKey.apiKey)})?`,
|
|
||||||
initialValue: true,
|
|
||||||
});
|
|
||||||
if (useExisting) {
|
|
||||||
await setMinimaxApiKey(envKey.apiKey, params.agentDir);
|
|
||||||
hasCredential = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (!hasCredential) {
|
|
||||||
const key = await params.prompter.text({
|
|
||||||
message: "Enter MiniMax API key",
|
|
||||||
validate: validateApiKeyInput,
|
|
||||||
});
|
|
||||||
await setMinimaxApiKey(normalizeApiKeyInput(String(key)), params.agentDir);
|
|
||||||
}
|
|
||||||
nextConfig = applyAuthProfileConfig(nextConfig, {
|
nextConfig = applyAuthProfileConfig(nextConfig, {
|
||||||
profileId: "minimax:default",
|
profileId: "minimax:default",
|
||||||
provider: "minimax",
|
provider: "minimax",
|
||||||
@@ -101,38 +110,23 @@ export async function applyAuthChoiceMiniMax(
|
|||||||
|
|
||||||
if (params.authChoice === "minimax-api-key-cn") {
|
if (params.authChoice === "minimax-api-key-cn") {
|
||||||
const modelId = "MiniMax-M2.5";
|
const modelId = "MiniMax-M2.5";
|
||||||
let hasCredential = false;
|
await ensureMinimaxApiKey({
|
||||||
const envKey = resolveEnvApiKey("minimax");
|
profileId: "minimax-cn:default",
|
||||||
if (envKey) {
|
promptMessage: "Enter MiniMax China API key",
|
||||||
const useExisting = await params.prompter.confirm({
|
});
|
||||||
message: `Use existing MINIMAX_API_KEY (${envKey.source}, ${formatApiKeyPreview(envKey.apiKey)})?`,
|
|
||||||
initialValue: true,
|
|
||||||
});
|
|
||||||
if (useExisting) {
|
|
||||||
await setMinimaxApiKey(envKey.apiKey, params.agentDir);
|
|
||||||
hasCredential = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (!hasCredential) {
|
|
||||||
const key = await params.prompter.text({
|
|
||||||
message: "Enter MiniMax China API key",
|
|
||||||
validate: validateApiKeyInput,
|
|
||||||
});
|
|
||||||
await setMinimaxApiKey(normalizeApiKeyInput(String(key)), params.agentDir);
|
|
||||||
}
|
|
||||||
nextConfig = applyAuthProfileConfig(nextConfig, {
|
nextConfig = applyAuthProfileConfig(nextConfig, {
|
||||||
profileId: "minimax:default",
|
profileId: "minimax-cn:default",
|
||||||
provider: "minimax",
|
provider: "minimax-cn",
|
||||||
mode: "api_key",
|
mode: "api_key",
|
||||||
});
|
});
|
||||||
{
|
{
|
||||||
const modelRef = `minimax/${modelId}`;
|
const modelRef = `minimax-cn/${modelId}`;
|
||||||
const applied = await applyDefaultModelChoice({
|
const applied = await applyDefaultModelChoice({
|
||||||
config: nextConfig,
|
config: nextConfig,
|
||||||
setDefaultModel: params.setDefaultModel,
|
setDefaultModel: params.setDefaultModel,
|
||||||
defaultModel: modelRef,
|
defaultModel: modelRef,
|
||||||
applyDefaultConfig: applyMinimaxApiConfigCn,
|
applyDefaultConfig: (config) => applyMinimaxApiConfigCn(config, modelId),
|
||||||
applyProviderConfig: applyMinimaxApiProviderConfigCn,
|
applyProviderConfig: (config) => applyMinimaxApiProviderConfigCn(config, modelId),
|
||||||
noteAgentModel,
|
noteAgentModel,
|
||||||
prompter: params.prompter,
|
prompter: params.prompter,
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -253,18 +253,18 @@ describe("applyAuthChoice", () => {
|
|||||||
expect(text).toHaveBeenCalledWith(
|
expect(text).toHaveBeenCalledWith(
|
||||||
expect.objectContaining({ message: "Enter MiniMax China API key" }),
|
expect.objectContaining({ message: "Enter MiniMax China API key" }),
|
||||||
);
|
);
|
||||||
expect(result.config.auth?.profiles?.["minimax:default"]).toMatchObject({
|
expect(result.config.auth?.profiles?.["minimax-cn:default"]).toMatchObject({
|
||||||
provider: "minimax",
|
provider: "minimax-cn",
|
||||||
mode: "api_key",
|
mode: "api_key",
|
||||||
});
|
});
|
||||||
expect(result.config.models?.providers?.minimax?.baseUrl).toBe(MINIMAX_CN_API_BASE_URL);
|
expect(result.config.models?.providers?.["minimax-cn"]?.baseUrl).toBe(MINIMAX_CN_API_BASE_URL);
|
||||||
|
|
||||||
const authProfilePath = authProfilePathFor(requireAgentDir());
|
const authProfilePath = authProfilePathFor(requireAgentDir());
|
||||||
const raw = await fs.readFile(authProfilePath, "utf8");
|
const raw = await fs.readFile(authProfilePath, "utf8");
|
||||||
const parsed = JSON.parse(raw) as {
|
const parsed = JSON.parse(raw) as {
|
||||||
profiles?: Record<string, { key?: string }>;
|
profiles?: Record<string, { key?: string }>;
|
||||||
};
|
};
|
||||||
expect(parsed.profiles?.["minimax:default"]?.key).toBe("sk-minimax-test");
|
expect(parsed.profiles?.["minimax-cn:default"]?.key).toBe("sk-minimax-test");
|
||||||
});
|
});
|
||||||
|
|
||||||
it("prompts and writes Synthetic API key when selecting synthetic-api-key", async () => {
|
it("prompts and writes Synthetic API key when selecting synthetic-api-key", async () => {
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ const PREFERRED_PROVIDER_BY_AUTH_CHOICE: Partial<Record<AuthChoice, string>> = {
|
|||||||
"copilot-proxy": "copilot-proxy",
|
"copilot-proxy": "copilot-proxy",
|
||||||
"minimax-cloud": "minimax",
|
"minimax-cloud": "minimax",
|
||||||
"minimax-api": "minimax",
|
"minimax-api": "minimax",
|
||||||
"minimax-api-key-cn": "minimax",
|
"minimax-api-key-cn": "minimax-cn",
|
||||||
"minimax-api-lightning": "minimax",
|
"minimax-api-lightning": "minimax",
|
||||||
minimax: "lmstudio",
|
minimax: "lmstudio",
|
||||||
"opencode-zen": "opencode",
|
"opencode-zen": "opencode",
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import type { OpenClawConfig } from "../config/config.js";
|
import type { OpenClawConfig } from "../config/config.js";
|
||||||
|
import type { ModelProviderConfig } from "../config/types.models.js";
|
||||||
import {
|
import {
|
||||||
buildMinimaxApiModelDefinition,
|
buildMinimaxApiModelDefinition,
|
||||||
buildMinimaxModelDefinition,
|
buildMinimaxModelDefinition,
|
||||||
@@ -151,14 +152,22 @@ export function applyMinimaxApiProviderConfig(
|
|||||||
cfg: OpenClawConfig,
|
cfg: OpenClawConfig,
|
||||||
modelId: string = "MiniMax-M2.5",
|
modelId: string = "MiniMax-M2.5",
|
||||||
): OpenClawConfig {
|
): OpenClawConfig {
|
||||||
return applyMinimaxApiProviderConfigWithBaseUrl(cfg, modelId, MINIMAX_API_BASE_URL);
|
return applyMinimaxApiProviderConfigWithBaseUrl(cfg, {
|
||||||
|
providerId: "minimax",
|
||||||
|
modelId,
|
||||||
|
baseUrl: MINIMAX_API_BASE_URL,
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
export function applyMinimaxApiConfig(
|
export function applyMinimaxApiConfig(
|
||||||
cfg: OpenClawConfig,
|
cfg: OpenClawConfig,
|
||||||
modelId: string = "MiniMax-M2.5",
|
modelId: string = "MiniMax-M2.5",
|
||||||
): OpenClawConfig {
|
): OpenClawConfig {
|
||||||
return applyMinimaxApiConfigWithBaseUrl(cfg, modelId, MINIMAX_API_BASE_URL);
|
return applyMinimaxApiConfigWithBaseUrl(cfg, {
|
||||||
|
providerId: "minimax",
|
||||||
|
modelId,
|
||||||
|
baseUrl: MINIMAX_API_BASE_URL,
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// MiniMax China API (api.minimaxi.com)
|
// MiniMax China API (api.minimaxi.com)
|
||||||
@@ -166,44 +175,58 @@ export function applyMinimaxApiProviderConfigCn(
|
|||||||
cfg: OpenClawConfig,
|
cfg: OpenClawConfig,
|
||||||
modelId: string = "MiniMax-M2.5",
|
modelId: string = "MiniMax-M2.5",
|
||||||
): OpenClawConfig {
|
): OpenClawConfig {
|
||||||
return applyMinimaxApiProviderConfigWithBaseUrl(cfg, modelId, MINIMAX_CN_API_BASE_URL);
|
return applyMinimaxApiProviderConfigWithBaseUrl(cfg, {
|
||||||
|
providerId: "minimax-cn",
|
||||||
|
modelId,
|
||||||
|
baseUrl: MINIMAX_CN_API_BASE_URL,
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
export function applyMinimaxApiConfigCn(
|
export function applyMinimaxApiConfigCn(
|
||||||
cfg: OpenClawConfig,
|
cfg: OpenClawConfig,
|
||||||
modelId: string = "MiniMax-M2.5",
|
modelId: string = "MiniMax-M2.5",
|
||||||
): OpenClawConfig {
|
): OpenClawConfig {
|
||||||
return applyMinimaxApiConfigWithBaseUrl(cfg, modelId, MINIMAX_CN_API_BASE_URL);
|
return applyMinimaxApiConfigWithBaseUrl(cfg, {
|
||||||
|
providerId: "minimax-cn",
|
||||||
|
modelId,
|
||||||
|
baseUrl: MINIMAX_CN_API_BASE_URL,
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type MinimaxApiProviderConfigParams = {
|
||||||
|
providerId: string;
|
||||||
|
modelId: string;
|
||||||
|
baseUrl: string;
|
||||||
|
};
|
||||||
|
|
||||||
function applyMinimaxApiProviderConfigWithBaseUrl(
|
function applyMinimaxApiProviderConfigWithBaseUrl(
|
||||||
cfg: OpenClawConfig,
|
cfg: OpenClawConfig,
|
||||||
modelId: string,
|
params: MinimaxApiProviderConfigParams,
|
||||||
baseUrl: string,
|
|
||||||
): OpenClawConfig {
|
): OpenClawConfig {
|
||||||
const providers = { ...cfg.models?.providers };
|
const providers = { ...cfg.models?.providers } as Record<string, ModelProviderConfig>;
|
||||||
const existingProvider = providers.minimax;
|
const existingProvider = providers[params.providerId];
|
||||||
const existingModels = Array.isArray(existingProvider?.models) ? existingProvider.models : [];
|
const existingModels = existingProvider?.models ?? [];
|
||||||
const apiModel = buildMinimaxApiModelDefinition(modelId);
|
const apiModel = buildMinimaxApiModelDefinition(params.modelId);
|
||||||
const hasApiModel = existingModels.some((model) => model.id === modelId);
|
const hasApiModel = existingModels.some((model) => model.id === params.modelId);
|
||||||
const mergedModels = hasApiModel ? existingModels : [...existingModels, apiModel];
|
const mergedModels = hasApiModel ? existingModels : [...existingModels, apiModel];
|
||||||
const { apiKey: existingApiKey, ...existingProviderRest } = (existingProvider ?? {}) as Record<
|
const { apiKey: existingApiKey, ...existingProviderRest } = existingProvider ?? {
|
||||||
string,
|
baseUrl: params.baseUrl,
|
||||||
unknown
|
models: [],
|
||||||
> as { apiKey?: string };
|
};
|
||||||
const resolvedApiKey = typeof existingApiKey === "string" ? existingApiKey : undefined;
|
const resolvedApiKey = typeof existingApiKey === "string" ? existingApiKey : undefined;
|
||||||
const normalizedApiKey = resolvedApiKey?.trim() === "minimax" ? "" : resolvedApiKey;
|
const normalizedApiKey = resolvedApiKey?.trim() === "minimax" ? "" : resolvedApiKey;
|
||||||
providers.minimax = {
|
providers[params.providerId] = {
|
||||||
...existingProviderRest,
|
...existingProviderRest,
|
||||||
baseUrl,
|
baseUrl: params.baseUrl,
|
||||||
api: "anthropic-messages",
|
api: "anthropic-messages",
|
||||||
...(normalizedApiKey?.trim() ? { apiKey: normalizedApiKey } : {}),
|
...(normalizedApiKey?.trim() ? { apiKey: normalizedApiKey } : {}),
|
||||||
models: mergedModels.length > 0 ? mergedModels : [apiModel],
|
models: mergedModels.length > 0 ? mergedModels : [apiModel],
|
||||||
};
|
};
|
||||||
|
|
||||||
const models = { ...cfg.agents?.defaults?.models };
|
const models = { ...cfg.agents?.defaults?.models };
|
||||||
models[`minimax/${modelId}`] = {
|
const modelRef = `${params.providerId}/${params.modelId}`;
|
||||||
...models[`minimax/${modelId}`],
|
models[modelRef] = {
|
||||||
|
...models[modelRef],
|
||||||
alias: "Minimax",
|
alias: "Minimax",
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -222,10 +245,9 @@ function applyMinimaxApiProviderConfigWithBaseUrl(
|
|||||||
|
|
||||||
function applyMinimaxApiConfigWithBaseUrl(
|
function applyMinimaxApiConfigWithBaseUrl(
|
||||||
cfg: OpenClawConfig,
|
cfg: OpenClawConfig,
|
||||||
modelId: string,
|
params: MinimaxApiProviderConfigParams,
|
||||||
baseUrl: string,
|
|
||||||
): OpenClawConfig {
|
): OpenClawConfig {
|
||||||
const next = applyMinimaxApiProviderConfigWithBaseUrl(cfg, modelId, baseUrl);
|
const next = applyMinimaxApiProviderConfigWithBaseUrl(cfg, params);
|
||||||
return {
|
return {
|
||||||
...next,
|
...next,
|
||||||
agents: {
|
agents: {
|
||||||
@@ -239,7 +261,7 @@ function applyMinimaxApiConfigWithBaseUrl(
|
|||||||
fallbacks: (next.agents.defaults.model as { fallbacks?: string[] }).fallbacks,
|
fallbacks: (next.agents.defaults.model as { fallbacks?: string[] }).fallbacks,
|
||||||
}
|
}
|
||||||
: undefined),
|
: undefined),
|
||||||
primary: `minimax/${modelId}`,
|
primary: `${params.providerId}/${params.modelId}`,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -50,13 +50,18 @@ export async function setGeminiApiKey(key: string, agentDir?: string) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function setMinimaxApiKey(key: string, agentDir?: string) {
|
export async function setMinimaxApiKey(
|
||||||
|
key: string,
|
||||||
|
agentDir?: string,
|
||||||
|
profileId: string = "minimax:default",
|
||||||
|
) {
|
||||||
|
const provider = profileId.split(":")[0] ?? "minimax";
|
||||||
// Write to resolved agent dir so gateway finds credentials on startup.
|
// Write to resolved agent dir so gateway finds credentials on startup.
|
||||||
upsertAuthProfile({
|
upsertAuthProfile({
|
||||||
profileId: "minimax:default",
|
profileId,
|
||||||
credential: {
|
credential: {
|
||||||
type: "api_key",
|
type: "api_key",
|
||||||
provider: "minimax",
|
provider,
|
||||||
key,
|
key,
|
||||||
},
|
},
|
||||||
agentDir: resolveAuthAgentDir(agentDir),
|
agentDir: resolveAuthAgentDir(agentDir),
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ import os from "node:os";
|
|||||||
import path from "node:path";
|
import path from "node:path";
|
||||||
import { setTimeout as delay } from "node:timers/promises";
|
import { setTimeout as delay } from "node:timers/promises";
|
||||||
import { describe, expect, it } from "vitest";
|
import { describe, expect, it } from "vitest";
|
||||||
|
import { MINIMAX_API_BASE_URL, MINIMAX_CN_API_BASE_URL } from "./onboard-auth.js";
|
||||||
import { OPENAI_DEFAULT_MODEL } from "./openai-model-default.js";
|
import { OPENAI_DEFAULT_MODEL } from "./openai-model-default.js";
|
||||||
|
|
||||||
type RuntimeMock = {
|
type RuntimeMock = {
|
||||||
@@ -178,7 +179,7 @@ describe("onboard (non-interactive): provider auth", () => {
|
|||||||
|
|
||||||
expect(cfg.auth?.profiles?.["minimax:default"]?.provider).toBe("minimax");
|
expect(cfg.auth?.profiles?.["minimax:default"]?.provider).toBe("minimax");
|
||||||
expect(cfg.auth?.profiles?.["minimax:default"]?.mode).toBe("api_key");
|
expect(cfg.auth?.profiles?.["minimax:default"]?.mode).toBe("api_key");
|
||||||
expect(cfg.models?.providers?.minimax?.baseUrl).toBe("https://api.minimax.io/anthropic");
|
expect(cfg.models?.providers?.minimax?.baseUrl).toBe(MINIMAX_API_BASE_URL);
|
||||||
expect(cfg.agents?.defaults?.model?.primary).toBe("minimax/MiniMax-M2.5");
|
expect(cfg.agents?.defaults?.model?.primary).toBe("minimax/MiniMax-M2.5");
|
||||||
await expectApiKeyProfile({
|
await expectApiKeyProfile({
|
||||||
profileId: "minimax:default",
|
profileId: "minimax:default",
|
||||||
@@ -209,13 +210,13 @@ describe("onboard (non-interactive): provider auth", () => {
|
|||||||
models?: { providers?: Record<string, { baseUrl?: string }> };
|
models?: { providers?: Record<string, { baseUrl?: string }> };
|
||||||
}>(configPath);
|
}>(configPath);
|
||||||
|
|
||||||
expect(cfg.auth?.profiles?.["minimax:default"]?.provider).toBe("minimax");
|
expect(cfg.auth?.profiles?.["minimax-cn:default"]?.provider).toBe("minimax-cn");
|
||||||
expect(cfg.auth?.profiles?.["minimax:default"]?.mode).toBe("api_key");
|
expect(cfg.auth?.profiles?.["minimax-cn:default"]?.mode).toBe("api_key");
|
||||||
expect(cfg.models?.providers?.minimax?.baseUrl).toBe("https://api.minimaxi.com/anthropic");
|
expect(cfg.models?.providers?.["minimax-cn"]?.baseUrl).toBe(MINIMAX_CN_API_BASE_URL);
|
||||||
expect(cfg.agents?.defaults?.model?.primary).toBe("minimax/MiniMax-M2.5");
|
expect(cfg.agents?.defaults?.model?.primary).toBe("minimax-cn/MiniMax-M2.5");
|
||||||
await expectApiKeyProfile({
|
await expectApiKeyProfile({
|
||||||
profileId: "minimax:default",
|
profileId: "minimax-cn:default",
|
||||||
provider: "minimax",
|
provider: "minimax-cn",
|
||||||
key: "sk-minimax-test",
|
key: "sk-minimax-test",
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -574,8 +574,11 @@ export async function applyNonInteractiveAuthChoice(params: {
|
|||||||
authChoice === "minimax-api-key-cn" ||
|
authChoice === "minimax-api-key-cn" ||
|
||||||
authChoice === "minimax-api-lightning"
|
authChoice === "minimax-api-lightning"
|
||||||
) {
|
) {
|
||||||
|
const isCn = authChoice === "minimax-api-key-cn";
|
||||||
|
const providerId = isCn ? "minimax-cn" : "minimax";
|
||||||
|
const profileId = `${providerId}:default`;
|
||||||
const resolved = await resolveNonInteractiveApiKey({
|
const resolved = await resolveNonInteractiveApiKey({
|
||||||
provider: "minimax",
|
provider: providerId,
|
||||||
cfg: baseConfig,
|
cfg: baseConfig,
|
||||||
flagValue: opts.minimaxApiKey,
|
flagValue: opts.minimaxApiKey,
|
||||||
flagName: "--minimax-api-key",
|
flagName: "--minimax-api-key",
|
||||||
@@ -586,16 +589,16 @@ export async function applyNonInteractiveAuthChoice(params: {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
if (resolved.source !== "profile") {
|
if (resolved.source !== "profile") {
|
||||||
await setMinimaxApiKey(resolved.key);
|
await setMinimaxApiKey(resolved.key, undefined, profileId);
|
||||||
}
|
}
|
||||||
nextConfig = applyAuthProfileConfig(nextConfig, {
|
nextConfig = applyAuthProfileConfig(nextConfig, {
|
||||||
profileId: "minimax:default",
|
profileId,
|
||||||
provider: "minimax",
|
provider: providerId,
|
||||||
mode: "api_key",
|
mode: "api_key",
|
||||||
});
|
});
|
||||||
const modelId =
|
const modelId =
|
||||||
authChoice === "minimax-api-lightning" ? "MiniMax-M2.5-Lightning" : "MiniMax-M2.5";
|
authChoice === "minimax-api-lightning" ? "MiniMax-M2.5-Lightning" : "MiniMax-M2.5";
|
||||||
return authChoice === "minimax-api-key-cn"
|
return isCn
|
||||||
? applyMinimaxApiConfigCn(nextConfig, modelId)
|
? applyMinimaxApiConfigCn(nextConfig, modelId)
|
||||||
: applyMinimaxApiConfig(nextConfig, modelId);
|
: applyMinimaxApiConfig(nextConfig, modelId);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user