mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-08-17 20:52:15 +03:00
refactor(providers): split KIE image catalog out of imageRegistry to respect file-size cap
imageRegistry.ts hit 805 lines after adding the MiniMax image provider (cap is 800). Extract the KIE image-model catalog (largest single provider entry, ~35 models) into its own semantic-family module, providers/registry/kie/imageModels.ts, following the same pattern already used for LMARENA_DIRECT_IMAGE_MODELS. imageRegistry.ts now imports KIE_IMAGE_MODELS instead of inlining the list. Also update minimax-media-servicekinds.test.ts: getRegistryMediaKinds derives membership by design from every registry in MEDIA_KIND_REGISTRIES, including IMAGE_PROVIDERS. Now that minimax is a key in IMAGE_PROVIDERS, it correctly gains the "image" kind alongside tts/video/music — the same behavior already asserted for openai in this file. The exact-match assertion is updated to ["image","music","tts","video"]; the other assertions (which only check .includes for tts/video/music/llm) were already correct and untouched.
This commit is contained in:
@@ -10,16 +10,16 @@ import assert from "node:assert/strict";
|
||||
// serviceKinds, so every media page was empty. The fix derives media membership from
|
||||
// the registries (single source of truth) and unions it with declared serviceKinds.
|
||||
//
|
||||
// MiniMax was the flagged case: its international endpoint serves TTS/video/music, the
|
||||
// China variant (minimax-cn) has no media registry entries.
|
||||
// MiniMax was the flagged case: its international endpoint serves TTS/video/music/image,
|
||||
// the China variant (minimax-cn) has no media registry entries.
|
||||
|
||||
const { getRegistryMediaKinds, resolveProviderServiceKinds, REGISTRY_MEDIA_KINDS } =
|
||||
await import("../../open-sse/config/mediaServiceKinds.ts");
|
||||
const { AI_PROVIDERS } = await import("../../src/shared/constants/providers.ts");
|
||||
|
||||
test("minimax (international) derives tts/video/music from the registries", () => {
|
||||
test("minimax (international) derives image/tts/video/music from the registries", () => {
|
||||
const kinds = getRegistryMediaKinds("minimax").sort();
|
||||
assert.deepEqual(kinds, ["music", "tts", "video"]);
|
||||
assert.deepEqual(kinds, ["image", "music", "tts", "video"]);
|
||||
});
|
||||
|
||||
test("minimax-cn derives no media kinds (China endpoint has no media registry entries)", () => {
|
||||
|
||||
Reference in New Issue
Block a user