mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-08-05 14:52:09 +03:00
fix: preserve kie market model ids
This commit is contained in:
@@ -392,8 +392,6 @@ async function handleKieImageGeneration({
|
||||
if (isMarket) {
|
||||
// Unified Market API endpoint
|
||||
baseUrl = `${providerConfig.baseUrl.replace(/\/$/, "")}/api/v1/jobs/createTask`;
|
||||
// Strip category prefix (e.g., "gpt/gpt-image-2" -> "gpt-image-2")
|
||||
const marketModelId = model.includes("/") ? model.split("/").pop() : model;
|
||||
const input: Record<string, unknown> = {
|
||||
prompt,
|
||||
aspect_ratio: mapImageSize(size, "1:1"),
|
||||
@@ -402,7 +400,7 @@ async function handleKieImageGeneration({
|
||||
input.image_url = imageUrl;
|
||||
}
|
||||
payload = {
|
||||
model: marketModelId,
|
||||
model,
|
||||
input,
|
||||
};
|
||||
} else {
|
||||
|
||||
@@ -266,7 +266,7 @@ async function handleKieMusicGeneration({
|
||||
if (isMarket) {
|
||||
url = `${baseUrl}/api/v1/jobs/createTask`;
|
||||
payload = {
|
||||
model: model.includes("/") ? model.split("/").pop() : model,
|
||||
model,
|
||||
callBackUrl: getKieCallbackUrl(body),
|
||||
input: {
|
||||
prompt,
|
||||
@@ -310,7 +310,9 @@ async function handleKieMusicGeneration({
|
||||
|
||||
const statusUrl = isMarket
|
||||
? `${baseUrl}/api/v1/jobs/recordInfo`
|
||||
: providerConfig.statusUrl || `${baseUrl}/api/v1/generate/record-info`;
|
||||
: providerConfig.statusUrl && !providerConfig.statusUrl.includes("jobs/recordInfo")
|
||||
? providerConfig.statusUrl
|
||||
: `${baseUrl}/api/v1/generate/record-info`;
|
||||
|
||||
const { data: recordData, state } = await kieExecutor.pollTask({
|
||||
statusUrl,
|
||||
|
||||
@@ -328,11 +328,8 @@ async function handleKieVideoGeneration({
|
||||
return { success: false, status: 401, error: "KIE API key is required" };
|
||||
}
|
||||
|
||||
// Strip category prefix (e.g., "veo/veo-3-1" -> "veo-3-1")
|
||||
const marketModelId = model.includes("/") ? model.split("/").pop() : model;
|
||||
|
||||
const payload = {
|
||||
model: marketModelId,
|
||||
model,
|
||||
input: {
|
||||
prompt,
|
||||
duration: body.duration ? String(body.duration) : "5",
|
||||
|
||||
Reference in New Issue
Block a user