feat(wp7-02): map provider image model ids
Dada P0-A isolated Windows CI / validate-and-package (push) Canceled after 0s

This commit is contained in:
suyx
2026-08-04 18:30:31 +08:00
parent e3c21b63a5
commit 03500bf47e
+7 -2
View File
@@ -38,6 +38,10 @@ function assertModelConfig(modelConfig) {
&& (profile.reference_endpoint !== "https://oneapi.intelligrow.cn/v1/images/edits")) {
throw new Error("WP7_02_REFERENCE_ROUTE_PROFILE_INVALID");
}
if (profile.protocol_version === "openai-images-v1" && profile.provider_model_id !== undefined
&& profile.provider_model_id !== "gemini-3.1-flash-image") {
throw new Error("WP7_02_ROUTE_PROFILE_INVALID");
}
return modelConfig;
}
@@ -104,15 +108,16 @@ export function buildProviderRequest({ modelConfig, prompt, ratio, reference })
url: config.route_profile.endpoint,
};
}
const providerModelId = config.route_profile.provider_model_id ?? config.model_id;
const body = {
model: config.model_id,
model: providerModelId,
prompt,
response_format: "b64_json",
size: gptImageRequestSizeForRatio(ratio),
};
if (reference) {
const form = new FormData();
form.append("model", config.model_id);
form.append("model", providerModelId);
form.append("prompt", prompt);
form.append("response_format", "b64_json");
form.append("size", gptImageRequestSizeForRatio(ratio));