@ai-sdk/google 3.0.22 → 3.0.23

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.
@@ -96,7 +96,7 @@ declare const responseSchema: _ai_sdk_provider_utils.LazySchema<{
96
96
  } | null | undefined;
97
97
  codeExecutionResult?: {
98
98
  outcome: string;
99
- output: string;
99
+ output?: string | null | undefined;
100
100
  } | null | undefined;
101
101
  text?: string | null | undefined;
102
102
  thought?: boolean | null | undefined;
@@ -96,7 +96,7 @@ declare const responseSchema: _ai_sdk_provider_utils.LazySchema<{
96
96
  } | null | undefined;
97
97
  codeExecutionResult?: {
98
98
  outcome: string;
99
- output: string;
99
+ output?: string | null | undefined;
100
100
  } | null | undefined;
101
101
  text?: string | null | undefined;
102
102
  thought?: boolean | null | undefined;
@@ -845,7 +845,7 @@ var GoogleGenerativeAILanguageModel = class {
845
845
  };
846
846
  }
847
847
  async doGenerate(options) {
848
- var _a, _b, _c, _d, _e, _f, _g, _h, _i;
848
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
849
849
  const { args, warnings, providerOptionsName } = await this.getArgs(options);
850
850
  const mergedHeaders = (0, import_provider_utils4.combineHeaders)(
851
851
  await (0, import_provider_utils4.resolve)(this.config.headers),
@@ -890,7 +890,7 @@ var GoogleGenerativeAILanguageModel = class {
890
890
  toolName: "code_execution",
891
891
  result: {
892
892
  outcome: part.codeExecutionResult.outcome,
893
- output: part.codeExecutionResult.output
893
+ output: (_d = part.codeExecutionResult.output) != null ? _d : ""
894
894
  }
895
895
  });
896
896
  lastCodeExecutionToolCallId = void 0;
@@ -929,10 +929,10 @@ var GoogleGenerativeAILanguageModel = class {
929
929
  });
930
930
  }
931
931
  }
932
- const sources = (_d = extractSources({
932
+ const sources = (_e = extractSources({
933
933
  groundingMetadata: candidate.groundingMetadata,
934
934
  generateId: this.config.generateId
935
- })) != null ? _d : [];
935
+ })) != null ? _e : [];
936
936
  for (const source of sources) {
937
937
  content.push(source);
938
938
  }
@@ -946,16 +946,16 @@ var GoogleGenerativeAILanguageModel = class {
946
946
  (part) => part.type === "tool-call" && !part.providerExecuted
947
947
  )
948
948
  }),
949
- raw: (_e = candidate.finishReason) != null ? _e : void 0
949
+ raw: (_f = candidate.finishReason) != null ? _f : void 0
950
950
  },
951
951
  usage: convertGoogleGenerativeAIUsage(usageMetadata),
952
952
  warnings,
953
953
  providerMetadata: {
954
954
  [providerOptionsName]: {
955
- promptFeedback: (_f = response.promptFeedback) != null ? _f : null,
956
- groundingMetadata: (_g = candidate.groundingMetadata) != null ? _g : null,
957
- urlContextMetadata: (_h = candidate.urlContextMetadata) != null ? _h : null,
958
- safetyRatings: (_i = candidate.safetyRatings) != null ? _i : null,
955
+ promptFeedback: (_g = response.promptFeedback) != null ? _g : null,
956
+ groundingMetadata: (_h = candidate.groundingMetadata) != null ? _h : null,
957
+ urlContextMetadata: (_i = candidate.urlContextMetadata) != null ? _i : null,
958
+ safetyRatings: (_j = candidate.safetyRatings) != null ? _j : null,
959
959
  usageMetadata: usageMetadata != null ? usageMetadata : null
960
960
  }
961
961
  },
@@ -1004,7 +1004,7 @@ var GoogleGenerativeAILanguageModel = class {
1004
1004
  controller.enqueue({ type: "stream-start", warnings });
1005
1005
  },
1006
1006
  transform(chunk, controller) {
1007
- var _a, _b, _c, _d, _e, _f, _g;
1007
+ var _a, _b, _c, _d, _e, _f, _g, _h;
1008
1008
  if (options.includeRawChunks) {
1009
1009
  controller.enqueue({ type: "raw", rawValue: chunk.rawValue });
1010
1010
  }
@@ -1056,7 +1056,7 @@ var GoogleGenerativeAILanguageModel = class {
1056
1056
  toolName: "code_execution",
1057
1057
  result: {
1058
1058
  outcome: part.codeExecutionResult.outcome,
1059
- output: part.codeExecutionResult.output
1059
+ output: (_d = part.codeExecutionResult.output) != null ? _d : ""
1060
1060
  }
1061
1061
  });
1062
1062
  lastCodeExecutionToolCallId = void 0;
@@ -1176,10 +1176,10 @@ var GoogleGenerativeAILanguageModel = class {
1176
1176
  };
1177
1177
  providerMetadata = {
1178
1178
  [providerOptionsName]: {
1179
- promptFeedback: (_d = value.promptFeedback) != null ? _d : null,
1180
- groundingMetadata: (_e = candidate.groundingMetadata) != null ? _e : null,
1181
- urlContextMetadata: (_f = candidate.urlContextMetadata) != null ? _f : null,
1182
- safetyRatings: (_g = candidate.safetyRatings) != null ? _g : null
1179
+ promptFeedback: (_e = value.promptFeedback) != null ? _e : null,
1180
+ groundingMetadata: (_f = candidate.groundingMetadata) != null ? _f : null,
1181
+ urlContextMetadata: (_g = candidate.urlContextMetadata) != null ? _g : null,
1182
+ safetyRatings: (_h = candidate.safetyRatings) != null ? _h : null
1183
1183
  }
1184
1184
  };
1185
1185
  if (usageMetadata != null) {
@@ -1385,7 +1385,7 @@ var getContentSchema = () => import_v43.z.object({
1385
1385
  }).nullish(),
1386
1386
  codeExecutionResult: import_v43.z.object({
1387
1387
  outcome: import_v43.z.string(),
1388
- output: import_v43.z.string()
1388
+ output: import_v43.z.string().nullish()
1389
1389
  }).nullish(),
1390
1390
  text: import_v43.z.string().nullish(),
1391
1391
  thought: import_v43.z.boolean().nullish(),