@ai-sdk/google 2.1.0-beta.8 → 3.0.0-beta.14

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,57 @@
1
1
  # @ai-sdk/google
2
2
 
3
+ ## 3.0.0-beta.14
4
+
5
+ ### Major Changes
6
+
7
+ - dee8b05: ai SDK 6 beta
8
+
9
+ ### Patch Changes
10
+
11
+ - Updated dependencies [dee8b05]
12
+ - @ai-sdk/provider@3.0.0-beta.6
13
+ - @ai-sdk/provider-utils@4.0.0-beta.10
14
+
15
+ ## 2.1.0-beta.13
16
+
17
+ ### Patch Changes
18
+
19
+ - Updated dependencies [521c537]
20
+ - @ai-sdk/provider-utils@3.1.0-beta.9
21
+
22
+ ## 2.1.0-beta.12
23
+
24
+ ### Patch Changes
25
+
26
+ - Updated dependencies [e06565c]
27
+ - @ai-sdk/provider-utils@3.1.0-beta.8
28
+
29
+ ## 2.1.0-beta.11
30
+
31
+ ### Patch Changes
32
+
33
+ - 9a728c8: support latest gemini model id
34
+
35
+ ## 2.1.0-beta.10
36
+
37
+ ### Patch Changes
38
+
39
+ - e8109d3: feat: tool execution approval
40
+ - Updated dependencies [046aa3b]
41
+ - Updated dependencies [e8109d3]
42
+ - @ai-sdk/provider@2.1.0-beta.5
43
+ - @ai-sdk/provider-utils@3.1.0-beta.7
44
+
45
+ ## 2.1.0-beta.9
46
+
47
+ ### Patch Changes
48
+
49
+ - 0adc679: feat(provider): shared spec v3
50
+ - Updated dependencies [0adc679]
51
+ - Updated dependencies [2b0caef]
52
+ - @ai-sdk/provider-utils@3.1.0-beta.6
53
+ - @ai-sdk/provider@2.1.0-beta.4
54
+
3
55
  ## 2.1.0-beta.8
4
56
 
5
57
  ### Patch Changes
package/dist/index.d.mts CHANGED
@@ -12,7 +12,7 @@ declare const googleErrorDataSchema: z.ZodObject<{
12
12
  }, z.core.$strip>;
13
13
  type GoogleErrorData = z.infer<typeof googleErrorDataSchema>;
14
14
 
