@prestyj/ai 5.4.0 → 5.4.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.
- package/dist/index.cjs +14 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +14 -4
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -2190,6 +2190,10 @@ function extractRequestIdFromMessage(message) {
|
|
|
2190
2190
|
|
|
2191
2191
|
// src/providers/openai-codex.ts
|
|
2192
2192
|
var DEFAULT_BASE_URL = "https://chatgpt.com/backend-api";
|
|
2193
|
+
var CODEX_CLIENT_VERSION = "0.144.1";
|
|
2194
|
+
function usesResponsesLite(model) {
|
|
2195
|
+
return model.startsWith("gpt-5.6-");
|
|
2196
|
+
}
|
|
2193
2197
|
function outputTextKey(itemId, contentIndex) {
|
|
2194
2198
|
return `${itemId ?? ""}:${contentIndex ?? 0}`;
|
|
2195
2199
|
}
|
|
@@ -2205,6 +2209,7 @@ async function* runStream3(options) {
|
|
|
2205
2209
|
const downgradedImages = downgradeUnsupportedImages(options.messages, options.supportsImages);
|
|
2206
2210
|
const downgraded = downgradeUnsupportedVideos(downgradedImages, options.supportsVideo);
|
|
2207
2211
|
const { system, input } = toCodexInput(downgraded, { supportsImages: options.supportsImages });
|
|
2212
|
+
const responsesLite = usesResponsesLite(options.model);
|
|
2208
2213
|
const body = {
|
|
2209
2214
|
model: options.model,
|
|
2210
2215
|
store: false,
|
|
@@ -2212,7 +2217,7 @@ async function* runStream3(options) {
|
|
|
2212
2217
|
instructions: system,
|
|
2213
2218
|
input,
|
|
2214
2219
|
tool_choice: "auto",
|
|
2215
|
-
parallel_tool_calls:
|
|
2220
|
+
parallel_tool_calls: !responsesLite,
|
|
2216
2221
|
include: ["reasoning.encrypted_content"]
|
|
2217
2222
|
};
|
|
2218
2223
|
if (options.tools?.length) {
|
|
@@ -2224,15 +2229,20 @@ async function* runStream3(options) {
|
|
|
2224
2229
|
}
|
|
2225
2230
|
body.reasoning = {
|
|
2226
2231
|
effort: options.thinking ?? "none",
|
|
2227
|
-
summary: "auto"
|
|
2232
|
+
summary: "auto",
|
|
2233
|
+
...responsesLite ? { context: "all_turns" } : {}
|
|
2228
2234
|
};
|
|
2229
2235
|
const headers = {
|
|
2230
2236
|
"Content-Type": "application/json",
|
|
2231
2237
|
Accept: "text/event-stream",
|
|
2232
2238
|
Authorization: `Bearer ${options.apiKey}`,
|
|
2233
2239
|
"OpenAI-Beta": "responses=experimental",
|
|
2234
|
-
originator: "ezcoder",
|
|
2235
|
-
"User-Agent": `ezcoder (${import_node_os.default.platform()} ${import_node_os.default.release()}; ${import_node_os.default.arch()})
|
|
2240
|
+
originator: responsesLite ? "codex_cli_rs" : "ezcoder",
|
|
2241
|
+
"User-Agent": responsesLite ? `codex_cli_rs/${CODEX_CLIENT_VERSION}` : `ezcoder (${import_node_os.default.platform()} ${import_node_os.default.release()}; ${import_node_os.default.arch()})`,
|
|
2242
|
+
...responsesLite ? {
|
|
2243
|
+
version: CODEX_CLIENT_VERSION,
|
|
2244
|
+
"X-OpenAI-Internal-Codex-Responses-Lite": "true"
|
|
2245
|
+
} : {}
|
|
2236
2246
|
};
|
|
2237
2247
|
if (options.accountId) {
|
|
2238
2248
|
headers["chatgpt-account-id"] = options.accountId;
|