@ai-sdk/google 3.0.65 → 3.0.66
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 +9 -0
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +5 -2
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/index.mjs +4 -1
- package/dist/internal/index.mjs.map +1 -1
- package/package.json +4 -4
- package/src/convert-google-generative-ai-usage.ts +1 -1
- package/src/convert-json-schema-to-openapi-schema.ts +1 -1
- package/src/convert-to-google-generative-ai-messages.ts +2 -2
- package/src/google-generative-ai-embedding-model.ts +3 -3
- package/src/google-generative-ai-image-model.ts +5 -5
- package/src/google-generative-ai-language-model.ts +12 -9
- package/src/google-generative-ai-options.ts +5 -1
- package/src/google-generative-ai-prompt.ts +4 -4
- package/src/google-prepare-tools.ts +3 -3
- package/src/google-provider.ts +6 -6
- package/src/map-google-generative-ai-finish-reason.ts +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ai-sdk/google",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.66",
|
|
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.
|
|
40
|
-
"@ai-sdk/provider-utils": "4.0.
|
|
39
|
+
"@ai-sdk/provider": "3.0.10",
|
|
40
|
+
"@ai-sdk/provider-utils": "4.0.25"
|
|
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.
|
|
47
|
+
"@ai-sdk/test-server": "1.0.5",
|
|
48
48
|
"@vercel/ai-tsconfig": "0.0.0"
|
|
49
49
|
},
|
|
50
50
|
"peerDependencies": {
|
|
@@ -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 {
|
|
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,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,
|
package/src/google-provider.ts
CHANGED
|
@@ -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;
|