@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/index.js CHANGED
@@ -13495,6 +13495,16 @@ var OpenAIClient = class {
13495
13495
  } catch {
13496
13496
  continue;
13497
13497
  }
13498
+ if (chunk.error !== void 0 && chunk.error !== null) {
13499
+ const status = typeof chunk.error.code === "number" ? chunk.error.code : 502;
13500
+ throw mapOpenAICompatibleError({
13501
+ providerId,
13502
+ status,
13503
+ body: chunk,
13504
+ headers: response.headers,
13505
+ endpoint: "/v1/chat/completions"
13506
+ });
13507
+ }
13498
13508
  const events = accumulator.consume(chunk);
13499
13509
  for (const event of events) yield event;
13500
13510
  }