@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.
@@ -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
- if (result.bodyHandle.identity.contentType.includes("text/event-stream") || result.bodyHandle.identity.contentType.includes("application/octet-stream")) {
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 (result.bodyHandle.identity.contentType.includes("json"))
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=04C6BEB6A1F100D964756E2164756E21
7051
+ //# debugId=518F8C65B84A06CF64756E2164756E21