runline 0.28.0 → 0.28.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -17,6 +17,8 @@
|
|
|
17
17
|
import { readImageInput, SEND_FILE_NOTE, writeImageFile, } from "../../_shared/imageFile.js";
|
|
18
18
|
const ENDPOINT = "https://api.openai.com/v1/images/generations";
|
|
19
19
|
const EDIT_ENDPOINT = "https://api.openai.com/v1/images/edits";
|
|
20
|
+
/** Newest GPT Image model; override per call or via the connection. */
|
|
21
|
+
const DEFAULT_MODEL = "gpt-image-2";
|
|
20
22
|
export default function openai(rl) {
|
|
21
23
|
rl.setName("openai");
|
|
22
24
|
rl.setVersion("0.1.0");
|
|
@@ -30,7 +32,7 @@ export default function openai(rl) {
|
|
|
30
32
|
defaultModel: {
|
|
31
33
|
type: "string",
|
|
32
34
|
required: false,
|
|
33
|
-
description: "Default image model when a call omits `model` (e.g. gpt-image-
|
|
35
|
+
description: "Default image model when a call omits `model` (e.g. gpt-image-1 for the older line). Falls back to gpt-image-2.",
|
|
34
36
|
env: "OPENAI_IMAGE_MODEL",
|
|
35
37
|
},
|
|
36
38
|
});
|
|
@@ -82,7 +84,7 @@ export default function openai(rl) {
|
|
|
82
84
|
const apiKey = ctx.connection.config.apiKey;
|
|
83
85
|
const model = p.model ??
|
|
84
86
|
ctx.connection.config.defaultModel ??
|
|
85
|
-
|
|
87
|
+
DEFAULT_MODEL;
|
|
86
88
|
const body = {
|
|
87
89
|
model,
|
|
88
90
|
prompt: p.prompt,
|
|
@@ -189,7 +191,7 @@ export default function openai(rl) {
|
|
|
189
191
|
const apiKey = ctx.connection.config.apiKey;
|
|
190
192
|
const model = p.model ??
|
|
191
193
|
ctx.connection.config.defaultModel ??
|
|
192
|
-
|
|
194
|
+
DEFAULT_MODEL;
|
|
193
195
|
const form = new FormData();
|
|
194
196
|
form.append("model", model);
|
|
195
197
|
form.append("prompt", p.prompt);
|