15
- type GoogleGenerativeAIModelId = 'gemini-1.5-flash' | 'gemini-1.5-flash-latest' | 'gemini-1.5-flash-001' | 'gemini-1.5-flash-002' | 'gemini-1.5-flash-8b' | 'gemini-1.5-flash-8b-latest' | 'gemini-1.5-flash-8b-001' | 'gemini-1.5-pro' | 'gemini-1.5-pro-latest' | 'gemini-1.5-pro-001' | 'gemini-1.5-pro-002' | 'gemini-2.0-flash' | 'gemini-2.0-flash-001' | 'gemini-2.0-flash-live-001' | 'gemini-2.0-flash-lite' | 'gemini-2.0-pro-exp-02-05' | 'gemini-2.0-flash-thinking-exp-01-21' | 'gemini-2.0-flash-exp' | 'gemini-2.5-pro' | 'gemini-2.5-flash' | 'gemini-2.5-flash-image-preview' | 'gemini-2.5-flash-lite' | 'gemini-2.5-flash-lite-preview-09-2025' | 'gemini-2.5-flash-preview-04-17' | 'gemini-2.5-flash-preview-09-2025' | 'gemini-2.5-pro-exp-03-25' | 'gemini-exp-1206' | 'gemma-3-12b-it' | 'gemma-3-27b-it' | (string & {});
15
+ type GoogleGenerativeAIModelId = 'gemini-1.5-flash' | 'gemini-1.5-flash-latest' | 'gemini-1.5-flash-001' | 'gemini-1.5-flash-002' | 'gemini-1.5-flash-8b' | 'gemini-1.5-flash-8b-latest' | 'gemini-1.5-flash-8b-001' | 'gemini-1.5-pro' | 'gemini-1.5-pro-latest' | 'gemini-1.5-pro-001' | 'gemini-1.5-pro-002' | 'gemini-2.0-flash' | 'gemini-2.0-flash-001' | 'gemini-2.0-flash-live-001' | 'gemini-2.0-flash-lite' | 'gemini-2.0-pro-exp-02-05' | 'gemini-2.0-flash-thinking-exp-01-21' | 'gemini-2.0-flash-exp' | 'gemini-2.5-pro' | 'gemini-2.5-flash' | 'gemini-2.5-flash-image-preview' | 'gemini-2.5-flash-lite' | 'gemini-2.5-flash-lite-preview-09-2025' | 'gemini-2.5-flash-preview-04-17' | 'gemini-2.5-flash-preview-09-2025' | 'gemini-pro-latest' | 'gemini-flash-latest' | 'gemini-flash-lite-latest' | 'gemini-2.5-pro-exp-03-25' | 'gemini-exp-1206' | 'gemma-3-12b-it' | 'gemma-3-27b-it' | (string & {});
16
16
  declare const googleGenerativeAIProviderOptions: z.ZodObject<{
17
17
  responseModalities: z.ZodOptional<z.ZodArray<z.ZodEnum<{
18
18
  TEXT: "TEXT";
package/dist/index.d.ts CHANGED
@@ -12,7 +12,7 @@ declare const googleErrorDataSchema: z.ZodObject<{
12
12
  }, z.core.$strip>;
13
13
  type GoogleErrorData = z.infer<typeof googleErrorDataSchema>;
14
14
 
15
- type GoogleGenerativeAIModelId = 'gemini-1.5-flash' | 'gemini-1.5-flash-latest' | 'gemini-1.5-flash-001' | 'gemini-1.5-flash-002' | 'gemini-1.5-flash-8b' | 'gemini-1.5-flash-8b-latest' | 'gemini-1.5-flash-8b-001' | 'gemini-1.5-pro' | 'gemini-1.5-pro-latest' | 'gemini-1.5-pro-001' | 'gemini-1.5-pro-002' | 'gemini-2.0-flash' | 'gemini-2.0-flash-001' | 'gemini-2.0-flash-live-001' | 'gemini-2.0-flash-lite' | 'gemini-2.0-pro-exp-02-05' | 'gemini-2.0-flash-thinking-exp-01-21' | 'gemini-2.0-flash-exp' | 'gemini-2.5-pro' | 'gemini-2.5-flash' | 'gemini-2.5-flash-image-preview' | 'gemini-2.5-flash-lite' | 'gemini-2.5-flash-lite-preview-09-2025' | 'gemini-2.5-flash-preview-04-17' | 'gemini-2.5-flash-preview-09-2025' | 'gemini-2.5-pro-exp-03-25' | 'gemini-exp-1206' | 'gemma-3-12b-it' | 'gemma-3-27b-it' | (string & {});
15
+ type GoogleGenerativeAIModelId = 'gemini-1.5-flash' | 'gemini-1.5-flash-latest' | 'gemini-1.5-flash-001' | 'gemini-1.5-flash-002' | 'gemini-1.5-flash-8b' | 'gemini-1.5-flash-8b-latest' | 'gemini-1.5-flash-8b-001' | 'gemini-1.5-pro' | 'gemini-1.5-pro-latest' | 'gemini-1.5-pro-001' | 'gemini-1.5-pro-002' | 'gemini-2.0-flash' | 'gemini-2.0-flash-001' | 'gemini-2.0-flash-live-001' | 'gemini-2.0-flash-lite' | 'gemini-2.0-pro-exp-02-05' | 'gemini-2.0-flash-thinking-exp-01-21' | 'gemini-2.0-flash-exp' | 'gemini-2.5-pro' | 'gemini-2.5-flash' | 'gemini-2.5-flash-image-preview' | 'gemini-2.5-flash-lite' | 'gemini-2.5-flash-lite-preview-09-2025' | 'gemini-2.5-flash-preview-04-17' | 'gemini-2.5-flash-preview-09-2025' | 'gemini-pro-latest' | 'gemini-flash-latest' | 'gemini-flash-lite-latest' | 'gemini-2.5-pro-exp-03-25' | 'gemini-exp-1206' | 'gemma-3-12b-it' | 'gemma-3-27b-it' | (string & {});
16
16
  declare const googleGenerativeAIProviderOptions: z.ZodObject<{
17
17
  responseModalities: z.ZodOptional<z.ZodArray<z.ZodEnum<{
18
18
  TEXT: "TEXT";
package/dist/index.js CHANGED
@@ -30,7 +30,7 @@ module.exports = __toCommonJS(src_exports);
30
30
  var import_provider_utils9 = require("@ai-sdk/provider-utils");
31
31
 
32
32
  // src/version.ts
33
- var VERSION = true ? "2.1.0-beta.8" : "0.0.0-test";
33
+ var VERSION = true ? "3.0.0-beta.14" : "0.0.0-test";
34
34
 
35
35
  // src/google-generative-ai-embedding-model.ts
36
36
  var import_provider = require("@ai-sdk/provider");
@@ -286,7 +286,7 @@ function isEmptyObjectSchema(jsonSchema) {
286
286
  var import_provider2 = require("@ai-sdk/provider");
287
287
  var import_provider_utils3 = require("@ai-sdk/provider-utils");
288
288
  function convertToGoogleGenerativeAIMessages(prompt, options) {
289
- var _a;
289
+ var _a, _b;
290
290
  const systemInstructionParts = [];
291
291
  const contents = [];
292
292
  let systemMessagesAllowed = true;
@@ -338,12 +338,12 @@ function convertToGoogleGenerativeAIMessages(prompt, options) {
338
338
  contents.push({
339
339
  role: "model",
340
340
  parts: content.map((part) => {
341
- var _a2, _b, _c, _d, _e, _f;
341
+ var _a2, _b2, _c, _d, _e, _f;
342
342
  switch (part.type) {
343
343
  case "text": {
344
344
  return part.text.length === 0 ? void 0 : {
345
345
  text: part.text,
346
- thoughtSignature: (_b = (_a2 = part.providerOptions) == null ? void 0 : _a2.google) == null ? void 0 : _b.thoughtSignature
346
+ thoughtSignature: (_b2 = (_a2 = part.providerOptions) == null ? void 0 : _a2.google) == null ? void 0 : _b2.thoughtSignature
347
347
  };
348
348
  }
349
349
  case "reasoning": {
@@ -428,7 +428,7 @@ function convertToGoogleGenerativeAIMessages(prompt, options) {
428
428
  name: part.toolName,
429
429
  response: {
430
430
  name: part.toolName,
431
- content: output.value
431
+ content: output.type === "execution-denied" ? (_b = output.reason) != null ? _b : "Tool execution denied." : output.value
432
432
  }
433
433
  }
434
434
  });
@@ -546,7 +546,12 @@ function prepareTools({
546
546
  var _a;
547
547
  tools = (tools == null ? void 0 : tools.length) ? tools : void 0;
548
548
  const toolWarnings = [];
549
- const isGemini2 = modelId.includes("gemini-2");
549
+ const isLatest = [
550
+ "gemini-flash-latest",
551
+ "gemini-flash-lite-latest",
552
+ "gemini-pro-latest"
553
+ ].some((id) => id === modelId);
554
+ const isGemini2 = modelId.includes("gemini-2") || isLatest;
550
555
  const supportsDynamicRetrieval = modelId.includes("gemini-1.5-flash") && !modelId.includes("-8b");
551
556
  if (tools == null) {
552
557
  return { tools: void 0, toolConfig: void 0, toolWarnings };