mirror of
https://github.com/Nezumi-2711/9router.git
synced 2026-09-22 05:31:47 +00:00
Switch baseUrl from coding-intl.dashscope.aliyuncs.com (Coding Plan keys only) to dashscope-intl.aliyuncs.com/compatible-mode so ordinary DashScope API keys authenticate. Path /v1/chat/completions and preserveCacheControl quirk unchanged. Fixes #2591
25 lines
1.1 KiB
JavaScript
25 lines
1.1 KiB
JavaScript
// #2591 — Alibaba Intl (alicode-intl) must use the OpenAI-compatible-mode
|
|
// DashScope endpoint so standard DashScope API keys work. The previous
|
|
// coding-intl host only accepted Alibaba Coding Plan keys and rejected
|
|
// ordinary DashScope keys with "Invalid API key".
|
|
import { describe, it, expect } from "vitest";
|
|
import alicodeIntl from "../../open-sse/providers/registry/alicode-intl.js";
|
|
|
|
describe("alicode-intl endpoint (issue #2591)", () => {
|
|
it("routes to the compatible-mode DashScope endpoint", () => {
|
|
expect(alicodeIntl.id).toBe("alicode-intl");
|
|
expect(alicodeIntl.transport.baseUrl).toBe(
|
|
"https://dashscope-intl.aliyuncs.com/compatible-mode/v1/chat/completions"
|
|
);
|
|
});
|
|
|
|
it("does not use the coding-intl host that rejects standard keys", () => {
|
|
expect(alicodeIntl.transport.baseUrl).not.toContain("coding-intl.dashscope.aliyuncs.com");
|
|
});
|
|
|
|
it("keeps the chat/completions path and preserveCacheControl quirk", () => {
|
|
expect(alicodeIntl.transport.baseUrl).toContain("/v1/chat/completions");
|
|
expect(alicodeIntl.transport.quirks.preserveCacheControl).toBe(true);
|
|
});
|
|
});
|