@ai-sdk/google 4.0.60 → 4.0.62

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/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # @ai-sdk/google
2
2
 
3
+ ## 4.0.62
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [6bcc0f8]
8
+ - @ai-sdk/provider-utils@5.0.36
9
+
10
+ ## 4.0.61
11
+
12
+ ### Patch Changes
13
+
14
+ - 5190b67: feat(provider): extend the FilesV4 interface with optional `getFileMetadata`, `downloadFile` (streaming), and `deleteFile` operations, plus `abortSignal`/`headers` call options and a `{ type: 'stream' }` upload data variant; upload results now expose `byteSize`, `createdAt`, and `expiresAt` (also surfaced by the core `uploadFile()` helper, which now forwards `abortSignal`/`headers`); add `postMultipartStreamToApi` (streaming multipart uploads with deterministic part ordering and failure-path stream teardown), `deleteFromApi`, and `createBinaryStreamResponseHandler` to provider-utils
15
+ - Updated dependencies [5190b67]
16
+ - @ai-sdk/provider@4.0.10
17
+ - @ai-sdk/provider-utils@5.0.35
18
+
3
19
  ## 4.0.60
4
20
 
5
21
  ### Patch Changes
package/dist/index.js CHANGED
@@ -7,7 +7,7 @@ import {
7
7
  } from "@ai-sdk/provider-utils";
8
8
 
9
9
  // src/version.ts
10
- var VERSION = true ? "4.0.60" : "0.0.0-test";
10
+ var VERSION = true ? "4.0.62" : "0.0.0-test";
11
11
 
12
12
  // src/google-embedding-model.ts
13
13
  import {
@@ -3927,7 +3927,10 @@ var GoogleFiles = class {
3927
3927
  providerOptions: options.providerOptions,
3928
3928
  schema: googleFilesUploadOptionsSchema
3929
3929
  });
3930
- const resolvedHeaders = this.config.headers();
3930
+ const resolvedHeaders = combineHeaders4(
3931
+ this.config.headers(),
3932
+ options.headers
3933
+ );
3931
3934
  const fetchFn = (_a = this.config.fetch) != null ? _a : globalThis.fetch;
3932
3935
  const warnings = [];
3933
3936
  if (options.filename != null) {
@@ -3951,7 +3954,8 @@ var GoogleFiles = class {
3951
3954
  file: {
3952
3955
  ...displayName != null ? { display_name: displayName } : {}
3953
3956
  }
3954
- })
3957
+ }),
3958
+ signal: options.abortSignal
3955
3959
  });
3956
3960
  if (!initResponse.ok) {
3957
3961
  const errorBody = await initResponse.text();
@@ -3973,7 +3977,8 @@ var GoogleFiles = class {
3973
3977
  "X-Goog-Upload-Offset": "0",
3974
3978
  "X-Goog-Upload-Command": "upload, finalize"
3975
3979
  },
3976
- body: ensureArrayBufferBacked(fileBytes)
3980
+ body: ensureArrayBufferBacked(fileBytes),
3981
+ signal: options.abortSignal
3977
3982
  });
3978
3983
  if (!uploadResponse.ok) {
3979
3984
  const errorBody = await uploadResponse.text();
@@ -3994,7 +3999,7 @@ var GoogleFiles = class {
3994
3999
  message: `File processing timed out after ${pollTimeoutMs}ms`
3995
4000
  });
3996
4001
  }
3997
- await delay(pollIntervalMs);
4002
+ await delay(pollIntervalMs, { abortSignal: options.abortSignal });
3998
4003
  const fileNameMatch = /^files\/([^/]+)$/.exec(file.name);
3999
4004
  const filePath = fileNameMatch != null ? `files/${encodePathSegment(fileNameMatch[1])}` : encodePathSegment(file.name);
4000
4005
  const { value: fileStatus } = await getFromApi2({
@@ -4005,6 +4010,7 @@ var GoogleFiles = class {
4005
4010
  googleFileResponseSchema
4006
4011
  ),
4007
4012
  failedResponseHandler: googleFailedResponseHandler,
4013
+ abortSignal: options.abortSignal,
4008
4014
  fetch: this.config.fetch
4009
4015
  });
4010
4016
  file = fileStatus;