@ai-sdk/google 2.0.0-canary.2 → 2.0.0-canary.20
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 +184 -0
- package/README.md +2 -2
- package/dist/index.d.mts +107 -65
- package/dist/index.d.ts +107 -65
- package/dist/index.js +363 -280
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +368 -282
- package/dist/index.mjs.map +1 -1
- package/{internal/dist → dist/internal}/index.d.mts +14 -80
- package/{internal/dist → dist/internal}/index.d.ts +14 -80
- package/{internal/dist → dist/internal}/index.js +298 -253
- package/dist/internal/index.js.map +1 -0
- package/{internal/dist → dist/internal}/index.mjs +301 -254
- package/dist/internal/index.mjs.map +1 -0
- package/internal.d.ts +1 -0
- package/package.json +20 -19
- package/internal/dist/index.js.map +0 -1
- package/internal/dist/index.mjs.map +0 -1
package/CHANGELOG.md
CHANGED
@@ -1,5 +1,189 @@
|
|
1
1
|
# @ai-sdk/google
|
2
2
|
|
3
|
+
## 2.0.0-canary.20
|
4
|
+
|
5
|
+
### Patch Changes
|
6
|
+
|
7
|
+
- Updated dependencies [faf8446]
|
8
|
+
- @ai-sdk/provider-utils@3.0.0-canary.19
|
9
|
+
|
10
|
+
## 2.0.0-canary.19
|
11
|
+
|
12
|
+
### Patch Changes
|
13
|
+
|
14
|
+
- Updated dependencies [40acf9b]
|
15
|
+
- @ai-sdk/provider-utils@3.0.0-canary.18
|
16
|
+
|
17
|
+
## 2.0.0-canary.18
|
18
|
+
|
19
|
+
### Patch Changes
|
20
|
+
|
21
|
+
- f07a6d4: fix(providers/google): accept nullish in safetyRatings
|
22
|
+
- Updated dependencies [ea7a7c9]
|
23
|
+
- @ai-sdk/provider-utils@3.0.0-canary.17
|
24
|
+
|
25
|
+
## 2.0.0-canary.17
|
26
|
+
|
27
|
+
### Patch Changes
|
28
|
+
|
29
|
+
- Updated dependencies [87b828f]
|
30
|
+
- @ai-sdk/provider-utils@3.0.0-canary.16
|
31
|
+
|
32
|
+
## 2.0.0-canary.16
|
33
|
+
|
34
|
+
### Patch Changes
|
35
|
+
|
36
|
+
- Updated dependencies [a571d6e]
|
37
|
+
- Updated dependencies [a8c8bd5]
|
38
|
+
- Updated dependencies [7979f7f]
|
39
|
+
- Updated dependencies [41fa418]
|
40
|
+
- @ai-sdk/provider-utils@3.0.0-canary.15
|
41
|
+
- @ai-sdk/provider@2.0.0-canary.14
|
42
|
+
|
43
|
+
## 2.0.0-canary.15
|
44
|
+
|
45
|
+
### Patch Changes
|
46
|
+
|
47
|
+
- Updated dependencies [957b739]
|
48
|
+
- Updated dependencies [9bd5ab5]
|
49
|
+
- @ai-sdk/provider-utils@3.0.0-canary.14
|
50
|
+
- @ai-sdk/provider@2.0.0-canary.13
|
51
|
+
|
52
|
+
## 2.0.0-canary.14
|
53
|
+
|
54
|
+
### Patch Changes
|
55
|
+
|
56
|
+
- f916255: feat (provider/google): add new gemini models
|
57
|
+
- Updated dependencies [7b3ae3f]
|
58
|
+
- Updated dependencies [0ff02bb]
|
59
|
+
- @ai-sdk/provider@2.0.0-canary.12
|
60
|
+
- @ai-sdk/provider-utils@3.0.0-canary.13
|
61
|
+
|
62
|
+
## 2.0.0-canary.13
|
63
|
+
|
64
|
+
### Patch Changes
|
65
|
+
|
66
|
+
- 7378473: chore(providers/google): switch to providerOptions
|
67
|
+
- Updated dependencies [9bf7291]
|
68
|
+
- Updated dependencies [4617fab]
|
69
|
+
- Updated dependencies [e030615]
|
70
|
+
- @ai-sdk/provider@2.0.0-canary.11
|
71
|
+
- @ai-sdk/provider-utils@3.0.0-canary.12
|
72
|
+
|
73
|
+
## 2.0.0-canary.12
|
74
|
+
|
75
|
+
### Patch Changes
|
76
|
+
|
77
|
+
- 888b750: feat(providers/google): Add taskType support for Text Embedding Models
|
78
|
+
- 66962ed: fix(packages): export node10 compatible types
|
79
|
+
- Updated dependencies [66962ed]
|
80
|
+
- Updated dependencies [9301f86]
|
81
|
+
- Updated dependencies [a3f768e]
|
82
|
+
- @ai-sdk/provider-utils@3.0.0-canary.11
|
83
|
+
- @ai-sdk/provider@2.0.0-canary.10
|
84
|
+
|
85
|
+
## 2.0.0-canary.11
|
86
|
+
|
87
|
+
### Patch Changes
|
88
|
+
|
89
|
+
- Updated dependencies [e86be6f]
|
90
|
+
- @ai-sdk/provider@2.0.0-canary.9
|
91
|
+
- @ai-sdk/provider-utils@3.0.0-canary.10
|
92
|
+
|
93
|
+
## 2.0.0-canary.10
|
94
|
+
|
95
|
+
### Patch Changes
|
96
|
+
|
97
|
+
- 3259565: feat (providers/google): add thinking config to provider options
|
98
|
+
- fd98925: chore(providers/google): update embedding model to use providerOptions
|
99
|
+
- Updated dependencies [95857aa]
|
100
|
+
- Updated dependencies [7ea4132]
|
101
|
+
- @ai-sdk/provider@2.0.0-canary.8
|
102
|
+
- @ai-sdk/provider-utils@3.0.0-canary.9
|
103
|
+
|
104
|
+
## 2.0.0-canary.9
|
105
|
+
|
106
|
+
### Patch Changes
|
107
|
+
|
108
|
+
- Updated dependencies [5d142ab]
|
109
|
+
- Updated dependencies [b6b43c7]
|
110
|
+
- Updated dependencies [8aa9e20]
|
111
|
+
- Updated dependencies [3795467]
|
112
|
+
- @ai-sdk/provider-utils@3.0.0-canary.8
|
113
|
+
- @ai-sdk/provider@2.0.0-canary.7
|
114
|
+
|
115
|
+
## 2.0.0-canary.8
|
116
|
+
|
117
|
+
### Patch Changes
|
118
|
+
|
119
|
+
- 26735b5: chore(embedding-model): add v2 interface
|
120
|
+
- 443d8ec: feat(embedding-model-v2): add response body field
|
121
|
+
- fd65bc6: chore(embedding-model-v2): rename rawResponse to response
|
122
|
+
- Updated dependencies [26735b5]
|
123
|
+
- Updated dependencies [443d8ec]
|
124
|
+
- Updated dependencies [14c9410]
|
125
|
+
- Updated dependencies [d9c98f4]
|
126
|
+
- Updated dependencies [c4a2fec]
|
127
|
+
- Updated dependencies [0054544]
|
128
|
+
- Updated dependencies [9e9c809]
|
129
|
+
- Updated dependencies [32831c6]
|
130
|
+
- Updated dependencies [d0f9495]
|
131
|
+
- Updated dependencies [fd65bc6]
|
132
|
+
- Updated dependencies [393138b]
|
133
|
+
- Updated dependencies [7182d14]
|
134
|
+
- @ai-sdk/provider@2.0.0-canary.6
|
135
|
+
- @ai-sdk/provider-utils@3.0.0-canary.7
|
136
|
+
|
137
|
+
## 2.0.0-canary.7
|
138
|
+
|
139
|
+
### Patch Changes
|
140
|
+
|
141
|
+
- f10304b: feat(tool-calling): don't require the user to have to pass parameters
|
142
|
+
- Updated dependencies [411e483]
|
143
|
+
- Updated dependencies [79457bd]
|
144
|
+
- Updated dependencies [ad80501]
|
145
|
+
- Updated dependencies [1766ede]
|
146
|
+
- Updated dependencies [f10304b]
|
147
|
+
- @ai-sdk/provider@2.0.0-canary.5
|
148
|
+
- @ai-sdk/provider-utils@3.0.0-canary.6
|
149
|
+
|
150
|
+
## 2.0.0-canary.6
|
151
|
+
|
152
|
+
### Patch Changes
|
153
|
+
|
154
|
+
- Updated dependencies [6f6bb89]
|
155
|
+
- @ai-sdk/provider@2.0.0-canary.4
|
156
|
+
- @ai-sdk/provider-utils@3.0.0-canary.5
|
157
|
+
|
158
|
+
## 2.0.0-canary.5
|
159
|
+
|
160
|
+
### Patch Changes
|
161
|
+
|
162
|
+
- Updated dependencies [d1a1aa1]
|
163
|
+
- @ai-sdk/provider@2.0.0-canary.3
|
164
|
+
- @ai-sdk/provider-utils@3.0.0-canary.4
|
165
|
+
|
166
|
+
## 2.0.0-canary.4
|
167
|
+
|
168
|
+
### Patch Changes
|
169
|
+
|
170
|
+
- Updated dependencies [a166433]
|
171
|
+
- Updated dependencies [abf9a79]
|
172
|
+
- Updated dependencies [9f95b35]
|
173
|
+
- Updated dependencies [0a87932]
|
174
|
+
- Updated dependencies [6dc848c]
|
175
|
+
- @ai-sdk/provider-utils@3.0.0-canary.3
|
176
|
+
- @ai-sdk/provider@2.0.0-canary.2
|
177
|
+
|
178
|
+
## 2.0.0-canary.3
|
179
|
+
|
180
|
+
### Patch Changes
|
181
|
+
|
182
|
+
- Updated dependencies [c57e248]
|
183
|
+
- Updated dependencies [33f4a6a]
|
184
|
+
- @ai-sdk/provider@2.0.0-canary.1
|
185
|
+
- @ai-sdk/provider-utils@3.0.0-canary.2
|
186
|
+
|
3
187
|
## 2.0.0-canary.2
|
4
188
|
|
5
189
|
### Patch Changes
|
package/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# AI SDK - Google Generative AI Provider
|
2
2
|
|
3
|
-
The **[Google Generative AI provider](https://sdk.
|
3
|
+
The **[Google Generative AI provider](https://ai-sdk.dev/providers/ai-sdk-providers/google-generative-ai)** for the [AI SDK](https://ai-sdk.dev/docs) contains language model support for the [Google Generative AI](https://ai.google/discover/generativeai/) APIs.
|
4
4
|
|
5
5
|
## Setup
|
6
6
|
|
@@ -32,4 +32,4 @@ const { text } = await generateText({
|
|
32
32
|
|
33
33
|
## Documentation
|
34
34
|
|
35
|
-
Please check out the **[Google Generative AI provider documentation](https://sdk.
|
35
|
+
Please check out the **[Google Generative AI provider documentation](https://ai-sdk.dev/providers/ai-sdk-providers/google-generative-ai)** for more information.
|
package/dist/index.d.mts
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
import { z } from 'zod';
|
2
|
-
import { ProviderV2, LanguageModelV2,
|
2
|
+
import { ProviderV2, LanguageModelV2, EmbeddingModelV2 } from '@ai-sdk/provider';
|
3
3
|
import { FetchFunction } from '@ai-sdk/provider-utils';
|
4
4
|
|
5
5
|
declare const googleErrorDataSchema: z.ZodObject<{
|
@@ -8,48 +8,45 @@ declare const googleErrorDataSchema: z.ZodObject<{
|
|
8
8
|
message: z.ZodString;
|
9
9
|
status: z.ZodString;
|
10
10
|
}, "strip", z.ZodTypeAny, {
|
11
|
-
status: string;
|
12
11
|
code: number | null;
|
13
12
|
message: string;
|
14
|
-
}, {
|
15
13
|
status: string;
|
14
|
+
}, {
|
16
15
|
code: number | null;
|
17
16
|
message: string;
|
17
|
+
status: string;
|
18
18
|
}>;
|
19
19
|
}, "strip", z.ZodTypeAny, {
|
20
20
|
error: {
|
21
|
-
status: string;
|
22
21
|
code: number | null;
|
23
22
|
message: string;
|
23
|
+
status: string;
|
24
24
|
};
|
25
25
|
}, {
|
26
26
|
error: {
|
27
|
-
status: string;
|
28
27
|
code: number | null;
|
29
28
|
message: string;
|
29
|
+
status: string;
|
30
30
|
};
|
31
31
|
}>;
|
32
32
|
type GoogleErrorData = z.infer<typeof googleErrorDataSchema>;
|
33
33
|
|
34
|
-
type GoogleGenerativeAIModelId = 'gemini-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
dynamicThreshold?: number;
|
45
|
-
}
|
46
|
-
interface GoogleGenerativeAISettings {
|
34
|
+
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-exp-03-25' | 'gemini-2.5-flash-preview-04-17' | 'gemini-exp-1206' | 'gemma-3-27b-it' | 'learnlm-1.5-pro-experimental' | (string & {});
|
35
|
+
declare const googleGenerativeAIProviderOptions: z.ZodObject<{
|
36
|
+
responseModalities: z.ZodOptional<z.ZodArray<z.ZodEnum<["TEXT", "IMAGE"]>, "many">>;
|
37
|
+
thinkingConfig: z.ZodOptional<z.ZodObject<{
|
38
|
+
thinkingBudget: z.ZodOptional<z.ZodNumber>;
|
39
|
+
}, "strip", z.ZodTypeAny, {
|
40
|
+
thinkingBudget?: number | undefined;
|
41
|
+
}, {
|
42
|
+
thinkingBudget?: number | undefined;
|
43
|
+
}>>;
|
47
44
|
/**
|
48
45
|
Optional.
|
49
46
|
The name of the cached content used as context to serve the prediction.
|
50
47
|
Format: cachedContents/{cachedContent}
|
51
48
|
*/
|
52
|
-
cachedContent
|
49
|
+
cachedContent: z.ZodOptional<z.ZodString>;
|
53
50
|
/**
|
54
51
|
* Optional. Enable structured output. Default is true.
|
55
52
|
*
|
@@ -58,35 +55,95 @@ interface GoogleGenerativeAISettings {
|
|
58
55
|
* Google Generative AI uses. You can use this to disable
|
59
56
|
* structured outputs if you need to.
|
60
57
|
*/
|
61
|
-
structuredOutputs
|
58
|
+
structuredOutputs: z.ZodOptional<z.ZodBoolean>;
|
62
59
|
/**
|
63
60
|
Optional. A list of unique safety settings for blocking unsafe content.
|
64
|
-
|
65
|
-
safetySettings
|
66
|
-
category:
|
67
|
-
threshold:
|
68
|
-
}
|
61
|
+
*/
|
62
|
+
safetySettings: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
63
|
+
category: z.ZodEnum<["HARM_CATEGORY_UNSPECIFIED", "HARM_CATEGORY_HATE_SPEECH", "HARM_CATEGORY_DANGEROUS_CONTENT", "HARM_CATEGORY_HARASSMENT", "HARM_CATEGORY_SEXUALLY_EXPLICIT", "HARM_CATEGORY_CIVIC_INTEGRITY"]>;
|
64
|
+
threshold: z.ZodEnum<["HARM_BLOCK_THRESHOLD_UNSPECIFIED", "BLOCK_LOW_AND_ABOVE", "BLOCK_MEDIUM_AND_ABOVE", "BLOCK_ONLY_HIGH", "BLOCK_NONE", "OFF"]>;
|
65
|
+
}, "strip", z.ZodTypeAny, {
|
66
|
+
category: "HARM_CATEGORY_UNSPECIFIED" | "HARM_CATEGORY_HATE_SPEECH" | "HARM_CATEGORY_DANGEROUS_CONTENT" | "HARM_CATEGORY_HARASSMENT" | "HARM_CATEGORY_SEXUALLY_EXPLICIT" | "HARM_CATEGORY_CIVIC_INTEGRITY";
|
67
|
+
threshold: "HARM_BLOCK_THRESHOLD_UNSPECIFIED" | "BLOCK_LOW_AND_ABOVE" | "BLOCK_MEDIUM_AND_ABOVE" | "BLOCK_ONLY_HIGH" | "BLOCK_NONE" | "OFF";
|
68
|
+
}, {
|
69
|
+
category: "HARM_CATEGORY_UNSPECIFIED" | "HARM_CATEGORY_HATE_SPEECH" | "HARM_CATEGORY_DANGEROUS_CONTENT" | "HARM_CATEGORY_HARASSMENT" | "HARM_CATEGORY_SEXUALLY_EXPLICIT" | "HARM_CATEGORY_CIVIC_INTEGRITY";
|
70
|
+
threshold: "HARM_BLOCK_THRESHOLD_UNSPECIFIED" | "BLOCK_LOW_AND_ABOVE" | "BLOCK_MEDIUM_AND_ABOVE" | "BLOCK_ONLY_HIGH" | "BLOCK_NONE" | "OFF";
|
71
|
+
}>, "many">>;
|
72
|
+
threshold: z.ZodOptional<z.ZodEnum<["HARM_BLOCK_THRESHOLD_UNSPECIFIED", "BLOCK_LOW_AND_ABOVE", "BLOCK_MEDIUM_AND_ABOVE", "BLOCK_ONLY_HIGH", "BLOCK_NONE", "OFF"]>>;
|
69
73
|
/**
|
70
74
|
* Optional. Enables timestamp understanding for audio-only files.
|
71
75
|
*
|
72
76
|
* https://cloud.google.com/vertex-ai/generative-ai/docs/multimodal/audio-understanding
|
73
77
|
*/
|
74
|
-
audioTimestamp
|
78
|
+
audioTimestamp: z.ZodOptional<z.ZodBoolean>;
|
75
79
|
/**
|
76
80
|
Optional. When enabled, the model will use Google search to ground the response.
|
77
81
|
|
78
82
|
@see https://cloud.google.com/vertex-ai/generative-ai/docs/grounding/overview
|
79
|
-
|
80
|
-
useSearchGrounding
|
83
|
+
*/
|
84
|
+
useSearchGrounding: z.ZodOptional<z.ZodBoolean>;
|
81
85
|
/**
|
82
86
|
Optional. Specifies the dynamic retrieval configuration.
|
83
87
|
|
84
88
|
@note Dynamic retrieval is only compatible with Gemini 1.5 Flash.
|
85
89
|
|
86
90
|
@see https://cloud.google.com/vertex-ai/generative-ai/docs/multimodal/ground-with-google-search#dynamic-retrieval
|
87
|
-
|
88
|
-
dynamicRetrievalConfig
|
89
|
-
|
91
|
+
*/
|
92
|
+
dynamicRetrievalConfig: z.ZodOptional<z.ZodObject<{
|
93
|
+
/**
|
94
|
+
* The mode of the predictor to be used in dynamic retrieval.
|
95
|
+
*/
|
96
|
+
mode: z.ZodOptional<z.ZodEnum<["MODE_UNSPECIFIED", "MODE_DYNAMIC"]>>;
|
97
|
+
/**
|
98
|
+
* The threshold to be used in dynamic retrieval. If not set, a system default
|
99
|
+
* value is used.
|
100
|
+
*/
|
101
|
+
dynamicThreshold: z.ZodOptional<z.ZodNumber>;
|
102
|
+
}, "strip", z.ZodTypeAny, {
|
103
|
+
mode?: "MODE_UNSPECIFIED" | "MODE_DYNAMIC" | undefined;
|
104
|
+
dynamicThreshold?: number | undefined;
|
105
|
+
}, {
|
106
|
+
mode?: "MODE_UNSPECIFIED" | "MODE_DYNAMIC" | undefined;
|
107
|
+
dynamicThreshold?: number | undefined;
|
108
|
+
}>>;
|
109
|
+
}, "strip", z.ZodTypeAny, {
|
110
|
+
responseModalities?: ("TEXT" | "IMAGE")[] | undefined;
|
111
|
+
thinkingConfig?: {
|
112
|
+
thinkingBudget?: number | undefined;
|
113
|
+
} | undefined;
|
114
|
+
cachedContent?: string | undefined;
|
115
|
+
structuredOutputs?: boolean | undefined;
|
116
|
+
threshold?: "HARM_BLOCK_THRESHOLD_UNSPECIFIED" | "BLOCK_LOW_AND_ABOVE" | "BLOCK_MEDIUM_AND_ABOVE" | "BLOCK_ONLY_HIGH" | "BLOCK_NONE" | "OFF" | undefined;
|
117
|
+
safetySettings?: {
|
118
|
+
category: "HARM_CATEGORY_UNSPECIFIED" | "HARM_CATEGORY_HATE_SPEECH" | "HARM_CATEGORY_DANGEROUS_CONTENT" | "HARM_CATEGORY_HARASSMENT" | "HARM_CATEGORY_SEXUALLY_EXPLICIT" | "HARM_CATEGORY_CIVIC_INTEGRITY";
|
119
|
+
threshold: "HARM_BLOCK_THRESHOLD_UNSPECIFIED" | "BLOCK_LOW_AND_ABOVE" | "BLOCK_MEDIUM_AND_ABOVE" | "BLOCK_ONLY_HIGH" | "BLOCK_NONE" | "OFF";
|
120
|
+
}[] | undefined;
|
121
|
+
audioTimestamp?: boolean | undefined;
|
122
|
+
useSearchGrounding?: boolean | undefined;
|
123
|
+
dynamicRetrievalConfig?: {
|
124
|
+
mode?: "MODE_UNSPECIFIED" | "MODE_DYNAMIC" | undefined;
|
125
|
+
dynamicThreshold?: number | undefined;
|
126
|
+
} | undefined;
|
127
|
+
}, {
|
128
|
+
responseModalities?: ("TEXT" | "IMAGE")[] | undefined;
|
129
|
+
thinkingConfig?: {
|
130
|
+
thinkingBudget?: number | undefined;
|
131
|
+
} | undefined;
|
132
|
+
cachedContent?: string | undefined;
|
133
|
+
structuredOutputs?: boolean | undefined;
|
134
|
+
threshold?: "HARM_BLOCK_THRESHOLD_UNSPECIFIED" | "BLOCK_LOW_AND_ABOVE" | "BLOCK_MEDIUM_AND_ABOVE" | "BLOCK_ONLY_HIGH" | "BLOCK_NONE" | "OFF" | undefined;
|
135
|
+
safetySettings?: {
|
136
|
+
category: "HARM_CATEGORY_UNSPECIFIED" | "HARM_CATEGORY_HATE_SPEECH" | "HARM_CATEGORY_DANGEROUS_CONTENT" | "HARM_CATEGORY_HARASSMENT" | "HARM_CATEGORY_SEXUALLY_EXPLICIT" | "HARM_CATEGORY_CIVIC_INTEGRITY";
|
137
|
+
threshold: "HARM_BLOCK_THRESHOLD_UNSPECIFIED" | "BLOCK_LOW_AND_ABOVE" | "BLOCK_MEDIUM_AND_ABOVE" | "BLOCK_ONLY_HIGH" | "BLOCK_NONE" | "OFF";
|
138
|
+
}[] | undefined;
|
139
|
+
audioTimestamp?: boolean | undefined;
|
140
|
+
useSearchGrounding?: boolean | undefined;
|
141
|
+
dynamicRetrievalConfig?: {
|
142
|
+
mode?: "MODE_UNSPECIFIED" | "MODE_DYNAMIC" | undefined;
|
143
|
+
dynamicThreshold?: number | undefined;
|
144
|
+
} | undefined;
|
145
|
+
}>;
|
146
|
+
type GoogleGenerativeAIProviderOptions = z.infer<typeof googleGenerativeAIProviderOptions>;
|
90
147
|
|
91
148
|
declare const groundingMetadataSchema: z.ZodObject<{
|
92
149
|
webSearchQueries: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString, "many">>>;
|
@@ -144,13 +201,13 @@ declare const groundingMetadataSchema: z.ZodObject<{
|
|
144
201
|
endIndex: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
145
202
|
text: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
146
203
|
}, "strip", z.ZodTypeAny, {
|
204
|
+
text?: string | null | undefined;
|
147
205
|
startIndex?: number | null | undefined;
|
148
206
|
endIndex?: number | null | undefined;
|
149
|
-
text?: string | null | undefined;
|
150
207
|
}, {
|
208
|
+
text?: string | null | undefined;
|
151
209
|
startIndex?: number | null | undefined;
|
152
210
|
endIndex?: number | null | undefined;
|
153
|
-
text?: string | null | undefined;
|
154
211
|
}>;
|
155
212
|
segment_text: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
156
213
|
groundingChunkIndices: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodNumber, "many">>>;
|
@@ -159,9 +216,9 @@ declare const groundingMetadataSchema: z.ZodObject<{
|
|
159
216
|
confidenceScore: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodNumber, "many">>>;
|
160
217
|
}, "strip", z.ZodTypeAny, {
|
161
218
|
segment: {
|
219
|
+
text?: string | null | undefined;
|
162
220
|
startIndex?: number | null | undefined;
|
163
221
|
endIndex?: number | null | undefined;
|
164
|
-
text?: string | null | undefined;
|
165
222
|
};
|
166
223
|
segment_text?: string | null | undefined;
|
167
224
|
groundingChunkIndices?: number[] | null | undefined;
|
@@ -170,9 +227,9 @@ declare const groundingMetadataSchema: z.ZodObject<{
|
|
170
227
|
confidenceScore?: number[] | null | undefined;
|
171
228
|
}, {
|
172
229
|
segment: {
|
230
|
+
text?: string | null | undefined;
|
173
231
|
startIndex?: number | null | undefined;
|
174
232
|
endIndex?: number | null | undefined;
|
175
|
-
text?: string | null | undefined;
|
176
233
|
};
|
177
234
|
segment_text?: string | null | undefined;
|
178
235
|
groundingChunkIndices?: number[] | null | undefined;
|
@@ -205,9 +262,9 @@ declare const groundingMetadataSchema: z.ZodObject<{
|
|
205
262
|
}[] | null | undefined;
|
206
263
|
groundingSupports?: {
|
207
264
|
segment: {
|
265
|
+
text?: string | null | undefined;
|
208
266
|
startIndex?: number | null | undefined;
|
209
267
|
endIndex?: number | null | undefined;
|
210
|
-
text?: string | null | undefined;
|
211
268
|
};
|
212
269
|
segment_text?: string | null | undefined;
|
213
270
|
groundingChunkIndices?: number[] | null | undefined;
|
@@ -236,9 +293,9 @@ declare const groundingMetadataSchema: z.ZodObject<{
|
|
236
293
|
}[] | null | undefined;
|
237
294
|
groundingSupports?: {
|
238
295
|
segment: {
|
296
|
+
text?: string | null | undefined;
|
239
297
|
startIndex?: number | null | undefined;
|
240
298
|
endIndex?: number | null | undefined;
|
241
|
-
text?: string | null | undefined;
|
242
299
|
};
|
243
300
|
segment_text?: string | null | undefined;
|
244
301
|
groundingChunkIndices?: number[] | null | undefined;
|
@@ -251,35 +308,27 @@ declare const groundingMetadataSchema: z.ZodObject<{
|
|
251
308
|
} | {} | null | undefined;
|
252
309
|
}>;
|
253
310
|
declare const safetyRatingSchema: z.ZodObject<{
|
254
|
-
category: z.ZodString
|
255
|
-
probability: z.ZodString
|
311
|
+
category: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
312
|
+
probability: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
256
313
|
probabilityScore: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
257
314
|
severity: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
258
315
|
severityScore: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
259
316
|
blocked: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
260
317
|
}, "strip", z.ZodTypeAny, {
|
261
|
-
category
|
262
|
-
probability
|
318
|
+
category?: string | null | undefined;
|
319
|
+
probability?: string | null | undefined;
|
263
320
|
probabilityScore?: number | null | undefined;
|
264
321
|
severity?: string | null | undefined;
|
265
322
|
severityScore?: number | null | undefined;
|
266
323
|
blocked?: boolean | null | undefined;
|
267
324
|
}, {
|
268
|
-
category
|
269
|
-
probability
|
325
|
+
category?: string | null | undefined;
|
326
|
+
probability?: string | null | undefined;
|
270
327
|
probabilityScore?: number | null | undefined;
|
271
328
|
severity?: string | null | undefined;
|
272
329
|
severityScore?: number | null | undefined;
|
273
330
|
blocked?: boolean | null | undefined;
|
274
331
|
}>;
|
275
|
-
declare const googleGenerativeAIProviderOptionsSchema: z.ZodObject<{
|
276
|
-
responseModalities: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodEnum<["TEXT", "IMAGE"]>, "many">>>;
|
277
|
-
}, "strip", z.ZodTypeAny, {
|
278
|
-
responseModalities?: ("TEXT" | "IMAGE")[] | null | undefined;
|
279
|
-
}, {
|
280
|
-
responseModalities?: ("TEXT" | "IMAGE")[] | null | undefined;
|
281
|
-
}>;
|
282
|
-
type GoogleGenerativeAIProviderOptions = z.infer<typeof googleGenerativeAIProviderOptionsSchema>;
|
283
332
|
|
284
333
|
type GoogleGenerativeAIGroundingMetadata = z.infer<typeof groundingMetadataSchema>;
|
285
334
|
type GoogleGenerativeAISafetyRating = z.infer<typeof safetyRatingSchema>;
|
@@ -289,31 +338,24 @@ interface GoogleGenerativeAIProviderMetadata {
|
|
289
338
|
}
|
290
339
|
|
291
340
|
type GoogleGenerativeAIEmbeddingModelId = 'text-embedding-004' | (string & {});
|
292
|
-
interface GoogleGenerativeAIEmbeddingSettings {
|
293
|
-
/**
|
294
|
-
* Optional. Optional reduced dimension for the output embedding.
|
295
|
-
* If set, excessive values in the output embedding are truncated from the end.
|
296
|
-
*/
|
297
|
-
outputDimensionality?: number;
|
298
|
-
}
|
299
341
|
|
300
342
|
interface GoogleGenerativeAIProvider extends ProviderV2 {
|
301
|
-
(modelId: GoogleGenerativeAIModelId
|
302
|
-
languageModel(modelId: GoogleGenerativeAIModelId
|
303
|
-
chat(modelId: GoogleGenerativeAIModelId
|
343
|
+
(modelId: GoogleGenerativeAIModelId): LanguageModelV2;
|
344
|
+
languageModel(modelId: GoogleGenerativeAIModelId): LanguageModelV2;
|
345
|
+
chat(modelId: GoogleGenerativeAIModelId): LanguageModelV2;
|
304
346
|
/**
|
305
347
|
* @deprecated Use `chat()` instead.
|
306
348
|
*/
|
307
|
-
generativeAI(modelId: GoogleGenerativeAIModelId
|
349
|
+
generativeAI(modelId: GoogleGenerativeAIModelId): LanguageModelV2;
|
308
350
|
/**
|
309
351
|
@deprecated Use `textEmbeddingModel()` instead.
|
310
352
|
*/
|
311
|
-
embedding(modelId: GoogleGenerativeAIEmbeddingModelId
|
353
|
+
embedding(modelId: GoogleGenerativeAIEmbeddingModelId): EmbeddingModelV2<string>;
|
312
354
|
/**
|
313
355
|
@deprecated Use `textEmbeddingModel()` instead.
|
314
356
|
*/
|
315
|
-
textEmbedding(modelId: GoogleGenerativeAIEmbeddingModelId
|
316
|
-
textEmbeddingModel(modelId: GoogleGenerativeAIEmbeddingModelId
|
357
|
+
textEmbedding(modelId: GoogleGenerativeAIEmbeddingModelId): EmbeddingModelV2<string>;
|
358
|
+
textEmbeddingModel(modelId: GoogleGenerativeAIEmbeddingModelId): EmbeddingModelV2<string>;
|
317
359
|
}
|
318
360
|
interface GoogleGenerativeAIProviderSettings {
|
319
361
|
/**
|