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