@ai-sdk/google 2.0.59 → 2.0.60

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,13 @@
1
1
  # @ai-sdk/google
2
2
 
3
+ ## 2.0.60
4
+
5
+ ### Patch Changes
6
+
7
+ - 3f0102b: fix(provider/google): make `segment` optional in `groundingSupports` schema
8
+
9
+ Backport of #12002. When using image search grounding, the Google API returns `groundingSupports` entries without a `segment` field, causing schema validation to fail with "Invalid JSON response".
10
+
3
11
  ## 2.0.59
4
12
 
5
13
  ### Patch Changes
package/dist/index.d.mts CHANGED
@@ -111,11 +111,11 @@ declare const responseSchema: _ai_sdk_provider_utils.LazySchema<{
111
111
  } | null | undefined;
112
112
  }[] | null | undefined;
113
113
  groundingSupports?: {
114
- segment: {
114
+ segment?: {
115
115
  startIndex?: number | null | undefined;
116
116
  endIndex?: number | null | undefined;
117
117
  text?: string | null | undefined;
118
- };
118
+ } | null | undefined;
119
119
  segment_text?: string | null | undefined;
120
120
  groundingChunkIndices?: number[] | null | undefined;
121
121
  supportChunkIndices?: number[] | null | undefined;
package/dist/index.d.ts CHANGED
@@ -111,11 +111,11 @@ declare const responseSchema: _ai_sdk_provider_utils.LazySchema<{
111
111
  } | null | undefined;
112
112
  }[] | null | undefined;
113
113
  groundingSupports?: {
114
- segment: {
114
+ segment?: {
115
115
  startIndex?: number | null | undefined;
116
116
  endIndex?: number | null | undefined;
117
117
  text?: string | null | undefined;
118
- };
118
+ } | null | undefined;
119
119
  segment_text?: string | null | undefined;
120
120
  groundingChunkIndices?: number[] | null | undefined;
121
121
  supportChunkIndices?: number[] | null | undefined;
package/dist/index.js CHANGED
@@ -30,7 +30,7 @@ module.exports = __toCommonJS(src_exports);
30
30
  var import_provider_utils15 = require("@ai-sdk/provider-utils");
31
31
 
32
32
  // src/version.ts
33
- var VERSION = true ? "2.0.59" : "0.0.0-test";
33
+ var VERSION = true ? "2.0.60" : "0.0.0-test";
34
34
 
35
35
  // src/google-generative-ai-embedding-model.ts
36
36
  var import_provider = require("@ai-sdk/provider");
@@ -1471,7 +1471,7 @@ var getGroundingMetadataSchema = () => import_v45.z.object({
1471
1471
  startIndex: import_v45.z.number().nullish(),
1472
1472
  endIndex: import_v45.z.number().nullish(),
1473
1473
  text: import_v45.z.string().nullish()
1474
- }),
1474
+ }).nullish(),
1475
1475
  segment_text: import_v45.z.string().nullish(),
1476
1476
  groundingChunkIndices: import_v45.z.array(import_v45.z.number()).nullish(),
1477
1477
  supportChunkIndices: import_v45.z.array(import_v45.z.number()).nullish(),