feat(provider): Z.AI endpoints + model catalog (#13456) (thanks @tomsun28) (#13456)

Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com>
This commit is contained in:
Tomsun28
2026-02-12 21:01:48 +08:00
committed by GitHub
parent b094491cf5
commit 540996f10f
17 changed files with 482 additions and 32 deletions

View File

@@ -19,7 +19,7 @@ const CODEX_MODELS = [
"gpt-5.1-codex-max",
];
const GOOGLE_PREFIXES = ["gemini-3"];
const ZAI_PREFIXES = ["glm-4.7"];
const ZAI_PREFIXES = ["glm-5", "glm-4.7", "glm-4.7-flash", "glm-4.7-flashx"];
const MINIMAX_PREFIXES = ["minimax-m2.1"];
const XAI_PREFIXES = ["grok-4"];

View File

@@ -29,4 +29,26 @@ describeLive("zai live", () => {
.join(" ");
expect(text.length).toBeGreaterThan(0);
}, 20000);
it("glm-4.7-flashx returns assistant text", async () => {
const model = getModel("zai", "glm-4.7-flashx" as "glm-4.7");
const res = await completeSimple(
model,
{
messages: [
{
role: "user",
content: "Reply with the word ok.",
timestamp: Date.now(),
},
],
},
{ apiKey: ZAI_KEY, maxTokens: 64 },
);
const text = res.content
.filter((block) => block.type === "text")
.map((block) => block.text.trim())
.join(" ");
expect(text.length).toBeGreaterThan(0);
}, 20000);
});