@ai-sdk/google-vertex 4.0.197 → 4.0.199

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,26 @@
1
1
  # @ai-sdk/google-vertex
2
2
 
3
+ ## 4.0.199
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [c11f450]
8
+ - @ai-sdk/anthropic@3.0.118
9
+
10
+ ## 4.0.198
11
+
12
+ ### Patch Changes
13
+
14
+ - 1a4dbb1: Retry unclassified empty image results, preserve retry-attempt accounting, add provider-independent result retryability classification, preserve it through the AI Gateway, and mark Google and Google Vertex content-filtered results as terminal.
15
+ - Updated dependencies [f3c1980]
16
+ - Updated dependencies [1336501]
17
+ - Updated dependencies [1a4dbb1]
18
+ - @ai-sdk/openai-compatible@2.0.75
19
+ - @ai-sdk/google@3.0.122
20
+ - @ai-sdk/provider@3.0.16
21
+ - @ai-sdk/anthropic@3.0.117
22
+ - @ai-sdk/provider-utils@4.0.51
23
+
3
24
  ## 4.0.197
4
25
 
5
26
  ### Patch Changes
@@ -32,7 +32,7 @@ var import_provider_utils3 = require("@ai-sdk/provider-utils");
32
32
  var import_provider_utils = require("@ai-sdk/provider-utils");
33
33
 
34
34
  // src/version.ts
35
- var VERSION = true ? "4.0.197" : "0.0.0-test";
35
+ var VERSION = true ? "4.0.199" : "0.0.0-test";
36
36
 
37
37
  // src/edge/google-vertex-auth-edge.ts
38
38
  var loadCredentials = async () => {
@@ -10,7 +10,7 @@ import {
10
10
  } from "@ai-sdk/provider-utils";
11
11
 
12
12
  // src/version.ts
13
- var VERSION = true ? "4.0.197" : "0.0.0-test";
13
+ var VERSION = true ? "4.0.199" : "0.0.0-test";
14
14
 
15
15
  // src/edge/google-vertex-auth-edge.ts
16
16
  var loadCredentials = async () => {
@@ -33,7 +33,7 @@ var import_internal3 = require("@ai-sdk/google/internal");
33
33
  var import_provider_utils7 = require("@ai-sdk/provider-utils");
34
34
 
35
35
  // src/version.ts
36
- var VERSION = true ? "4.0.197" : "0.0.0-test";
36
+ var VERSION = true ? "4.0.199" : "0.0.0-test";
37
37
 
38
38
  // src/google-vertex-embedding-model.ts
39
39
  var import_provider = require("@ai-sdk/provider");
@@ -363,10 +363,16 @@ var GoogleVertexImageModel = class {
363
363
  abortSignal,
364
364
  fetch: this.config.fetch
365
365
  });
366
+ const imagePredictions = (_e = (_d = response.predictions) == null ? void 0 : _d.filter(
367
+ (prediction) => "bytesBase64Encoded" in prediction
368
+ )) != null ? _e : [];
366
369
  return {
367
- images: (_e = (_d = response.predictions) == null ? void 0 : _d.map(
370
+ images: imagePredictions.map(
368
371
  ({ bytesBase64Encoded }) => bytesBase64Encoded
369
- )) != null ? _e : [],
372
+ ),
373
+ ...((_f = response.predictions) == null ? void 0 : _f.some(
374
+ (prediction) => "raiFilteredReason" in prediction
375
+ )) && { isRetryable: false },
370
376
  warnings,
371
377
  response: {
372
378
  timestamp: currentDate,
@@ -375,7 +381,7 @@ var GoogleVertexImageModel = class {
375
381
  },
376
382
  providerMetadata: {
377
383
  vertex: {
378
- images: (_g = (_f = response.predictions) == null ? void 0 : _f.map((prediction) => {
384
+ images: (_g = imagePredictions.map((prediction) => {
379
385
  const {
380
386
  // normalize revised prompt property
381
387
  prompt: revisedPrompt
@@ -475,6 +481,7 @@ var GoogleVertexImageModel = class {
475
481
  }
476
482
  return {
477
483
  images,
484
+ ...result.finishReason.unified === "content-filter" ? { isRetryable: false } : {},
478
485
  warnings,
479
486
  providerMetadata: {
480
487
  vertex: {
@@ -499,11 +506,14 @@ function isGeminiModel(modelId) {
499
506
  }
500
507
  var vertexImageResponseSchema = import_v44.z.object({
501
508
  predictions: import_v44.z.array(
502
- import_v44.z.object({
503
- bytesBase64Encoded: import_v44.z.string(),
504
- mimeType: import_v44.z.string(),
505
- prompt: import_v44.z.string().nullish()
506
- })
509
+ import_v44.z.union([
510
+ import_v44.z.object({
511
+ bytesBase64Encoded: import_v44.z.string(),
512
+ mimeType: import_v44.z.string(),
513
+ prompt: import_v44.z.string().nullish()
514
+ }),
515
+ import_v44.z.object({ raiFilteredReason: import_v44.z.string() })
516
+ ])
507
517
  ).nullish()
508
518
  });
509
519
  var googleVertexImageModelOptionsSchema = import_v44.z.object({