ai 3.1.0-canary.0 → 3.1.0-canary.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.
@@ -7618,8 +7618,8 @@ var OpenAIChatLanguageModel = class {
7618
7618
  stream: readableFromAsyncIterable(response).pipeThrough(
7619
7619
  new TransformStream({
7620
7620
  transform(chunk, controller) {
7621
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l;
7622
- if (((_a = chunk.choices) == null ? void 0 : _a[0].delta) == null) {
7621
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m;
7622
+ if (((_b = (_a = chunk.choices) == null ? void 0 : _a[0]) == null ? void 0 : _b.delta) == null) {
7623
7623
  return;
7624
7624
  }
7625
7625
  const delta = chunk.choices[0].delta;
@@ -7637,24 +7637,24 @@ var OpenAIChatLanguageModel = class {
7637
7637
  continue;
7638
7638
  }
7639
7639
  const toolCall = toolCalls[index];
7640
- if (((_b = toolCallDelta.function) == null ? void 0 : _b.arguments) != null) {
7641
- toolCall.function.arguments += (_d = (_c = toolCallDelta.function) == null ? void 0 : _c.arguments) != null ? _d : "";
7640
+ if (((_c = toolCallDelta.function) == null ? void 0 : _c.arguments) != null) {
7641
+ toolCall.function.arguments += (_e = (_d = toolCallDelta.function) == null ? void 0 : _d.arguments) != null ? _e : "";
7642
7642
  }
7643
7643
  controller.enqueue({
7644
7644
  type: "tool-call-delta",
7645
- toolCallId: (_e = toolCall.id) != null ? _e : "",
7645
+ toolCallId: (_f = toolCall.id) != null ? _f : "",
7646
7646
  // TODO empty?
7647
- toolName: (_g = (_f = toolCall.function) == null ? void 0 : _f.name) != null ? _g : "",
7647
+ toolName: (_h = (_g = toolCall.function) == null ? void 0 : _g.name) != null ? _h : "",
7648
7648
  // TODO empty?
7649
- argsTextDelta: (_i = (_h = toolCallDelta.function) == null ? void 0 : _h.arguments) != null ? _i : ""
7649
+ argsTextDelta: (_j = (_i = toolCallDelta.function) == null ? void 0 : _i.arguments) != null ? _j : ""
7650
7650
  // TODO empty?
7651
7651
  });
7652
- if (((_j = toolCall.function) == null ? void 0 : _j.name) == null || ((_k = toolCall.function) == null ? void 0 : _k.arguments) == null || tryParseJSON(toolCall.function.arguments) == null) {
7652
+ if (((_k = toolCall.function) == null ? void 0 : _k.name) == null || ((_l = toolCall.function) == null ? void 0 : _l.arguments) == null || tryParseJSON(toolCall.function.arguments) == null) {
7653
7653
  continue;
7654
7654
  }
7655
7655
  controller.enqueue({
7656
7656
  type: "tool-call",
7657
- toolCallId: (_l = toolCall.id) != null ? _l : nanoid(),
7657
+ toolCallId: (_m = toolCall.id) != null ? _m : nanoid(),
7658
7658
  toolName: toolCall.function.name,
7659
7659
  args: toolCall.function.arguments
7660
7660
  });