@victor-software-house/pi-openai-proxy 4.7.0 → 4.7.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.mjs +15 -5
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1247,18 +1247,28 @@ const REASONING_EFFORT_MAP = {
|
|
|
1247
1247
|
xhigh: "xhigh"
|
|
1248
1248
|
};
|
|
1249
1249
|
/**
|
|
1250
|
-
* APIs
|
|
1251
|
-
*
|
|
1250
|
+
* APIs that use the OpenAI chat completions wire format and accept standard
|
|
1251
|
+
* passthrough fields (stop, seed, top_p, tool_choice, etc.) in the payload.
|
|
1252
|
+
*
|
|
1253
|
+
* Only these APIs receive injected fields via onPayload. All other APIs
|
|
1254
|
+
* (anthropic-messages, google-*, bedrock-*, openai-codex-responses) use
|
|
1255
|
+
* different payload schemas that reject unknown fields.
|
|
1252
1256
|
*/
|
|
1253
|
-
const
|
|
1257
|
+
const OPENAI_COMPLETIONS_COMPATIBLE_APIS = new Set([
|
|
1258
|
+
"openai-completions",
|
|
1259
|
+
"openai-responses",
|
|
1260
|
+
"azure-openai-responses",
|
|
1261
|
+
"mistral-conversations"
|
|
1262
|
+
]);
|
|
1254
1263
|
/**
|
|
1255
1264
|
* Collect fields that need to be injected via onPayload.
|
|
1256
|
-
*
|
|
1265
|
+
* Only injects for APIs that use the OpenAI chat completions wire format.
|
|
1266
|
+
* Non-compatible APIs (Anthropic, Google, Bedrock, Codex) reject unknown fields.
|
|
1257
1267
|
*
|
|
1258
1268
|
* @internal Exported for unit testing only.
|
|
1259
1269
|
*/
|
|
1260
1270
|
function collectPayloadFields(request, api) {
|
|
1261
|
-
if (
|
|
1271
|
+
if (!OPENAI_COMPLETIONS_COMPATIBLE_APIS.has(api)) return;
|
|
1262
1272
|
const fields = {};
|
|
1263
1273
|
let hasFields = false;
|
|
1264
1274
|
if (request.stop !== void 0) {
|
package/package.json
CHANGED