@ai-sdk/google 3.0.15 → 3.0.16

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
+ ## 3.0.16
4
+
5
+ ### Patch Changes
6
+
7
+ - 97b3ebb: fix (provider/google): make `segment` optional in `groundingSupports` schema
8
+
9
+ The Google Generative AI API sometimes returns grounding supports without a `segment` field. This change makes the `segment` field optional to handle these responses correctly.
10
+
3
11
  ## 3.0.15
4
12
 
5
13
  ### Patch Changes
package/dist/index.d.mts CHANGED
@@ -105,11 +105,11 @@ declare const responseSchema: _ai_sdk_provider_utils.LazySchema<{
105
105
  } | null | undefined;
106
106
  }[] | null | undefined;
107
107
  groundingSupports?: {
108
- segment: {
108
+ segment?: {
109
109
  startIndex?: number | null | undefined;
110
110
  endIndex?: number | null | undefined;
111
111
  text?: string | null | undefined;
112
- };
112
+ } | null | undefined;
113
113
  segment_text?: string | null | undefined;
114
114
  groundingChunkIndices?: number[] | null | undefined;
115
115
  supportChunkIndices?: number[] | null | undefined;
package/dist/index.d.ts CHANGED
@@ -105,11 +105,11 @@ declare const responseSchema: _ai_sdk_provider_utils.LazySchema<{
105
105
  } | null | undefined;
106
106
  }[] | null | undefined;
107
107
  groundingSupports?: {
108
- segment: {
108
+ segment?: {
109
109
  startIndex?: number | null | undefined;
110
110
  endIndex?: number | null | undefined;
111
111
  text?: string | null | undefined;
112
- };
112
+ } | null | undefined;
113
113
  segment_text?: string | null | undefined;
114
114
  groundingChunkIndices?: number[] | null | undefined;
115
115
  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 ? "3.0.15" : "0.0.0-test";
33
+ var VERSION = true ? "3.0.16" : "0.0.0-test";
34
34
 
35
35
  // src/google-generative-ai-embedding-model.ts
36
36
  var import_provider = require("@ai-sdk/provider");
@@ -1502,7 +1502,7 @@ var getGroundingMetadataSchema = () => import_v45.z.object({
1502
1502
  startIndex: import_v45.z.number().nullish(),
1503
1503
  endIndex: import_v45.z.number().nullish(),
1504
1504
  text: import_v45.z.string().nullish()
1505
- }),
1505
+ }).nullish(),
1506
1506
  segment_text: import_v45.z.string().nullish(),
1507
1507
  groundingChunkIndices: import_v45.z.array(import_v45.z.number()).nullish(),
1508
1508
  supportChunkIndices: import_v45.z.array(import_v45.z.number()).nullish(),