mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-31 02:32:36 +00:00
Move provider model registries, stream wrappers, OAuth helpers, and LLM utilities into src/llm with plugin-sdk barrels instead of depending on the old embedded runtime layout.
33 lines
1.4 KiB
TypeScript
33 lines
1.4 KiB
TypeScript
import { describe, expect, it } from "vitest";
|
|
import { normalizeXaiModelId } from "./api.js";
|
|
|
|
describe("normalizeXaiModelId", () => {
|
|
it("maps deprecated grok 4.20 beta ids to GA ids", () => {
|
|
expect(normalizeXaiModelId("grok-4.20-experimental-beta-0304-reasoning")).toBe(
|
|
"grok-4.20-beta-latest-reasoning",
|
|
);
|
|
expect(normalizeXaiModelId("grok-4.20-experimental-beta-0304-non-reasoning")).toBe(
|
|
"grok-4.20-beta-latest-non-reasoning",
|
|
);
|
|
});
|
|
|
|
it("maps older fast and 4.20 ids to the current OpenClaw-backed ids", () => {
|
|
expect(normalizeXaiModelId("grok-code-fast-1")).toBe("grok-build-0.1");
|
|
expect(normalizeXaiModelId("grok-code-fast")).toBe("grok-build-0.1");
|
|
expect(normalizeXaiModelId("grok-code-fast-1-0825")).toBe("grok-build-0.1");
|
|
expect(normalizeXaiModelId("grok-4-fast-reasoning")).toBe("grok-4-fast");
|
|
expect(normalizeXaiModelId("grok-4-1-fast-reasoning")).toBe("grok-4-1-fast");
|
|
expect(normalizeXaiModelId("grok-4.20-reasoning")).toBe("grok-4.20-beta-latest-reasoning");
|
|
expect(normalizeXaiModelId("grok-4.20-non-reasoning")).toBe(
|
|
"grok-4.20-beta-latest-non-reasoning",
|
|
);
|
|
});
|
|
|
|
it("leaves current xai model ids unchanged", () => {
|
|
expect(normalizeXaiModelId("grok-4.20-beta-latest-reasoning")).toBe(
|
|
"grok-4.20-beta-latest-reasoning",
|
|
);
|
|
expect(normalizeXaiModelId("grok-4")).toBe("grok-4");
|
|
});
|
|
});
|