codex-copilot-dx 0.4.10 → 0.4.11
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/package.json +1 -1
- package/src/adapter.mjs +12 -0
package/package.json
CHANGED
package/src/adapter.mjs
CHANGED
|
@@ -228,6 +228,17 @@ function responsesInputItems(input) {
|
|
|
228
228
|
return Array.isArray(input) ? cloneJson(input) : [cloneJson(input)];
|
|
229
229
|
}
|
|
230
230
|
|
|
231
|
+
export function stripInternalResponsesInputFields(inputItems) {
|
|
232
|
+
if (!Array.isArray(inputItems)) return inputItems;
|
|
233
|
+
for (const item of inputItems) {
|
|
234
|
+
if (!item || typeof item !== "object") continue;
|
|
235
|
+
for (const key of Object.keys(item)) {
|
|
236
|
+
if (key.startsWith("internal_")) delete item[key];
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
return inputItems;
|
|
240
|
+
}
|
|
241
|
+
|
|
231
242
|
function responsesOutputItems(output) {
|
|
232
243
|
if (!Array.isArray(output)) return [];
|
|
233
244
|
return cloneJson(output.filter((item) => item?.type === "message" || item?.type === "function_call"));
|
|
@@ -335,6 +346,7 @@ export function prepareResponsesRequest(reqBody) {
|
|
|
335
346
|
body.tools = body.tools.filter((tool) => tool?.type !== "image_generation");
|
|
336
347
|
if (!body.tools.length) delete body.tools;
|
|
337
348
|
}
|
|
349
|
+
stripInternalResponsesInputFields(body.input);
|
|
338
350
|
|
|
339
351
|
return { body, inputItems: body.input };
|
|
340
352
|
}
|