@yhong91/cpac 0.1.44 → 0.1.45
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/config.js +11 -9
- package/package.json +1 -1
package/dist/config.js
CHANGED
|
@@ -315,16 +315,18 @@ function catalogDocument(bytes) {
|
|
|
315
315
|
throw new CPACError("invalid CPA catalog");
|
|
316
316
|
}
|
|
317
317
|
}
|
|
318
|
-
// Codex
|
|
319
|
-
//
|
|
318
|
+
// Codex rejects the catalog on extra input_modalities values or a missing
|
|
319
|
+
// supported_reasoning_levels field. Keep unknown fields; coerce these two.
|
|
320
320
|
function sanitizeModelModalities(model) {
|
|
321
|
-
if (
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
: [];
|
|
327
|
-
|
|
321
|
+
if ("input_modalities" in model) {
|
|
322
|
+
const raw = model.input_modalities;
|
|
323
|
+
const accepted = Array.isArray(raw)
|
|
324
|
+
? raw.filter((value) => value === "text" || value === "image" || value === "audio")
|
|
325
|
+
: [];
|
|
326
|
+
model.input_modalities = accepted.length > 0 ? accepted : ["text"];
|
|
327
|
+
}
|
|
328
|
+
if (!Array.isArray(model.supported_reasoning_levels))
|
|
329
|
+
model.supported_reasoning_levels = [];
|
|
328
330
|
}
|
|
329
331
|
export function sanitizeCatalogModalities(bytes) {
|
|
330
332
|
const document = catalogDocument(bytes);
|