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