@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.js
CHANGED
|
@@ -2134,6 +2134,10 @@ function extractRequestIdFromMessage(message) {
|
|
|
2134
2134
|
|
|
2135
2135
|
// src/providers/openai-codex.ts
|
|
2136
2136
|
var DEFAULT_BASE_URL = "https://chatgpt.com/backend-api";
|
|
2137
|
+
var CODEX_CLIENT_VERSION = "0.144.1";
|
|
2138
|
+
function usesResponsesLite(model) {
|
|
2139
|
+
return model.startsWith("gpt-5.6-");
|
|
2140
|
+
}
|
|
2137
2141
|
function outputTextKey(itemId, contentIndex) {
|
|
2138
2142
|
return `${itemId ?? ""}:${contentIndex ?? 0}`;
|
|
2139
2143
|
}
|
|
@@ -2149,6 +2153,7 @@ async function* runStream3(options) {
|
|
|
2149
2153
|
const downgradedImages = downgradeUnsupportedImages(options.messages, options.supportsImages);
|
|
2150
2154
|
const downgraded = downgradeUnsupportedVideos(downgradedImages, options.supportsVideo);
|
|
2151
2155
|
const { system, input } = toCodexInput(downgraded, { supportsImages: options.supportsImages });
|
|
2156
|
+
const responsesLite = usesResponsesLite(options.model);
|
|
2152
2157
|
const body = {
|
|
2153
2158
|
model: options.model,
|
|
2154
2159
|
store: false,
|
|
@@ -2156,7 +2161,7 @@ async function* runStream3(options) {
|
|
|
2156
2161
|
instructions: system,
|
|
2157
2162
|
input,
|
|
2158
2163
|
tool_choice: "auto",
|
|
2159
|
-
parallel_tool_calls:
|
|
2164
|
+
parallel_tool_calls: !responsesLite,
|
|
2160
2165
|
include: ["reasoning.encrypted_content"]
|
|
2161
2166
|
};
|
|
2162
2167
|
if (options.tools?.length) {
|
|
@@ -2168,15 +2173,20 @@ async function* runStream3(options) {
|
|
|
2168
2173
|
}
|
|
2169
2174
|
body.reasoning = {
|
|
2170
2175
|
effort: options.thinking ?? "none",
|
|
2171
|
-
summary: "auto"
|
|
2176
|
+
summary: "auto",
|
|
2177
|
+
...responsesLite ? { context: "all_turns" } : {}
|
|
2172
2178
|
};
|
|
2173
2179
|
const headers = {
|
|
2174
2180
|
"Content-Type": "application/json",
|
|
2175
2181
|
Accept: "text/event-stream",
|
|
2176
2182
|
Authorization: `Bearer ${options.apiKey}`,
|
|
2177
2183
|
"OpenAI-Beta": "responses=experimental",
|
|
2178
|
-
originator: "ggcoder",
|
|
2179
|
-
"User-Agent": `ggcoder (${os.platform()} ${os.release()}; ${os.arch()})
|
|
2184
|
+
originator: responsesLite ? "codex_cli_rs" : "ggcoder",
|
|
2185
|
+
"User-Agent": responsesLite ? `codex_cli_rs/${CODEX_CLIENT_VERSION}` : `ggcoder (${os.platform()} ${os.release()}; ${os.arch()})`,
|
|
2186
|
+
...responsesLite ? {
|
|
2187
|
+
version: CODEX_CLIENT_VERSION,
|
|
2188
|
+
"X-OpenAI-Internal-Codex-Responses-Lite": "true"
|
|
2189
|
+
} : {}
|
|
2180
2190
|
};
|
|
2181
2191
|
if (options.accountId) {
|
|
2182
2192
|
headers["chatgpt-account-id"] = options.accountId;
|