ai 4.1.59 → 4.1.61

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.mjs CHANGED
@@ -1332,6 +1332,7 @@ function convertPartToLanguageModelPart(part, downloadedAssets) {
1332
1332
  return {
1333
1333
  type: "file",
1334
1334
  data: normalizedData instanceof Uint8Array ? convertDataContentToBase64String(normalizedData) : normalizedData,
1335
+ filename: part.filename,
1335
1336
  mimeType,
1336
1337
  providerMetadata: (_d = part.providerOptions) != null ? _d : part.experimental_providerMetadata
1337
1338
  };
@@ -1850,6 +1851,7 @@ var imagePartSchema = z5.object({
1850
1851
  var filePartSchema = z5.object({
1851
1852
  type: z5.literal("file"),
1852
1853
  data: z5.union([dataContentSchema, z5.instanceof(URL)]),
1854
+ filename: z5.string().optional(),
1853
1855
  mimeType: z5.string(),
1854
1856
  providerOptions: providerMetadataSchema.optional(),
1855
1857
  experimental_providerMetadata: providerMetadataSchema.optional()
@@ -3940,7 +3942,7 @@ async function generateText({
3940
3942
  }),
3941
3943
  tracer,
3942
3944
  fn: async (span) => {
3943
- var _a18, _b, _c, _d, _e, _f, _g, _h, _i, _j;
3945
+ var _a18, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k;
3944
3946
  const mode = {
3945
3947
  type: "regular",
3946
3948
  ...prepareToolsAndToolChoice({ tools, toolChoice, activeTools })
@@ -4146,6 +4148,7 @@ async function generateText({
4146
4148
  response: {
4147
4149
  ...currentModelResponse.response,
4148
4150
  headers: (_g = currentModelResponse.rawResponse) == null ? void 0 : _g.headers,
4151
+ body: (_h = currentModelResponse.rawResponse) == null ? void 0 : _h.body,
4149
4152
  // deep clone msgs to avoid mutating past messages in multi-step:
4150
4153
  messages: structuredClone(responseMessages)
4151
4154
  },
@@ -4192,11 +4195,11 @@ async function generateText({
4192
4195
  finishReason: currentModelResponse.finishReason,
4193
4196
  usage,
4194
4197
  warnings: currentModelResponse.warnings,
4195
- request: (_h = currentModelResponse.request) != null ? _h : {},
4198
+ request: (_i = currentModelResponse.request) != null ? _i : {},
4196
4199
  response: {
4197
4200
  ...currentModelResponse.response,
4198
- headers: (_i = currentModelResponse.rawResponse) == null ? void 0 : _i.headers,
4199
- body: (_j = currentModelResponse.rawResponse) == null ? void 0 : _j.body,
4201
+ headers: (_j = currentModelResponse.rawResponse) == null ? void 0 : _j.headers,
4202
+ body: (_k = currentModelResponse.rawResponse) == null ? void 0 : _k.body,
4200
4203
  messages: responseMessages
4201
4204
  },
4202
4205
  logprobs: currentModelResponse.logprobs,