@ai-sdk/google 3.0.65 → 3.0.67

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ai-sdk/google",
3
- "version": "3.0.65",
3
+ "version": "3.0.67",
4
4
  "license": "Apache-2.0",
5
5
  "sideEffects": false,
6
6
  "main": "./dist/index.js",
@@ -36,15 +36,15 @@
36
36
  }
37
37
  },
38
38
  "dependencies": {
39
- "@ai-sdk/provider": "3.0.9",
40
- "@ai-sdk/provider-utils": "4.0.24"
39
+ "@ai-sdk/provider-utils": "4.0.26",
40
+ "@ai-sdk/provider": "3.0.10"
41
41
  },
42
42
  "devDependencies": {
43
43
  "@types/node": "20.17.24",
44
44
  "tsup": "^8",
45
45
  "typescript": "5.8.3",
46
46
  "zod": "3.25.76",
47
- "@ai-sdk/test-server": "1.0.4",
47
+ "@ai-sdk/test-server": "1.0.5",
48
48
  "@vercel/ai-tsconfig": "0.0.0"
49
49
  },
50
50
  "peerDependencies": {
@@ -1,4 +1,4 @@
1
- import { LanguageModelV3Usage } from '@ai-sdk/provider';
1
+ import type { LanguageModelV3Usage } from '@ai-sdk/provider';
2
2
 
3
3
  export type GoogleGenerativeAITokenDetail = {
4
4
  modality: string;
@@ -1,4 +1,4 @@
1
- import { JSONSchema7Definition } from '@ai-sdk/provider';
1
+ import type { JSONSchema7Definition } from '@ai-sdk/provider';
2
2
 
3
3
  /**
4
4
  * Converts JSON Schema 7 to OpenAPI Schema 3.0
@@ -1,9 +1,9 @@
1
1
  import {
2
- LanguageModelV3Prompt,
3
2
  UnsupportedFunctionalityError,
3
+ type LanguageModelV3Prompt,
4
4
  } from '@ai-sdk/provider';
5
5
  import { convertToBase64 } from '@ai-sdk/provider-utils';
6
- import {
6
+ import type {
7
7
  GoogleGenerativeAIContent,
8
8
  GoogleGenerativeAIContentPart,
9
9
  GoogleGenerativeAIFunctionResponsePart,
@@ -1,22 +1,22 @@
1
1
  import {
2
- EmbeddingModelV3,
3
2
  TooManyEmbeddingValuesForCallError,
3
+ type EmbeddingModelV3,
4
4
  } from '@ai-sdk/provider';
5
5
  import {
6
6
  combineHeaders,
7
7
  createJsonResponseHandler,
8
- FetchFunction,
9
8
  lazySchema,
10
9
  parseProviderOptions,
11
10
  postJsonToApi,
12
11
  resolve,
13
12
  zodSchema,
13
+ type FetchFunction,
14
14
  } from '@ai-sdk/provider-utils';
15
15
  import { z } from 'zod/v4';
16
16
  import { googleFailedResponseHandler } from './google-error';
17
17
  import {
18
- GoogleGenerativeAIEmbeddingModelId,
19
18
  googleEmbeddingModelOptions,
19
+ type GoogleGenerativeAIEmbeddingModelId,
20
20
  } from './google-generative-ai-embedding-options';
21
21
 
22
22
  type GoogleGenerativeAIEmbeddingConfig = {
@@ -1,4 +1,4 @@
1
- import {
1
+ import type {
2
2
  ImageModelV3,
3
3
  LanguageModelV3Prompt,
4
4
  SharedV3Warning,
@@ -7,19 +7,19 @@ import {
7
7
  combineHeaders,
8
8
  convertToBase64,
9
9
  createJsonResponseHandler,
10
- FetchFunction,
11
10
  generateId as defaultGenerateId,
12
- type InferSchema,
13
11
  lazySchema,
14
12
  parseProviderOptions,
15
13
  postJsonToApi,
16
- Resolvable,
17
14
  resolve,
18
15
  zodSchema,
16
+ type FetchFunction,
17
+ type Resolvable,
18
+ type InferSchema,
19
19
  } from '@ai-sdk/provider-utils';
20
20
  import { z } from 'zod/v4';
21
21
  import { googleFailedResponseHandler } from './google-error';
22
- import {
22
+ import type {
23
23
  GoogleGenerativeAIImageModelId,
24
24
  GoogleGenerativeAIImageSettings,
25
25
  } from './google-generative-ai-image-settings';
@@ -1,4 +1,4 @@
1
- import {
1
+ import type {
2
2
  LanguageModelV3,
3
3
  LanguageModelV3CallOptions,
4
4
  LanguageModelV3Content,
@@ -15,37 +15,40 @@ import {
15
15
  combineHeaders,
16
16
  createEventSourceResponseHandler,
17
17
  createJsonResponseHandler,
18
- FetchFunction,
19
18
  generateId,
20
- InferSchema,
21
19
  lazySchema,
22
20
  parseProviderOptions,
23
- ParseResult,
24
21
  postJsonToApi,
25
- Resolvable,
26
22
  resolve,
27
23
  zodSchema,
24
+ type FetchFunction,
25
+ type InferSchema,
26
+ type ParseResult,
27
+ type Resolvable,
28
28
  } from '@ai-sdk/provider-utils';
29
29
  import { z } from 'zod/v4';
30
30
  import {
31
31
  convertGoogleGenerativeAIUsage,
32
- GoogleGenerativeAIUsageMetadata,
32
+ type GoogleGenerativeAIUsageMetadata,
33
33
  } from './convert-google-generative-ai-usage';
34
34
  import { convertJSONSchemaToOpenAPISchema } from './convert-json-schema-to-openapi-schema';
35
35
  import { convertToGoogleGenerativeAIMessages } from './convert-to-google-generative-ai-messages';
36
36
  import { getModelPath } from './get-model-path';
37
37
  import { googleFailedResponseHandler } from './google-error';
38
38
  import {
39
- GoogleGenerativeAIModelId,
40
39
  googleLanguageModelOptions,
41
40
  VertexServiceTierMap,
41
+ type GoogleGenerativeAIModelId,
42
42
  } from './google-generative-ai-options';
43
- import {
43
+ import type {
44
44
  GoogleGenerativeAIContentPart,
45
45
  GoogleGenerativeAIProviderMetadata,
46
46
  } from './google-generative-ai-prompt';
47
47
  import { prepareTools } from './google-prepare-tools';
48
- import { GoogleJSONAccumulator, PartialArg } from './google-json-accumulator';
48
+ import {
49
+ GoogleJSONAccumulator,
50
+ type PartialArg,
51
+ } from './google-json-accumulator';
49
52
  import { mapGoogleGenerativeAIFinishReason } from './map-google-generative-ai-finish-reason';
50
53
 
51
54
  type GoogleGenerativeAIConfig = {
@@ -1,4 +1,8 @@
1
- import { InferSchema, lazySchema, zodSchema } from '@ai-sdk/provider-utils';
1
+ import {
2
+ lazySchema,
3
+ zodSchema,
4
+ type InferSchema,
5
+ } from '@ai-sdk/provider-utils';
2
6
  import { z } from 'zod/v4';
3
7
 
4
8
  export type GoogleGenerativeAIModelId =
@@ -1,9 +1,9 @@
1
1
  import {
2
- GroundingMetadataSchema,
3
- PromptFeedbackSchema,
4
- UrlContextMetadataSchema,
2
+ type GroundingMetadataSchema,
3
+ type PromptFeedbackSchema,
4
+ type UrlContextMetadataSchema,
5
+ type UsageMetadataSchema,
5
6
  type SafetyRatingSchema,
6
- UsageMetadataSchema,
7
7
  } from './google-generative-ai-language-model';
8
8
 
9
9
  export type GoogleGenerativeAIPrompt = {
@@ -1,10 +1,10 @@
1
1
  import {
2
- LanguageModelV3CallOptions,
3
- SharedV3Warning,
4
2
  UnsupportedFunctionalityError,
3
+ type LanguageModelV3CallOptions,
4
+ type SharedV3Warning,
5
5
  } from '@ai-sdk/provider';
6
6
  import { convertJSONSchemaToOpenAPISchema } from './convert-json-schema-to-openapi-schema';
7
- import { GoogleGenerativeAIModelId } from './google-generative-ai-options';
7
+ import type { GoogleGenerativeAIModelId } from './google-generative-ai-options';
8
8
 
9
9
  export function prepareTools({
10
10
  tools,
@@ -1,4 +1,4 @@
1
- import {
1
+ import type {
2
2
  EmbeddingModelV3,
3
3
  Experimental_VideoModelV3,
4
4
  ImageModelV3,
@@ -6,26 +6,26 @@ import {
6
6
  ProviderV3,
7
7
  } from '@ai-sdk/provider';
8
8
  import {
9
- FetchFunction,
10
9
  generateId,
11
10
  loadApiKey,
12
11
  withoutTrailingSlash,
13
12
  withUserAgentSuffix,
13
+ type FetchFunction,
14
14
  } from '@ai-sdk/provider-utils';
15
15
  import { VERSION } from './version';
16
16
  import { GoogleGenerativeAIEmbeddingModel } from './google-generative-ai-embedding-model';
17
- import { GoogleGenerativeAIEmbeddingModelId } from './google-generative-ai-embedding-options';
17
+ import type { GoogleGenerativeAIEmbeddingModelId } from './google-generative-ai-embedding-options';
18
18
  import { GoogleGenerativeAILanguageModel } from './google-generative-ai-language-model';
19
- import { GoogleGenerativeAIModelId } from './google-generative-ai-options';
19
+ import type { GoogleGenerativeAIModelId } from './google-generative-ai-options';
20
20
  import { googleTools } from './google-tools';
21
21
 
22
- import {
22
+ import type {
23
23
  GoogleGenerativeAIImageSettings,
24
24
  GoogleGenerativeAIImageModelId,
25
25
  } from './google-generative-ai-image-settings';
26
26
  import { GoogleGenerativeAIImageModel } from './google-generative-ai-image-model';
27
27
  import { GoogleGenerativeAIVideoModel } from './google-generative-ai-video-model';
28
- import { GoogleGenerativeAIVideoModelId } from './google-generative-ai-video-settings';
28
+ import type { GoogleGenerativeAIVideoModelId } from './google-generative-ai-video-settings';
29
29
 
30
30
  export interface GoogleGenerativeAIProvider extends ProviderV3 {
31
31
  (modelId: GoogleGenerativeAIModelId): LanguageModelV3;
@@ -1,4 +1,4 @@
1
- import { LanguageModelV3FinishReason } from '@ai-sdk/provider';
1
+ import type { LanguageModelV3FinishReason } from '@ai-sdk/provider';
2
2
 
3
3
  export function mapGoogleGenerativeAIFinishReason({
4
4
  finishReason,