@theokit/sdk 2.11.2 → 2.11.3

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/eval.js CHANGED
@@ -11018,6 +11018,16 @@ var OpenAIClient = class {
11018
11018
  } catch {
11019
11019
  continue;
11020
11020
  }
11021
+ if (chunk.error !== void 0 && chunk.error !== null) {
11022
+ const status = typeof chunk.error.code === "number" ? chunk.error.code : 502;
11023
+ throw mapOpenAICompatibleError({
11024
+ providerId,
11025
+ status,
11026
+ body: chunk,
11027
+ headers: response.headers,
11028
+ endpoint: "/v1/chat/completions"
11029
+ });
11030
+ }
11021
11031
  const events = accumulator.consume(chunk);
11022
11032
  for (const event of events) yield event;
11023
11033
  }