fix: keep ruxa image modelId from configuration without remap
This commit is contained in:
parent
3d7147d242
commit
da9c8671fe
@ -8,15 +8,6 @@ interface ResolveModelRuntimeIdOptions {
|
|||||||
providerType?: string | null;
|
providerType?: string | null;
|
||||||
}
|
}
|
||||||
|
|
||||||
function fallbackRuxaRuntimeId(modelId: string) {
|
|
||||||
if (!modelId.startsWith("google/")) {
|
|
||||||
return modelId;
|
|
||||||
}
|
|
||||||
|
|
||||||
const candidate = modelId.slice("google/".length).trim();
|
|
||||||
return candidate || modelId;
|
|
||||||
}
|
|
||||||
|
|
||||||
function toRecord(value: unknown): Record<string, unknown> | null {
|
function toRecord(value: unknown): Record<string, unknown> | null {
|
||||||
if (typeof value !== "object" || value === null || Array.isArray(value)) {
|
if (typeof value !== "object" || value === null || Array.isArray(value)) {
|
||||||
return null;
|
return null;
|
||||||
@ -46,9 +37,5 @@ export function resolveModelRuntimeId(
|
|||||||
}
|
}
|
||||||
|
|
||||||
const resolvedModelId = normalizeRuntimeModelId(model?.modelId) || "";
|
const resolvedModelId = normalizeRuntimeModelId(model?.modelId) || "";
|
||||||
if (options?.providerType === "ruxa-image") {
|
|
||||||
return fallbackRuxaRuntimeId(resolvedModelId);
|
|
||||||
}
|
|
||||||
|
|
||||||
return resolvedModelId;
|
return resolvedModelId;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user