@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 +16 -0
- package/dist/index.js +11 -5
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
- package/src/google-files.ts +8 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ai-sdk/google",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.62",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -35,8 +35,8 @@
|
|
|
35
35
|
}
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@ai-sdk/provider": "4.0.
|
|
39
|
-
"@ai-sdk/provider-utils": "5.0.
|
|
38
|
+
"@ai-sdk/provider": "4.0.10",
|
|
39
|
+
"@ai-sdk/provider-utils": "5.0.36"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
42
|
"@ai-sdk/test-server": "2.0.1",
|
package/src/google-files.ts
CHANGED
|
@@ -63,7 +63,10 @@ export class GoogleFiles implements FilesV4 {
|
|
|
63
63
|
schema: googleFilesUploadOptionsSchema,
|
|
64
64
|
})) as GoogleFilesUploadOptions | undefined;
|
|
65
65
|
|
|
66
|
-
const resolvedHeaders =
|
|
66
|
+
const resolvedHeaders = combineHeaders(
|
|
67
|
+
this.config.headers(),
|
|
68
|
+
options.headers,
|
|
69
|
+
);
|
|
67
70
|
const fetchFn = this.config.fetch ?? globalThis.fetch;
|
|
68
71
|
|
|
69
72
|
const warnings: Array<SharedV4Warning> = [];
|
|
@@ -93,6 +96,7 @@ export class GoogleFiles implements FilesV4 {
|
|
|
93
96
|
...(displayName != null ? { display_name: displayName } : {}),
|
|
94
97
|
},
|
|
95
98
|
}),
|
|
99
|
+
signal: options.abortSignal,
|
|
96
100
|
});
|
|
97
101
|
|
|
98
102
|
if (!initResponse.ok) {
|
|
@@ -118,6 +122,7 @@ export class GoogleFiles implements FilesV4 {
|
|
|
118
122
|
'X-Goog-Upload-Command': 'upload, finalize',
|
|
119
123
|
},
|
|
120
124
|
body: ensureArrayBufferBacked(fileBytes),
|
|
125
|
+
signal: options.abortSignal,
|
|
121
126
|
});
|
|
122
127
|
|
|
123
128
|
if (!uploadResponse.ok) {
|
|
@@ -146,7 +151,7 @@ export class GoogleFiles implements FilesV4 {
|
|
|
146
151
|
});
|
|
147
152
|
}
|
|
148
153
|
|
|
149
|
-
await delay(pollIntervalMs);
|
|
154
|
+
await delay(pollIntervalMs, { abortSignal: options.abortSignal });
|
|
150
155
|
|
|
151
156
|
const fileNameMatch = /^files\/([^/]+)$/.exec(file.name);
|
|
152
157
|
const filePath =
|
|
@@ -162,6 +167,7 @@ export class GoogleFiles implements FilesV4 {
|
|
|
162
167
|
googleFileResponseSchema,
|
|
163
168
|
),
|
|
164
169
|
failedResponseHandler: googleFailedResponseHandler,
|
|
170
|
+
abortSignal: options.abortSignal,
|
|
165
171
|
fetch: this.config.fetch,
|
|
166
172
|
});
|
|
167
173
|
|