@jeffusion/bungee-core 5.23.0 → 5.23.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/main.js +2692 -243
- package/dist/plugins/chatgpt-oauth/index.js +92 -20
- package/dist/plugins/chatgpt-oauth/index.js.map +4 -4
- package/dist/plugins/codex-router/control.js +606 -2
- package/dist/plugins/codex-router/control.js.map +19 -4
- package/dist/plugins/codex-router/index.js +127 -48
- package/dist/plugins/codex-router/index.js.map +7 -6
- package/dist/plugins/codex-router/manifest.json +14 -14
- package/dist/plugins/llm-protocol-adapter/control.js +4 -3
- package/dist/plugins/llm-protocol-adapter/control.js.map +3 -3
- package/dist/plugins/llm-protocol-adapter/index.js +4 -3
- package/dist/plugins/llm-protocol-adapter/index.js.map +4 -4
- package/dist/plugins/token-metering/index.js +1 -1
- package/dist/plugins/token-metering/index.js.map +1 -1
- package/package.json +2 -2
|
@@ -6151,7 +6151,8 @@ async function relayPayload(result, param, signal) {
|
|
|
6151
6151
|
if (result.status < 200 || result.status >= 300)
|
|
6152
6152
|
throw new DataAdmissionError(result.status === 401 || result.status === 429 ? result.status : 502, "llm_adapter_relay_upstream_failed", undefined, { param, message: `Relay upstream rejected the request (HTTP ${result.status})` });
|
|
6153
6153
|
let response;
|
|
6154
|
-
|
|
6154
|
+
const contentType = result.bodyHandle.identity.contentType;
|
|
6155
|
+
if (contentType === "" || contentType.includes("text/event-stream") || contentType.includes("application/octet-stream")) {
|
|
6155
6156
|
const iterator = result.bodyHandle.events({ id: "llm-adapter.relay", mandatory: true, signal })[Symbol.asyncIterator]();
|
|
6156
6157
|
let call, callIndex, args = "", argumentBytes = 0, argumentsDone, outputDone = false, terminal = false, done = false;
|
|
6157
6158
|
const reasoning = new Map;
|
|
@@ -6241,7 +6242,7 @@ async function relayPayload(result, param, signal) {
|
|
|
6241
6242
|
} finally {
|
|
6242
6243
|
await iterator.return?.();
|
|
6243
6244
|
}
|
|
6244
|
-
} else if (
|
|
6245
|
+
} else if (contentType.includes("json"))
|
|
6245
6246
|
response = await result.bodyHandle.json({ id: "llm-adapter.relay", mandatory: true, signal });
|
|
6246
6247
|
else
|
|
6247
6248
|
invalid(param);
|
|
@@ -7047,4 +7048,4 @@ export {
|
|
|
7047
7048
|
targetPath
|
|
7048
7049
|
};
|
|
7049
7050
|
|
|
7050
|
-
//# debugId=
|
|
7051
|
+
//# debugId=518F8C65B84A06CF64756E2164756E21
|