feat(image): default response_format to url for upstream compatibility
This commit is contained in:
1 parent
b612af1c38
commit
3c5e5dd023
3 files changed
+9
-4
No files matched your search
Vendored
+3
-2
@@ -188,13 +188,14 @@ export function buildOpenAIImageGenerationProvider({ isProviderApiKeyConfigured,
|
||||
});
|
||||
let response;
|
||||
let release;
|
||||
const responseFormat = pluginCfg?.responseFormat ?? "url";
|
||||
if (isEdit) {
|
||||
const form = new FormData();
|
||||
form.set("model", model);
|
||||
form.set("prompt", req.prompt);
|
||||
form.set("n", String(count));
|
||||
form.set("size", size);
|
||||
form.set("response_format", "b64_json");
|
||||
form.set("response_format", responseFormat);
|
||||
inputImages.forEach((img, idx) => {
|
||||
const mime = img.mimeType || "image/png";
|
||||
const ext = extensionForMime(mime)?.slice(1) || "png";
|
||||
@@ -221,7 +222,7 @@ export function buildOpenAIImageGenerationProvider({ isProviderApiKeyConfigured,
|
||||
prompt: req.prompt,
|
||||
n: count,
|
||||
size,
|
||||
response_format: "b64_json",
|
||||
response_format: responseFormat,
|
||||
};
|
||||
if (req.quality) {
|
||||
jsonBody.quality = req.quality;
|
||||
|
||||
Reference in new issue
Block a user