mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-19 17:11:42 -06:00
test: remove stale MiniMax core mirrors (#121120)
This commit is contained in:
committed by
GitHub
parent
c216223740
commit
5b6c19d947
@@ -1,30 +0,0 @@
|
||||
// MiniMax docs sync tests keep provider docs and live-test guidance aligned
|
||||
// with the shared MiniMax model constants.
|
||||
import fs from "node:fs";
|
||||
import path from "node:path";
|
||||
import { describe, expect, it } from "vitest";
|
||||
import {
|
||||
MINIMAX_DEFAULT_MODEL_ID,
|
||||
MINIMAX_DEFAULT_MODEL_REF,
|
||||
MINIMAX_TEXT_MODEL_REFS,
|
||||
} from "../plugin-sdk/minimax.js";
|
||||
|
||||
const repoRoot = path.resolve(import.meta.dirname, "../..");
|
||||
const testingLiveDoc = fs.readFileSync(path.join(repoRoot, "docs/help/testing-live.md"), "utf8");
|
||||
const minimaxDoc = fs.readFileSync(path.join(repoRoot, "docs/providers/minimax.md"), "utf8");
|
||||
|
||||
describe("MiniMax docs sync", () => {
|
||||
it("keeps the live-testing guide on the current MiniMax default", () => {
|
||||
expect(testingLiveDoc).toContain(MINIMAX_DEFAULT_MODEL_REF);
|
||||
});
|
||||
|
||||
it("keeps the provider doc aligned with shared MiniMax ids", () => {
|
||||
expect(minimaxDoc).toContain(MINIMAX_DEFAULT_MODEL_ID);
|
||||
expect(minimaxDoc).toContain(MINIMAX_DEFAULT_MODEL_REF);
|
||||
expect(minimaxDoc).toContain(`Unknown model: ${MINIMAX_DEFAULT_MODEL_REF}`);
|
||||
for (const modelRef of MINIMAX_TEXT_MODEL_REFS.slice(3)) {
|
||||
expect(minimaxDoc).toContain(modelRef);
|
||||
}
|
||||
expect(minimaxDoc).not.toContain("(unreleased at the time of writing)");
|
||||
});
|
||||
});
|
||||
@@ -1,74 +0,0 @@
|
||||
// Mirrors the implicit API-key and OAuth MiniMax catalogs that must stay in lockstep.
|
||||
import { describe, expect, it } from "vitest";
|
||||
|
||||
function buildMinimaxCatalog() {
|
||||
return [
|
||||
{
|
||||
id: "MiniMax-M3",
|
||||
cost: {
|
||||
input: 0.6,
|
||||
output: 2.4,
|
||||
cacheRead: 0.12,
|
||||
cacheWrite: 0,
|
||||
},
|
||||
},
|
||||
{
|
||||
id: "MiniMax-M2.7",
|
||||
cost: {
|
||||
input: 1.1,
|
||||
output: 4.4,
|
||||
cacheRead: 0.11,
|
||||
cacheWrite: 0.6875,
|
||||
},
|
||||
},
|
||||
{
|
||||
id: "MiniMax-M2.7-highspeed",
|
||||
cost: {
|
||||
input: 0.6,
|
||||
output: 2.4,
|
||||
cacheRead: 0.06,
|
||||
cacheWrite: 0.375,
|
||||
},
|
||||
},
|
||||
];
|
||||
}
|
||||
|
||||
describe("minimax provider catalog", () => {
|
||||
it("does not advertise the removed lightning model for api-key or oauth providers", () => {
|
||||
const providers = {
|
||||
minimax: { models: buildMinimaxCatalog() },
|
||||
"minimax-portal": { models: buildMinimaxCatalog() },
|
||||
};
|
||||
expect(providers?.minimax?.models?.map((model) => model.id)).toEqual([
|
||||
"MiniMax-M3",
|
||||
"MiniMax-M2.7",
|
||||
"MiniMax-M2.7-highspeed",
|
||||
]);
|
||||
expect(providers?.["minimax-portal"]?.models?.map((model) => model.id)).toEqual([
|
||||
"MiniMax-M3",
|
||||
"MiniMax-M2.7",
|
||||
"MiniMax-M2.7-highspeed",
|
||||
]);
|
||||
});
|
||||
|
||||
it("keeps MiniMax highspeed pricing distinct in implicit catalogs", () => {
|
||||
const providers = {
|
||||
minimax: { models: buildMinimaxCatalog() },
|
||||
"minimax-portal": { models: buildMinimaxCatalog() },
|
||||
};
|
||||
const apiHighspeed = providers?.minimax?.models?.find(
|
||||
(model) => model.id === "MiniMax-M2.7-highspeed",
|
||||
);
|
||||
const portalHighspeed = providers?.["minimax-portal"]?.models?.find(
|
||||
(model) => model.id === "MiniMax-M2.7-highspeed",
|
||||
);
|
||||
|
||||
expect(apiHighspeed?.cost).toEqual({
|
||||
input: 0.6,
|
||||
output: 2.4,
|
||||
cacheRead: 0.06,
|
||||
cacheWrite: 0.375,
|
||||
});
|
||||
expect(portalHighspeed?.cost).toEqual(apiHighspeed?.cost);
|
||||
});
|
||||
});
|
||||
@@ -1,29 +0,0 @@
|
||||
// Manual facade. Keep loader boundary explicit.
|
||||
type FacadeModule = {
|
||||
MINIMAX_DEFAULT_MODEL_ID: string;
|
||||
MINIMAX_DEFAULT_MODEL_REF: string;
|
||||
MINIMAX_TEXT_MODEL_REFS: readonly string[];
|
||||
};
|
||||
import {
|
||||
createLazyFacadeArrayValue,
|
||||
loadBundledPluginPublicSurfaceModuleSync,
|
||||
} from "./facade-loader.js";
|
||||
|
||||
function loadFacadeModule(): FacadeModule {
|
||||
return loadBundledPluginPublicSurfaceModuleSync<FacadeModule>({
|
||||
dirName: "minimax",
|
||||
artifactBasename: "api.js",
|
||||
});
|
||||
}
|
||||
|
||||
/** Default MiniMax text model id exposed by the bundled provider facade. */
|
||||
export const MINIMAX_DEFAULT_MODEL_ID: FacadeModule["MINIMAX_DEFAULT_MODEL_ID"] =
|
||||
loadFacadeModule().MINIMAX_DEFAULT_MODEL_ID;
|
||||
/** Default MiniMax provider/model reference used by config helpers. */
|
||||
export const MINIMAX_DEFAULT_MODEL_REF: FacadeModule["MINIMAX_DEFAULT_MODEL_REF"] =
|
||||
loadFacadeModule().MINIMAX_DEFAULT_MODEL_REF;
|
||||
/** MiniMax text model references advertised by the bundled provider facade. */
|
||||
export const MINIMAX_TEXT_MODEL_REFS: FacadeModule["MINIMAX_TEXT_MODEL_REFS"] =
|
||||
createLazyFacadeArrayValue(
|
||||
() => loadFacadeModule().MINIMAX_TEXT_MODEL_REFS as unknown as readonly unknown[],
|
||||
) as FacadeModule["MINIMAX_TEXT_MODEL_REFS"];
|
||||
Reference in New Issue
Block a user