mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-28 16:17:23 +00:00
Normalize Google Gemini 3.1 Flash Lite routing to the GA model id and keep the retired preview spelling as a compatibility alias. Align default alias docs, FAQ guidance, and deprecated-model manifest recommendations with the GA id. Fixes #86151. Co-authored-by: Sebastien Tardif <sebtardif@ncf.ca>
44 lines
1.8 KiB
TypeScript
44 lines
1.8 KiB
TypeScript
import { describe, expect, it } from "vitest";
|
|
import { normalizeAntigravityModelId, normalizeGoogleModelId } from "./api.js";
|
|
|
|
describe("google model id helpers", () => {
|
|
it.each(["gemini-3-pro", "gemini-3.1-pro", "gemini-3-1-pro"])(
|
|
"adds default -low suffix to bare antigravity pro id: %s",
|
|
(id) => {
|
|
expect(normalizeAntigravityModelId(id)).toBe(`${id}-low`);
|
|
},
|
|
);
|
|
|
|
it.each([
|
|
"gemini-3-pro-low",
|
|
"gemini-3-pro-high",
|
|
"gemini-3.1-flash",
|
|
"claude-opus-4-6-thinking",
|
|
])("keeps already-tiered and non-pro ids unchanged: %s", (id) => {
|
|
expect(normalizeAntigravityModelId(id)).toBe(id);
|
|
});
|
|
|
|
it("maps the deprecated 3.1 flash alias to the real preview model", () => {
|
|
expect(normalizeGoogleModelId("gemini-3.1-flash")).toBe("gemini-3-flash-preview");
|
|
expect(normalizeGoogleModelId("gemini-3.1-flash-preview")).toBe("gemini-3-flash-preview");
|
|
});
|
|
|
|
it("keeps bare Gemini 3.1 Pro as an alias for Google's preview-suffixed API id", () => {
|
|
expect(normalizeGoogleModelId("gemini-3-pro")).toBe("gemini-3.1-pro-preview");
|
|
expect(normalizeGoogleModelId("gemini-3-pro-preview")).toBe("gemini-3.1-pro-preview");
|
|
expect(normalizeGoogleModelId("gemini-3.1-pro")).toBe("gemini-3.1-pro-preview");
|
|
expect(normalizeGoogleModelId("gemini-3.1-pro-preview")).toBe("gemini-3.1-pro-preview");
|
|
});
|
|
|
|
it("normalizes provider-prefixed Gemini 3 Pro config ids", () => {
|
|
expect(normalizeGoogleModelId("google/gemini-3-pro-preview")).toBe(
|
|
"google/gemini-3.1-pro-preview",
|
|
);
|
|
});
|
|
|
|
it("keeps GA gemini-3.1-flash-lite unchanged and maps old preview name to GA", () => {
|
|
expect(normalizeGoogleModelId("gemini-3.1-flash-lite")).toBe("gemini-3.1-flash-lite");
|
|
expect(normalizeGoogleModelId("gemini-3.1-flash-lite-preview")).toBe("gemini-3.1-flash-lite");
|
|
});
|
|
});
|