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