fix: address kie provider pr review

This commit is contained in:
wauputr4
2026-05-07 01:20:09 +07:00
parent a591b4fc4b
commit 667ce4db06
3 changed files with 14 additions and 4 deletions

View File

@@ -14,7 +14,6 @@ import { VertexExecutor } from "./vertex.ts";
import { CliproxyapiExecutor } from "./cliproxyapi.ts";
import { PerplexityWebExecutor } from "./perplexity-web.ts";
import { GrokWebExecutor } from "./grok-web.ts";
import { KieExecutor } from "./kie.ts";
import { ChatGptWebExecutor } from "./chatgpt-web.ts";
import { BlackboxWebExecutor } from "./blackbox-web.ts";
import { MuseSparkWebExecutor } from "./muse-spark-web.ts";
@@ -53,7 +52,6 @@ const executors = {
"perplexity-web": new PerplexityWebExecutor(),
"pplx-web": new PerplexityWebExecutor(), // Alias
"grok-web": new GrokWebExecutor(),
kie: new KieExecutor(),
"chatgpt-web": new ChatGptWebExecutor(),
"cgpt-web": new ChatGptWebExecutor(), // Alias
"blackbox-web": new BlackboxWebExecutor(),

View File

@@ -466,8 +466,8 @@ async function handleKieImageGeneration({
payload = {
prompt,
image_size: mapImageSize(size, "1:1"),
num_images: body.n || 1,
size: mapImageSize(size, "1:1"),
nVariants: body.n || 1,
};
}

View File

@@ -0,0 +1,12 @@
import test from "node:test";
import assert from "node:assert/strict";
import { DefaultExecutor } from "../../open-sse/executors/default.ts";
import { getExecutor, hasSpecializedExecutor } from "../../open-sse/executors/index.ts";
import { KieExecutor } from "../../open-sse/executors/kie.ts";
test("KIE chat traffic uses the default executor while media keeps its task executor", () => {
assert.equal(hasSpecializedExecutor("kie"), false);
assert.ok(getExecutor("kie") instanceof DefaultExecutor);
assert.equal(typeof KieExecutor, "function");
});