@ai-sdk/google 4.0.84 → 4.0.86
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 +17 -0
- package/dist/index.d.ts +766 -744
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +7840 -9512
- package/dist/index.js.map +1 -1
- package/dist/internal/index.d.ts +559 -551
- package/dist/internal/index.d.ts.map +1 -0
- package/dist/internal/index.js +5313 -6233
- package/dist/internal/index.js.map +1 -1
- package/docs/15-google.mdx +19 -14
- package/package.json +8 -8
- package/src/google-provider.ts +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,221 +1,221 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import { z } from
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
details?: unknown[] | null | undefined;
|
|
13
|
-
};
|
|
1
|
+
import { FetchFunction, InferSchema, Resolvable, WORKFLOW_DESERIALIZE, WORKFLOW_SERIALIZE, WebSocketConstructor, createToolNameMapping } from "@ai-sdk/provider-utils";
|
|
2
|
+
import { EmbeddingModelV4, Experimental_BatchV4, Experimental_EvaluationModelV4, Experimental_RealtimeFactoryV4, Experimental_RealtimeModelV4, Experimental_RealtimeModelV4ClientEvent, Experimental_RealtimeModelV4ClientSecretOptions, Experimental_RealtimeModelV4ClientSecretResult, Experimental_RealtimeModelV4ServerEvent, Experimental_RealtimeModelV4SessionConfig, Experimental_SpeechTranslationModelV4, Experimental_SpeechTranslationModelV4StreamOptions, Experimental_TranscriptionModelV4StreamOptions, Experimental_VideoModelV4, FilesV4, ImageModelV4, JSONObject, LanguageModelV4, ProviderV4, SpeechModelV4, TranscriptionModelV4 } from "@ai-sdk/provider";
|
|
3
|
+
import { z } from "zod/v4";
|
|
4
|
+
//#region src/google-error.d.ts
|
|
5
|
+
declare const googleErrorDataSchema: import("@ai-sdk/provider-utils").LazySchema<{
|
|
6
|
+
error: {
|
|
7
|
+
code: number | null;
|
|
8
|
+
message: string;
|
|
9
|
+
status: string;
|
|
10
|
+
details?: unknown[] | null | undefined;
|
|
11
|
+
};
|
|
14
12
|
}>;
|
|
15
13
|
type GoogleErrorData = InferSchema<typeof googleErrorDataSchema>;
|
|
16
|
-
|
|
14
|
+
//#endregion
|
|
15
|
+
//#region src/google-language-model-options.d.ts
|
|
17
16
|
type GoogleModelId = 'gemini-2.0-flash' | 'gemini-2.0-flash-001' | 'gemini-2.0-flash-lite' | 'gemini-2.0-flash-lite-001' | 'gemini-2.5-pro' | 'gemini-2.5-flash' | 'gemini-2.5-flash-image' | 'gemini-2.5-flash-lite' | 'gemini-2.5-flash-preview-tts' | 'gemini-2.5-pro-preview-tts' | 'gemini-2.5-flash-native-audio-latest' | 'gemini-2.5-flash-native-audio-preview-09-2025' | 'gemini-2.5-flash-native-audio-preview-12-2025' | 'gemini-2.5-computer-use-preview-10-2025' | 'gemini-3-pro-preview' | 'gemini-3-pro-image-preview' | 'gemini-3-flash-preview' | 'gemini-3.1-pro-preview' | 'gemini-3.1-pro-preview-customtools' | 'gemini-3.1-flash-image-preview' | 'gemini-3.1-flash-lite-preview' | 'gemini-3.1-flash-tts-preview' | 'gemini-3.5-flash' | 'gemini-3.5-flash-lite' | 'gemini-3.6-flash' | 'gemini-3.7-flash' | 'gemini-3.8-flash' | 'gemini-pro-latest' | 'gemini-flash-latest' | 'gemini-flash-lite-latest' | 'deep-research-pro-preview-12-2025' | 'deep-research-max-preview-04-2026' | 'deep-research-preview-04-2026' | 'nano-banana-pro-preview' | 'aqa' | 'gemini-robotics-er-1.5-preview' | 'gemma-3-1b-it' | 'gemma-3-4b-it' | 'gemma-3n-e4b-it' | 'gemma-3n-e2b-it' | 'gemma-3-12b-it' | 'gemma-3-27b-it' | (string & {});
|
|
18
|
-
declare const googleLanguageModelOptions:
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
} | undefined;
|
|
17
|
+
declare const googleLanguageModelOptions: import("@ai-sdk/provider-utils").LazySchema<{
|
|
18
|
+
responseModalities?: ("TEXT" | "IMAGE")[] | undefined;
|
|
19
|
+
thinkingConfig?: {
|
|
20
|
+
thinkingBudget?: number | undefined;
|
|
21
|
+
includeThoughts?: boolean | undefined;
|
|
22
|
+
thinkingLevel?: "minimal" | "low" | "medium" | "high" | undefined;
|
|
23
|
+
} | undefined;
|
|
24
|
+
cachedContent?: string | undefined;
|
|
25
|
+
structuredOutputs?: boolean | undefined;
|
|
26
|
+
safetySettings?: {
|
|
27
|
+
category: "HARM_CATEGORY_UNSPECIFIED" | "HARM_CATEGORY_HATE_SPEECH" | "HARM_CATEGORY_DANGEROUS_CONTENT" | "HARM_CATEGORY_HARASSMENT" | "HARM_CATEGORY_SEXUALLY_EXPLICIT" | "HARM_CATEGORY_CIVIC_INTEGRITY";
|
|
28
|
+
threshold: "HARM_BLOCK_THRESHOLD_UNSPECIFIED" | "BLOCK_LOW_AND_ABOVE" | "BLOCK_MEDIUM_AND_ABOVE" | "BLOCK_ONLY_HIGH" | "BLOCK_NONE" | "OFF";
|
|
29
|
+
}[] | undefined;
|
|
30
|
+
threshold?: "HARM_BLOCK_THRESHOLD_UNSPECIFIED" | "BLOCK_LOW_AND_ABOVE" | "BLOCK_MEDIUM_AND_ABOVE" | "BLOCK_ONLY_HIGH" | "BLOCK_NONE" | "OFF" | undefined;
|
|
31
|
+
audioTimestamp?: boolean | undefined;
|
|
32
|
+
labels?: Record<string, string> | undefined;
|
|
33
|
+
mediaResolution?: "MEDIA_RESOLUTION_UNSPECIFIED" | "MEDIA_RESOLUTION_LOW" | "MEDIA_RESOLUTION_MEDIUM" | "MEDIA_RESOLUTION_HIGH" | undefined;
|
|
34
|
+
imageConfig?: {
|
|
35
|
+
aspectRatio?: "1:1" | "2:3" | "3:2" | "3:4" | "4:3" | "4:5" | "5:4" | "9:16" | "16:9" | "21:9" | "1:8" | "8:1" | "1:4" | "4:1" | undefined;
|
|
36
|
+
imageSize?: "1K" | "2K" | "4K" | "512" | undefined;
|
|
37
|
+
personGeneration?: "PERSON_GENERATION_UNSPECIFIED" | "ALLOW_ALL" | "ALLOW_ADULT" | "ALLOW_NONE" | undefined;
|
|
38
|
+
prominentPeople?: "PROMINENT_PEOPLE_UNSPECIFIED" | "ALLOW_PROMINENT_PEOPLE" | "BLOCK_PROMINENT_PEOPLE" | undefined;
|
|
39
|
+
imageOutputOptions?: {
|
|
40
|
+
mimeType?: "image/jpeg" | "image/png" | undefined;
|
|
41
|
+
compressionQuality?: number | undefined;
|
|
44
42
|
} | undefined;
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
43
|
+
} | undefined;
|
|
44
|
+
retrievalConfig?: {
|
|
45
|
+
latLng?: {
|
|
46
|
+
latitude: number;
|
|
47
|
+
longitude: number;
|
|
50
48
|
} | undefined;
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
49
|
+
} | undefined;
|
|
50
|
+
streamFunctionCallArguments?: boolean | undefined;
|
|
51
|
+
serviceTier?: "standard" | "flex" | "priority" | undefined;
|
|
52
|
+
sharedRequestType?: "standard" | "flex" | "priority" | undefined;
|
|
53
|
+
requestType?: "shared" | undefined;
|
|
55
54
|
}>;
|
|
56
55
|
type GoogleLanguageModelOptions = InferSchema<typeof googleLanguageModelOptions>;
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
codeExecutionResult?: {
|
|
105
|
-
outcome: string;
|
|
106
|
-
output?: string | null | undefined;
|
|
107
|
-
} | null | undefined;
|
|
108
|
-
text?: string | null | undefined;
|
|
109
|
-
thought?: boolean | null | undefined;
|
|
110
|
-
thoughtSignature?: string | null | undefined;
|
|
111
|
-
})[] | null | undefined;
|
|
112
|
-
} | null | undefined;
|
|
113
|
-
finishReason?: string | null | undefined;
|
|
114
|
-
finishMessage?: string | null | undefined;
|
|
115
|
-
safetyRatings?: {
|
|
116
|
-
category?: string | null | undefined;
|
|
117
|
-
probability?: string | null | undefined;
|
|
118
|
-
probabilityScore?: number | null | undefined;
|
|
119
|
-
severity?: string | null | undefined;
|
|
120
|
-
severityScore?: number | null | undefined;
|
|
121
|
-
blocked?: boolean | null | undefined;
|
|
122
|
-
}[] | null | undefined;
|
|
123
|
-
groundingMetadata?: {
|
|
124
|
-
webSearchQueries?: string[] | null | undefined;
|
|
125
|
-
imageSearchQueries?: string[] | null | undefined;
|
|
126
|
-
retrievalQueries?: string[] | null | undefined;
|
|
127
|
-
searchEntryPoint?: {
|
|
128
|
-
renderedContent: string;
|
|
129
|
-
} | null | undefined;
|
|
130
|
-
groundingChunks?: {
|
|
131
|
-
web?: {
|
|
132
|
-
uri: string;
|
|
133
|
-
title?: string | null | undefined;
|
|
134
|
-
} | null | undefined;
|
|
135
|
-
image?: {
|
|
136
|
-
sourceUri: string;
|
|
137
|
-
imageUri: string;
|
|
138
|
-
title?: string | null | undefined;
|
|
139
|
-
domain?: string | null | undefined;
|
|
140
|
-
} | null | undefined;
|
|
141
|
-
retrievedContext?: {
|
|
142
|
-
uri?: string | null | undefined;
|
|
143
|
-
title?: string | null | undefined;
|
|
144
|
-
text?: string | null | undefined;
|
|
145
|
-
fileSearchStore?: string | null | undefined;
|
|
146
|
-
} | null | undefined;
|
|
147
|
-
maps?: {
|
|
148
|
-
uri?: string | null | undefined;
|
|
149
|
-
title?: string | null | undefined;
|
|
150
|
-
text?: string | null | undefined;
|
|
151
|
-
placeId?: string | null | undefined;
|
|
152
|
-
} | null | undefined;
|
|
153
|
-
}[] | null | undefined;
|
|
154
|
-
groundingSupports?: {
|
|
155
|
-
segment?: {
|
|
156
|
-
startIndex?: number | null | undefined;
|
|
157
|
-
endIndex?: number | null | undefined;
|
|
158
|
-
text?: string | null | undefined;
|
|
159
|
-
} | null | undefined;
|
|
160
|
-
segment_text?: string | null | undefined;
|
|
161
|
-
groundingChunkIndices?: number[] | null | undefined;
|
|
162
|
-
supportChunkIndices?: number[] | null | undefined;
|
|
163
|
-
confidenceScores?: number[] | null | undefined;
|
|
164
|
-
confidenceScore?: number[] | null | undefined;
|
|
165
|
-
}[] | null | undefined;
|
|
166
|
-
retrievalMetadata?: Record<string, never> | {
|
|
167
|
-
webDynamicRetrievalScore: number;
|
|
168
|
-
} | null | undefined;
|
|
56
|
+
//#endregion
|
|
57
|
+
//#region src/google-language-model.d.ts
|
|
58
|
+
declare const responseSchema: import("@ai-sdk/provider-utils").LazySchema<{
|
|
59
|
+
responseId?: string | null | undefined;
|
|
60
|
+
candidates?: {
|
|
61
|
+
content?: Record<string, never> | {
|
|
62
|
+
parts?: ({
|
|
63
|
+
functionCall: {
|
|
64
|
+
id?: string | null | undefined;
|
|
65
|
+
name?: string | null | undefined;
|
|
66
|
+
args?: unknown;
|
|
67
|
+
partialArgs?: {
|
|
68
|
+
jsonPath: string;
|
|
69
|
+
stringValue?: string | null | undefined;
|
|
70
|
+
numberValue?: number | null | undefined;
|
|
71
|
+
boolValue?: boolean | null | undefined;
|
|
72
|
+
nullValue?: unknown;
|
|
73
|
+
willContinue?: boolean | null | undefined;
|
|
74
|
+
}[] | null | undefined;
|
|
75
|
+
willContinue?: boolean | null | undefined;
|
|
76
|
+
};
|
|
77
|
+
thoughtSignature?: string | null | undefined;
|
|
78
|
+
} | {
|
|
79
|
+
inlineData: {
|
|
80
|
+
mimeType: string;
|
|
81
|
+
data: string;
|
|
82
|
+
};
|
|
83
|
+
thought?: boolean | null | undefined;
|
|
84
|
+
thoughtSignature?: string | null | undefined;
|
|
85
|
+
} | {
|
|
86
|
+
toolCall: {
|
|
87
|
+
toolType: string;
|
|
88
|
+
id: string;
|
|
89
|
+
args?: unknown;
|
|
90
|
+
};
|
|
91
|
+
thoughtSignature?: string | null | undefined;
|
|
92
|
+
} | {
|
|
93
|
+
toolResponse: {
|
|
94
|
+
toolType: string;
|
|
95
|
+
id: string;
|
|
96
|
+
response?: unknown;
|
|
97
|
+
};
|
|
98
|
+
thoughtSignature?: string | null | undefined;
|
|
99
|
+
} | {
|
|
100
|
+
executableCode?: {
|
|
101
|
+
language: string;
|
|
102
|
+
code: string;
|
|
169
103
|
} | null | undefined;
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
urlRetrievalStatus: string;
|
|
174
|
-
}[] | null | undefined;
|
|
104
|
+
codeExecutionResult?: {
|
|
105
|
+
outcome: string;
|
|
106
|
+
output?: string | null | undefined;
|
|
175
107
|
} | null | undefined;
|
|
108
|
+
text?: string | null | undefined;
|
|
109
|
+
thought?: boolean | null | undefined;
|
|
110
|
+
thoughtSignature?: string | null | undefined;
|
|
111
|
+
})[] | null | undefined;
|
|
112
|
+
} | null | undefined;
|
|
113
|
+
finishReason?: string | null | undefined;
|
|
114
|
+
finishMessage?: string | null | undefined;
|
|
115
|
+
safetyRatings?: {
|
|
116
|
+
category?: string | null | undefined;
|
|
117
|
+
probability?: string | null | undefined;
|
|
118
|
+
probabilityScore?: number | null | undefined;
|
|
119
|
+
severity?: string | null | undefined;
|
|
120
|
+
severityScore?: number | null | undefined;
|
|
121
|
+
blocked?: boolean | null | undefined;
|
|
176
122
|
}[] | null | undefined;
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
}
|
|
123
|
+
groundingMetadata?: {
|
|
124
|
+
webSearchQueries?: string[] | null | undefined;
|
|
125
|
+
imageSearchQueries?: string[] | null | undefined;
|
|
126
|
+
retrievalQueries?: string[] | null | undefined;
|
|
127
|
+
searchEntryPoint?: {
|
|
128
|
+
renderedContent: string;
|
|
129
|
+
} | null | undefined;
|
|
130
|
+
groundingChunks?: {
|
|
131
|
+
web?: {
|
|
132
|
+
uri: string;
|
|
133
|
+
title?: string | null | undefined;
|
|
134
|
+
} | null | undefined;
|
|
135
|
+
image?: {
|
|
136
|
+
sourceUri: string;
|
|
137
|
+
imageUri: string;
|
|
138
|
+
title?: string | null | undefined;
|
|
139
|
+
domain?: string | null | undefined;
|
|
140
|
+
} | null | undefined;
|
|
141
|
+
retrievedContext?: {
|
|
142
|
+
uri?: string | null | undefined;
|
|
143
|
+
title?: string | null | undefined;
|
|
144
|
+
text?: string | null | undefined;
|
|
145
|
+
fileSearchStore?: string | null | undefined;
|
|
146
|
+
} | null | undefined;
|
|
147
|
+
maps?: {
|
|
148
|
+
uri?: string | null | undefined;
|
|
149
|
+
title?: string | null | undefined;
|
|
150
|
+
text?: string | null | undefined;
|
|
151
|
+
placeId?: string | null | undefined;
|
|
152
|
+
} | null | undefined;
|
|
153
|
+
}[] | null | undefined;
|
|
154
|
+
groundingSupports?: {
|
|
155
|
+
segment?: {
|
|
156
|
+
startIndex?: number | null | undefined;
|
|
157
|
+
endIndex?: number | null | undefined;
|
|
158
|
+
text?: string | null | undefined;
|
|
159
|
+
} | null | undefined;
|
|
160
|
+
segment_text?: string | null | undefined;
|
|
161
|
+
groundingChunkIndices?: number[] | null | undefined;
|
|
162
|
+
supportChunkIndices?: number[] | null | undefined;
|
|
163
|
+
confidenceScores?: number[] | null | undefined;
|
|
164
|
+
confidenceScore?: number[] | null | undefined;
|
|
165
|
+
}[] | null | undefined;
|
|
166
|
+
retrievalMetadata?: Record<string, never> | {
|
|
167
|
+
webDynamicRetrievalScore: number;
|
|
168
|
+
} | null | undefined;
|
|
207
169
|
} | null | undefined;
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
probabilityScore?: number | null | undefined;
|
|
214
|
-
severity?: string | null | undefined;
|
|
215
|
-
severityScore?: number | null | undefined;
|
|
216
|
-
blocked?: boolean | null | undefined;
|
|
217
|
-
}[] | null | undefined;
|
|
170
|
+
urlContextMetadata?: {
|
|
171
|
+
urlMetadata?: {
|
|
172
|
+
retrievedUrl: string;
|
|
173
|
+
urlRetrievalStatus: string;
|
|
174
|
+
}[] | null | undefined;
|
|
218
175
|
} | null | undefined;
|
|
176
|
+
}[] | null | undefined;
|
|
177
|
+
usageMetadata?: {
|
|
178
|
+
[x: string]: unknown;
|
|
179
|
+
cachedContentTokenCount?: number | null | undefined;
|
|
180
|
+
thoughtsTokenCount?: number | null | undefined;
|
|
181
|
+
promptTokenCount?: number | null | undefined;
|
|
182
|
+
candidatesTokenCount?: number | null | undefined;
|
|
183
|
+
toolUsePromptTokenCount?: number | null | undefined;
|
|
184
|
+
totalTokenCount?: number | null | undefined;
|
|
185
|
+
trafficType?: string | null | undefined;
|
|
186
|
+
serviceTier?: string | null | undefined;
|
|
187
|
+
promptTokensDetails?: {
|
|
188
|
+
[x: string]: unknown;
|
|
189
|
+
modality: string;
|
|
190
|
+
tokenCount: number;
|
|
191
|
+
}[] | null | undefined;
|
|
192
|
+
cacheTokensDetails?: {
|
|
193
|
+
[x: string]: unknown;
|
|
194
|
+
modality: string;
|
|
195
|
+
tokenCount: number;
|
|
196
|
+
}[] | null | undefined;
|
|
197
|
+
candidatesTokensDetails?: {
|
|
198
|
+
[x: string]: unknown;
|
|
199
|
+
modality: string;
|
|
200
|
+
tokenCount: number;
|
|
201
|
+
}[] | null | undefined;
|
|
202
|
+
toolUsePromptTokensDetails?: {
|
|
203
|
+
[x: string]: unknown;
|
|
204
|
+
modality: string;
|
|
205
|
+
tokenCount: number;
|
|
206
|
+
}[] | null | undefined;
|
|
207
|
+
} | null | undefined;
|
|
208
|
+
promptFeedback?: {
|
|
209
|
+
blockReason?: string | null | undefined;
|
|
210
|
+
safetyRatings?: {
|
|
211
|
+
category?: string | null | undefined;
|
|
212
|
+
probability?: string | null | undefined;
|
|
213
|
+
probabilityScore?: number | null | undefined;
|
|
214
|
+
severity?: string | null | undefined;
|
|
215
|
+
severityScore?: number | null | undefined;
|
|
216
|
+
blocked?: boolean | null | undefined;
|
|
217
|
+
}[] | null | undefined;
|
|
218
|
+
} | null | undefined;
|
|
219
219
|
}>;
|
|
220
220
|
type CandidateSchema = NonNullable<InferSchema<typeof responseSchema>['candidates']>[number];
|
|
221
221
|
type GroundingMetadataSchema = NonNullable<CandidateSchema['groundingMetadata']>;
|
|
@@ -223,107 +223,116 @@ type UrlContextMetadataSchema = NonNullable<CandidateSchema['urlContextMetadata'
|
|
|
223
223
|
type SafetyRatingSchema = NonNullable<CandidateSchema['safetyRatings']>[number];
|
|
224
224
|
type PromptFeedbackSchema = NonNullable<InferSchema<typeof responseSchema>['promptFeedback']>;
|
|
225
225
|
type UsageMetadataSchema = NonNullable<InferSchema<typeof responseSchema>['usageMetadata']>;
|
|
226
|
-
|
|
226
|
+
//#endregion
|
|
227
|
+
//#region src/google-prompt.d.ts
|
|
227
228
|
type GoogleGroundingMetadata = GroundingMetadataSchema;
|
|
228
229
|
type GoogleUrlContextMetadata = UrlContextMetadataSchema;
|
|
229
230
|
type GoogleSafetyRating = SafetyRatingSchema;
|
|
230
231
|
type GooglePromptFeedback = PromptFeedbackSchema;
|
|
231
232
|
type GoogleUsageMetadata = UsageMetadataSchema;
|
|
232
233
|
interface GoogleProviderMetadata {
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
234
|
+
promptFeedback: GooglePromptFeedback | null;
|
|
235
|
+
groundingMetadata: GoogleGroundingMetadata | null;
|
|
236
|
+
urlContextMetadata: GoogleUrlContextMetadata | null;
|
|
237
|
+
safetyRatings: GoogleSafetyRating[] | null;
|
|
238
|
+
usageMetadata: GoogleUsageMetadata | null;
|
|
239
|
+
finishReason?: string | null;
|
|
240
|
+
finishMessage: string | null;
|
|
241
|
+
serviceTier: string | null;
|
|
241
242
|
}
|
|
242
|
-
|
|
243
|
+
//#endregion
|
|
244
|
+
//#region src/tool/google-search.d.ts
|
|
243
245
|
declare const googleSearchToolArgsBaseSchema: z.ZodObject<{
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
246
|
+
searchTypes: z.ZodOptional<z.ZodObject<{
|
|
247
|
+
webSearch: z.ZodOptional<z.ZodObject<{}, z.core.$strip>>;
|
|
248
|
+
imageSearch: z.ZodOptional<z.ZodObject<{}, z.core.$strip>>;
|
|
249
|
+
}, z.core.$strip>>;
|
|
250
|
+
timeRangeFilter: z.ZodOptional<z.ZodObject<{
|
|
251
|
+
startTime: z.ZodString;
|
|
252
|
+
endTime: z.ZodString;
|
|
253
|
+
}, z.core.$strip>>;
|
|
252
254
|
}, z.core.$loose>;
|
|
253
255
|
type GoogleSearchToolArgs = z.infer<typeof googleSearchToolArgsBaseSchema>;
|
|
254
|
-
|
|
256
|
+
//#endregion
|
|
257
|
+
//#region src/google-image-model-options.d.ts
|
|
255
258
|
type GoogleImageModelOptions = Omit<GoogleLanguageModelOptions, 'responseModalities'> & {
|
|
256
|
-
|
|
259
|
+
googleSearch?: GoogleSearchToolArgs;
|
|
257
260
|
};
|
|
258
|
-
|
|
261
|
+
//#endregion
|
|
262
|
+
//#region src/google-embedding-model-options.d.ts
|
|
259
263
|
type GoogleEmbeddingModelId = 'gemini-embedding-001' | 'gemini-embedding-2' | 'gemini-embedding-2-preview' | (string & {});
|
|
260
|
-
declare const googleEmbeddingModelOptions:
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
264
|
+
declare const googleEmbeddingModelOptions: import("@ai-sdk/provider-utils").LazySchema<{
|
|
265
|
+
outputDimensionality?: number | undefined;
|
|
266
|
+
taskType?: "SEMANTIC_SIMILARITY" | "CLASSIFICATION" | "CLUSTERING" | "RETRIEVAL_DOCUMENT" | "RETRIEVAL_QUERY" | "QUESTION_ANSWERING" | "FACT_VERIFICATION" | "CODE_RETRIEVAL_QUERY" | undefined;
|
|
267
|
+
content?: (({
|
|
268
|
+
text: string;
|
|
269
|
+
} | {
|
|
270
|
+
inlineData: {
|
|
271
|
+
mimeType: string;
|
|
272
|
+
data: string;
|
|
273
|
+
};
|
|
274
|
+
} | {
|
|
275
|
+
fileData: {
|
|
276
|
+
fileUri: string;
|
|
277
|
+
mimeType: string;
|
|
278
|
+
};
|
|
279
|
+
})[] | null)[] | undefined;
|
|
276
280
|
}>;
|
|
277
281
|
type GoogleEmbeddingModelOptions = InferSchema<typeof googleEmbeddingModelOptions>;
|
|
278
|
-
|
|
282
|
+
//#endregion
|
|
283
|
+
//#region src/google-video-model-options.d.ts
|
|
279
284
|
type GoogleVideoModelOptions = {
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
285
|
+
pollIntervalMs?: number | null;
|
|
286
|
+
pollTimeoutMs?: number | null;
|
|
287
|
+
personGeneration?: 'dont_allow' | 'allow_adult' | 'allow_all' | null;
|
|
288
|
+
negativePrompt?: string | null;
|
|
289
|
+
referenceImages?: Array<{
|
|
290
|
+
bytesBase64Encoded?: string;
|
|
291
|
+
gcsUri?: string;
|
|
292
|
+
}> | null;
|
|
293
|
+
[key: string]: unknown;
|
|
289
294
|
};
|
|
290
|
-
|
|
295
|
+
//#endregion
|
|
296
|
+
//#region src/google-video-settings.d.ts
|
|
291
297
|
type GoogleVideoModelId = 'veo-3.1-fast-generate-preview' | 'veo-3.1-generate-preview' | 'veo-3.1-generate' | 'veo-3.1-lite-generate-preview' | 'veo-3.0-generate-001' | 'veo-3.0-fast-generate-001' | 'veo-2.0-generate-001' | (string & {});
|
|
292
|
-
|
|
298
|
+
//#endregion
|
|
299
|
+
//#region src/google-speech-model-options.d.ts
|
|
293
300
|
type GoogleSpeechModelId = 'gemini-2.5-flash-preview-tts' | 'gemini-2.5-pro-preview-tts' | 'gemini-3.1-flash-tts-preview' | 'gemini-3.8-flash-tts' | 'gemini-3.8-flash-lite-tts' | (string & {});
|
|
294
|
-
declare const googleSpeechProviderOptionsSchema:
|
|
301
|
+
declare const googleSpeechProviderOptionsSchema: import("@ai-sdk/provider-utils").LazySchema<{
|
|
302
|
+
speechMetadata?: {
|
|
303
|
+
speaker?: string | undefined;
|
|
304
|
+
style?: string | undefined;
|
|
305
|
+
} | undefined;
|
|
306
|
+
turns?: {
|
|
307
|
+
text: string;
|
|
295
308
|
speechMetadata?: {
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
} | undefined;
|
|
299
|
-
turns?: {
|
|
300
|
-
text: string;
|
|
301
|
-
speechMetadata?: {
|
|
302
|
-
speaker?: string | undefined;
|
|
303
|
-
style?: string | undefined;
|
|
304
|
-
} | undefined;
|
|
305
|
-
}[] | undefined;
|
|
306
|
-
multiSpeakerVoiceConfig?: {
|
|
307
|
-
speakerVoiceConfigs: {
|
|
308
|
-
speaker: string;
|
|
309
|
-
voiceConfig: {
|
|
310
|
-
prebuiltVoiceConfig: {
|
|
311
|
-
voiceName: string;
|
|
312
|
-
};
|
|
313
|
-
voice?: undefined;
|
|
314
|
-
};
|
|
315
|
-
}[];
|
|
309
|
+
speaker?: string | undefined;
|
|
310
|
+
style?: string | undefined;
|
|
316
311
|
} | undefined;
|
|
312
|
+
}[] | undefined;
|
|
313
|
+
multiSpeakerVoiceConfig?: {
|
|
314
|
+
speakerVoiceConfigs: {
|
|
315
|
+
speaker: string;
|
|
316
|
+
voiceConfig: {
|
|
317
|
+
prebuiltVoiceConfig: {
|
|
318
|
+
voiceName: string;
|
|
319
|
+
};
|
|
320
|
+
voice?: undefined;
|
|
321
|
+
};
|
|
322
|
+
}[];
|
|
323
|
+
} | undefined;
|
|
317
324
|
}>;
|
|
318
325
|
type GoogleSpeechModelOptions = InferSchema<typeof googleSpeechProviderOptionsSchema>;
|
|
319
|
-
|
|
326
|
+
//#endregion
|
|
327
|
+
//#region src/google-files.d.ts
|
|
320
328
|
type GoogleFilesUploadOptions = {
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
329
|
+
displayName?: string | null;
|
|
330
|
+
pollIntervalMs?: number | null;
|
|
331
|
+
pollTimeoutMs?: number | null;
|
|
332
|
+
[key: string]: unknown;
|
|
325
333
|
};
|
|
326
|
-
|
|
334
|
+
//#endregion
|
|
335
|
+
//#region src/interactions/google-interactions-language-model-options.d.ts
|
|
327
336
|
/**
|
|
328
337
|
* Type-only union of Gemini model IDs that the Interactions API accepts via
|
|
329
338
|
* `model:`. Mirrors `Model` from `googleapis/js-genai`
|
|
@@ -339,19 +348,19 @@ type GoogleInteractionsModelId = 'gemini-2.5-computer-use-preview-10-2025' | 'ge
|
|
|
339
348
|
* Interactions API.
|
|
340
349
|
*/
|
|
341
350
|
type GoogleInteractionsVideoOptions = {
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
351
|
+
/**
|
|
352
|
+
* Controls how Gemini processes this video.
|
|
353
|
+
*
|
|
354
|
+
* Agentic processing dynamically explores the video timeline. Static
|
|
355
|
+
* processing samples frames at a fixed rate and optionally supports clipping
|
|
356
|
+
* and custom frame rates.
|
|
357
|
+
*/
|
|
358
|
+
processing?: 'agentic' | 'static' | {
|
|
359
|
+
type: 'static';
|
|
360
|
+
startOffset?: number;
|
|
361
|
+
endOffset?: number;
|
|
362
|
+
fps?: number;
|
|
363
|
+
};
|
|
355
364
|
};
|
|
356
365
|
/**
|
|
357
366
|
* Provider-options schema for `google.interactions(...)` calls. Read from the
|
|
@@ -360,121 +369,123 @@ type GoogleInteractionsVideoOptions = {
|
|
|
360
369
|
*
|
|
361
370
|
* All fields are `.nullish()` per the existing google provider convention.
|
|
362
371
|
*/
|
|
363
|
-
declare const googleInteractionsLanguageModelOptions:
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
thinkingSummaries?: "auto" | "none" | null | undefined;
|
|
373
|
-
visualization?: "auto" | "off" | null | undefined;
|
|
374
|
-
collaborativePlanning?: boolean | null | undefined;
|
|
375
|
-
} | null | undefined;
|
|
376
|
-
thinkingLevel?: "minimal" | "low" | "medium" | "high" | null | undefined;
|
|
372
|
+
declare const googleInteractionsLanguageModelOptions: import("@ai-sdk/provider-utils").LazySchema<{
|
|
373
|
+
previousInteractionId?: string | null | undefined;
|
|
374
|
+
store?: boolean | null | undefined;
|
|
375
|
+
agent?: string | null | undefined;
|
|
376
|
+
agentConfig?: {
|
|
377
|
+
[x: string]: unknown;
|
|
378
|
+
type: "dynamic";
|
|
379
|
+
} | {
|
|
380
|
+
type: "deep-research";
|
|
377
381
|
thinkingSummaries?: "auto" | "none" | null | undefined;
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
382
|
+
visualization?: "auto" | "off" | null | undefined;
|
|
383
|
+
collaborativePlanning?: boolean | null | undefined;
|
|
384
|
+
} | null | undefined;
|
|
385
|
+
thinkingLevel?: "minimal" | "low" | "medium" | "high" | null | undefined;
|
|
386
|
+
thinkingSummaries?: "auto" | "none" | null | undefined;
|
|
387
|
+
responseFormat?: ({
|
|
388
|
+
[x: string]: unknown;
|
|
389
|
+
type: "text";
|
|
390
|
+
mimeType?: string | null | undefined;
|
|
391
|
+
schema?: unknown;
|
|
392
|
+
} | {
|
|
393
|
+
[x: string]: unknown;
|
|
394
|
+
type: "image";
|
|
395
|
+
mimeType?: string | null | undefined;
|
|
396
|
+
aspectRatio?: "1:1" | "2:3" | "3:2" | "3:4" | "4:3" | "4:5" | "5:4" | "9:16" | "16:9" | "21:9" | "1:8" | "8:1" | "1:4" | "4:1" | null | undefined;
|
|
397
|
+
imageSize?: "1K" | "2K" | "4K" | "512" | null | undefined;
|
|
398
|
+
} | {
|
|
399
|
+
[x: string]: unknown;
|
|
400
|
+
type: "audio";
|
|
401
|
+
mimeType?: string | null | undefined;
|
|
402
|
+
} | {
|
|
403
|
+
[x: string]: unknown;
|
|
404
|
+
type: "video";
|
|
405
|
+
aspectRatio?: "9:16" | "16:9" | null | undefined;
|
|
406
|
+
resolution?: "360p" | "720p" | "1080p" | "4k" | null | undefined;
|
|
407
|
+
duration?: string | null | undefined;
|
|
408
|
+
delivery?: "inline" | "uri" | null | undefined;
|
|
409
|
+
gcsUri?: string | null | undefined;
|
|
410
|
+
})[] | null | undefined;
|
|
411
|
+
imageConfig?: {
|
|
412
|
+
aspectRatio?: "1:1" | "2:3" | "3:2" | "3:4" | "4:3" | "4:5" | "5:4" | "9:16" | "16:9" | "21:9" | "1:8" | "8:1" | "1:4" | "4:1" | null | undefined;
|
|
413
|
+
imageSize?: "1K" | "2K" | "4K" | "512" | null | undefined;
|
|
414
|
+
} | null | undefined;
|
|
415
|
+
mediaResolution?: "low" | "medium" | "high" | "ultra_high" | null | undefined;
|
|
416
|
+
responseModalities?: ("text" | "image" | "audio" | "video" | "document")[] | null | undefined;
|
|
417
|
+
serviceTier?: "standard" | "flex" | "priority" | null | undefined;
|
|
418
|
+
systemInstruction?: string | null | undefined;
|
|
419
|
+
signature?: string | null | undefined;
|
|
420
|
+
interactionId?: string | null | undefined;
|
|
421
|
+
pollingTimeoutMs?: number | null | undefined;
|
|
422
|
+
background?: boolean | null | undefined;
|
|
423
|
+
environment?: string | {
|
|
424
|
+
type: "remote";
|
|
425
|
+
sources?: ({
|
|
426
|
+
type: "gcs";
|
|
427
|
+
source: string;
|
|
428
|
+
target?: string | null | undefined;
|
|
383
429
|
} | {
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
aspectRatio?: "1:1" | "2:3" | "3:2" | "3:4" | "4:3" | "4:5" | "5:4" | "9:16" | "16:9" | "21:9" | "1:8" | "8:1" | "1:4" | "4:1" | null | undefined;
|
|
388
|
-
imageSize?: "1K" | "2K" | "4K" | "512" | null | undefined;
|
|
430
|
+
type: "repository";
|
|
431
|
+
source: string;
|
|
432
|
+
target?: string | null | undefined;
|
|
389
433
|
} | {
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
} | {
|
|
394
|
-
[x: string]: unknown;
|
|
395
|
-
type: "video";
|
|
396
|
-
aspectRatio?: "9:16" | "16:9" | null | undefined;
|
|
397
|
-
resolution?: "360p" | "720p" | "1080p" | "4k" | null | undefined;
|
|
398
|
-
duration?: string | null | undefined;
|
|
399
|
-
delivery?: "uri" | "inline" | null | undefined;
|
|
400
|
-
gcsUri?: string | null | undefined;
|
|
434
|
+
type: "inline";
|
|
435
|
+
content: string;
|
|
436
|
+
target: string;
|
|
401
437
|
})[] | null | undefined;
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
responseModalities?: ("text" | "image" | "document" | "audio" | "video")[] | null | undefined;
|
|
408
|
-
serviceTier?: "standard" | "flex" | "priority" | null | undefined;
|
|
409
|
-
systemInstruction?: string | null | undefined;
|
|
410
|
-
signature?: string | null | undefined;
|
|
411
|
-
interactionId?: string | null | undefined;
|
|
412
|
-
pollingTimeoutMs?: number | null | undefined;
|
|
413
|
-
background?: boolean | null | undefined;
|
|
414
|
-
environment?: string | {
|
|
415
|
-
type: "remote";
|
|
416
|
-
sources?: ({
|
|
417
|
-
type: "gcs";
|
|
418
|
-
source: string;
|
|
419
|
-
target?: string | null | undefined;
|
|
420
|
-
} | {
|
|
421
|
-
type: "repository";
|
|
422
|
-
source: string;
|
|
423
|
-
target?: string | null | undefined;
|
|
424
|
-
} | {
|
|
425
|
-
type: "inline";
|
|
426
|
-
content: string;
|
|
427
|
-
target: string;
|
|
428
|
-
})[] | null | undefined;
|
|
429
|
-
network?: "disabled" | {
|
|
430
|
-
allowlist: {
|
|
431
|
-
domain: string;
|
|
432
|
-
transform?: Record<string, string>[] | null | undefined;
|
|
433
|
-
}[];
|
|
434
|
-
} | null | undefined;
|
|
438
|
+
network?: "disabled" | {
|
|
439
|
+
allowlist: {
|
|
440
|
+
domain: string;
|
|
441
|
+
transform?: Record<string, string>[] | null | undefined;
|
|
442
|
+
}[];
|
|
435
443
|
} | null | undefined;
|
|
444
|
+
} | null | undefined;
|
|
436
445
|
}>;
|
|
437
446
|
type GoogleLanguageModelInteractionsOptions = InferSchema<typeof googleInteractionsLanguageModelOptions>;
|
|
438
|
-
|
|
447
|
+
//#endregion
|
|
448
|
+
//#region src/interactions/google-interactions-provider-metadata.d.ts
|
|
439
449
|
/**
|
|
440
450
|
* Provider-metadata shape that the Gemini Interactions language model writes
|
|
441
451
|
* onto `result.providerMetadata.google` (and reads back from input messages on
|
|
442
452
|
* the next turn for stateful chaining and signature round-trip).
|
|
443
453
|
*/
|
|
444
454
|
type GoogleInteractionsProviderMetadata = {
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
455
|
+
/**
|
|
456
|
+
* Gemini-server-side interaction id (`Interaction.id`). Pass back in
|
|
457
|
+
* `providerOptions.google.previousInteractionId` to chain stateful turns.
|
|
458
|
+
*/
|
|
459
|
+
interactionId?: string;
|
|
460
|
+
/**
|
|
461
|
+
* Service tier used for this interaction (passthrough for observability).
|
|
462
|
+
*/
|
|
463
|
+
serviceTier?: string;
|
|
464
|
+
/**
|
|
465
|
+
* Output token counts keyed by modality (e.g. `{ video: 57920 }`), sourced
|
|
466
|
+
* from the Interactions API `output_tokens_by_modality`. Present only when
|
|
467
|
+
* the response reports a breakdown. Preview surface for per-modality billing;
|
|
468
|
+
* may be promoted to a first-class usage field later.
|
|
469
|
+
*/
|
|
470
|
+
outputTokensByModality?: Record<string, number>;
|
|
471
|
+
/**
|
|
472
|
+
* Per-block signature hash for backend validation. Set by the SDK on output
|
|
473
|
+
* reasoning / tool-call parts and round-tripped on input parts.
|
|
474
|
+
*/
|
|
475
|
+
signature?: string;
|
|
476
|
+
/**
|
|
477
|
+
* ID of an agentic video `processing_call` step. Present on
|
|
478
|
+
* `google.processing_call` custom parts.
|
|
479
|
+
*/
|
|
480
|
+
processingId?: string;
|
|
481
|
+
/**
|
|
482
|
+
* ID of the corresponding agentic video processing call. Present on
|
|
483
|
+
* `google.processing_result` custom parts.
|
|
484
|
+
*/
|
|
485
|
+
processingCallId?: string;
|
|
476
486
|
};
|
|
477
|
-
|
|
487
|
+
//#endregion
|
|
488
|
+
//#region src/interactions/google-interactions-agent.d.ts
|
|
478
489
|
/**
|
|
479
490
|
* Type-only module: declares the union of supported Gemini Interactions agent
|
|
480
491
|
* names. Used by the `google.interactions({ agent })` factory branch.
|
|
@@ -485,98 +496,101 @@ type GoogleInteractionsProviderMetadata = {
|
|
|
485
496
|
* `GoogleInteractionsModelInput`.
|
|
486
497
|
*/
|
|
487
498
|
type GoogleInteractionsAgentName = 'deep-research-pro-preview-12-2025' | 'deep-research-preview-04-2026' | 'deep-research-max-preview-04-2026' | 'antigravity-preview-05-2026';
|
|
488
|
-
|
|
499
|
+
//#endregion
|
|
500
|
+
//#region src/google-tools.d.ts
|
|
489
501
|
declare const googleTools: {
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
502
|
+
/**
|
|
503
|
+
* Creates a Google search tool that gives Google direct access to real-time web content.
|
|
504
|
+
* Must have name "google_search".
|
|
505
|
+
*/
|
|
506
|
+
googleSearch: import("@ai-sdk/provider-utils").ProviderExecutedToolFactory<{}, {}, {
|
|
507
|
+
[x: string]: unknown;
|
|
508
|
+
searchTypes?: {
|
|
509
|
+
webSearch?: Record<string, never> | undefined;
|
|
510
|
+
imageSearch?: Record<string, never> | undefined;
|
|
511
|
+
} | undefined;
|
|
512
|
+
timeRangeFilter?: {
|
|
513
|
+
startTime: string;
|
|
514
|
+
endTime: string;
|
|
515
|
+
} | undefined;
|
|
516
|
+
}, {}>;
|
|
517
|
+
/**
|
|
518
|
+
* Creates an Enterprise Web Search tool for grounding responses using a compliance-focused web index.
|
|
519
|
+
* Designed for highly-regulated industries (finance, healthcare, public sector).
|
|
520
|
+
* Does not log customer data and supports VPC service controls.
|
|
521
|
+
* Must have name "enterprise_web_search".
|
|
522
|
+
*
|
|
523
|
+
* @note Only available on Vertex AI. Requires Gemini 2.0 or newer.
|
|
524
|
+
*
|
|
525
|
+
* @see https://cloud.google.com/vertex-ai/generative-ai/docs/grounding/web-grounding-enterprise
|
|
526
|
+
*/
|
|
527
|
+
enterpriseWebSearch: import("@ai-sdk/provider-utils").ProviderExecutedToolFactory<{}, {}, {}, {}>;
|
|
528
|
+
/**
|
|
529
|
+
* Creates a Google Maps grounding tool that gives the model access to Google Maps data.
|
|
530
|
+
* Must have name "google_maps".
|
|
531
|
+
*
|
|
532
|
+
* @see https://ai.google.dev/gemini-api/docs/maps-grounding
|
|
533
|
+
* @see https://cloud.google.com/vertex-ai/generative-ai/docs/grounding/grounding-with-google-maps
|
|
534
|
+
*/
|
|
535
|
+
googleMaps: import("@ai-sdk/provider-utils").ProviderExecutedToolFactory<{}, {}, {}, {}>;
|
|
536
|
+
/**
|
|
537
|
+
* Creates a URL context tool that gives Google direct access to real-time web content.
|
|
538
|
+
* Must have name "url_context".
|
|
539
|
+
*/
|
|
540
|
+
urlContext: import("@ai-sdk/provider-utils").ProviderExecutedToolFactory<{}, {}, {}, {}>;
|
|
541
|
+
/**
|
|
542
|
+
* Enables Retrieval Augmented Generation (RAG) via the Gemini File Search tool.
|
|
543
|
+
* Must have name "file_search".
|
|
544
|
+
*
|
|
545
|
+
* @param fileSearchStoreNames - Fully-qualified File Search store resource names.
|
|
546
|
+
* @param metadataFilter - Optional filter expression to restrict the files that can be retrieved.
|
|
547
|
+
* @param topK - Optional result limit for the number of chunks returned from File Search.
|
|
548
|
+
*
|
|
549
|
+
* @see https://ai.google.dev/gemini-api/docs/file-search
|
|
550
|
+
*/
|
|
551
|
+
fileSearch: import("@ai-sdk/provider-utils").ProviderExecutedToolFactory<{}, {}, {
|
|
552
|
+
[x: string]: unknown;
|
|
553
|
+
fileSearchStoreNames: string[];
|
|
554
|
+
topK?: number | undefined;
|
|
555
|
+
metadataFilter?: string | undefined;
|
|
556
|
+
}, {}>;
|
|
557
|
+
/**
|
|
558
|
+
* A tool that enables the model to generate and run Python code.
|
|
559
|
+
* Must have name "code_execution".
|
|
560
|
+
*
|
|
561
|
+
* @note Ensure the selected model supports Code Execution.
|
|
562
|
+
* Multi-tool usage with the code execution tool is typically compatible with Gemini >=2 models.
|
|
563
|
+
*
|
|
564
|
+
* @see https://ai.google.dev/gemini-api/docs/code-execution (Google AI)
|
|
565
|
+
* @see https://cloud.google.com/vertex-ai/generative-ai/docs/model-reference/code-execution-api (Vertex AI)
|
|
566
|
+
*/
|
|
567
|
+
codeExecution: import("@ai-sdk/provider-utils").ProviderExecutedToolFactory<{
|
|
568
|
+
language: string;
|
|
569
|
+
code: string;
|
|
570
|
+
}, {
|
|
571
|
+
outcome: string;
|
|
572
|
+
output: string;
|
|
573
|
+
}, {}, {}>;
|
|
574
|
+
/**
|
|
575
|
+
* Creates a Vertex RAG Store tool that enables the model to perform RAG searches against a Vertex RAG Store.
|
|
576
|
+
* Must have name "vertex_rag_store".
|
|
577
|
+
*/
|
|
578
|
+
vertexRagStore: import("@ai-sdk/provider-utils").ProviderExecutedToolFactory<{}, {}, {
|
|
579
|
+
ragCorpus: string;
|
|
580
|
+
topK?: number;
|
|
581
|
+
}, {}>;
|
|
570
582
|
};
|
|
571
|
-
|
|
583
|
+
//#endregion
|
|
584
|
+
//#region src/google-image-settings.d.ts
|
|
572
585
|
type GoogleImageModelId = 'gemini-2.5-flash-image' | 'gemini-3-pro-image-preview' | 'gemini-3.1-flash-image-preview' | (string & {});
|
|
573
586
|
interface GoogleImageSettings {
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
587
|
+
/**
|
|
588
|
+
* Override the maximum number of images per call (default 1)
|
|
589
|
+
*/
|
|
590
|
+
maxImagesPerCall?: number;
|
|
578
591
|
}
|
|
579
|
-
|
|
592
|
+
//#endregion
|
|
593
|
+
//#region src/transcription/google-transcription-model-options.d.ts
|
|
580
594
|
type GoogleTranscriptionModelId = 'gemini-3.5-transcribe' | 'gemini-3.5-transcribe-live' | (string & {});
|
|
581
595
|
/**
|
|
582
596
|
* Speech recognition options shared by unary (`gemini-3.5-transcribe`) and
|
|
@@ -584,293 +598,301 @@ type GoogleTranscriptionModelId = 'gemini-3.5-transcribe' | 'gemini-3.5-transcri
|
|
|
584
598
|
* `AudioTranscriptionConfig`.
|
|
585
599
|
*/
|
|
586
600
|
declare const googleTranscriptionModelOptions: z.ZodObject<{
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
601
|
+
languageCodes: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
602
|
+
customVocabulary: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
603
|
+
wordTimestamp: z.ZodOptional<z.ZodBoolean>;
|
|
604
|
+
diarization: z.ZodOptional<z.ZodBoolean>;
|
|
605
|
+
mode: z.ZodOptional<z.ZodEnum<{
|
|
606
|
+
SMART: "SMART";
|
|
607
|
+
VERBATIM: "VERBATIM";
|
|
608
|
+
}>>;
|
|
595
609
|
}, z.core.$strip>;
|
|
596
610
|
type GoogleTranscriptionModelOptions = z.infer<typeof googleTranscriptionModelOptions>;
|
|
597
|
-
|
|
611
|
+
//#endregion
|
|
612
|
+
//#region src/speech-translation/google-speech-translation-model-options.d.ts
|
|
598
613
|
type GoogleSpeechTranslationModelId = 'gemini-3.5-live-translate-preview' | (string & {});
|
|
599
|
-
declare const googleSpeechTranslationModelOptions:
|
|
600
|
-
|
|
614
|
+
declare const googleSpeechTranslationModelOptions: import("@ai-sdk/provider-utils").LazySchema<{
|
|
615
|
+
echoTargetLanguage?: boolean | undefined;
|
|
601
616
|
}>;
|
|
602
617
|
type GoogleSpeechTranslationModelOptions = InferSchema<typeof googleSpeechTranslationModelOptions>;
|
|
603
|
-
|
|
618
|
+
//#endregion
|
|
619
|
+
//#region src/google-provider.d.ts
|
|
604
620
|
interface GoogleProvider extends ProviderV4 {
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
621
|
+
(modelId: GoogleModelId): LanguageModelV4;
|
|
622
|
+
languageModel(modelId: GoogleModelId): LanguageModelV4;
|
|
623
|
+
chat(modelId: GoogleModelId): LanguageModelV4;
|
|
624
|
+
/** Creates an experimental Choice/Score/Boolean evaluation model using Gemini. */
|
|
625
|
+
evaluationModel(modelId: GoogleModelId): Experimental_EvaluationModelV4;
|
|
626
|
+
experimental_batch(): Experimental_BatchV4<{
|
|
627
|
+
text: GoogleModelId;
|
|
628
|
+
image: GoogleImageModelId;
|
|
629
|
+
}>;
|
|
630
|
+
/**
|
|
631
|
+
* Creates a model for image generation.
|
|
632
|
+
*/
|
|
633
|
+
image(modelId: GoogleImageModelId, settings?: GoogleImageSettings): ImageModelV4;
|
|
634
|
+
/**
|
|
635
|
+
* @deprecated Use `chat()` instead.
|
|
636
|
+
*/
|
|
637
|
+
generativeAI(modelId: GoogleModelId): LanguageModelV4;
|
|
638
|
+
/**
|
|
639
|
+
* Creates a model for text embeddings.
|
|
640
|
+
*/
|
|
641
|
+
embedding(modelId: GoogleEmbeddingModelId): EmbeddingModelV4;
|
|
642
|
+
/**
|
|
643
|
+
* Creates a model for text embeddings.
|
|
644
|
+
*/
|
|
645
|
+
embeddingModel(modelId: GoogleEmbeddingModelId): EmbeddingModelV4;
|
|
646
|
+
/**
|
|
647
|
+
* @deprecated Use `embedding` instead.
|
|
648
|
+
*/
|
|
649
|
+
textEmbedding(modelId: GoogleEmbeddingModelId): EmbeddingModelV4;
|
|
650
|
+
/**
|
|
651
|
+
* @deprecated Use `embeddingModel` instead.
|
|
652
|
+
*/
|
|
653
|
+
textEmbeddingModel(modelId: GoogleEmbeddingModelId): EmbeddingModelV4;
|
|
654
|
+
/**
|
|
655
|
+
* Creates a model for video generation.
|
|
656
|
+
*/
|
|
657
|
+
video(modelId: GoogleVideoModelId): Experimental_VideoModelV4;
|
|
658
|
+
/**
|
|
659
|
+
* Creates a model for video generation.
|
|
660
|
+
*/
|
|
661
|
+
videoModel(modelId: GoogleVideoModelId): Experimental_VideoModelV4;
|
|
662
|
+
/**
|
|
663
|
+
* Creates an experimental model for streaming speech translation.
|
|
664
|
+
*/
|
|
665
|
+
translation(modelId: GoogleSpeechTranslationModelId): Experimental_SpeechTranslationModelV4;
|
|
666
|
+
/**
|
|
667
|
+
* Creates an experimental model for streaming speech translation.
|
|
668
|
+
*/
|
|
669
|
+
speechTranslationModel(modelId: GoogleSpeechTranslationModelId): Experimental_SpeechTranslationModelV4;
|
|
670
|
+
/**
|
|
671
|
+
* Creates a model for speech generation (text-to-speech).
|
|
672
|
+
*/
|
|
673
|
+
speech(modelId: GoogleSpeechModelId): SpeechModelV4;
|
|
674
|
+
/**
|
|
675
|
+
* Creates a model for speech generation (text-to-speech).
|
|
676
|
+
*/
|
|
677
|
+
speechModel(modelId: GoogleSpeechModelId): SpeechModelV4;
|
|
678
|
+
/**
|
|
679
|
+
* Creates a model for transcription (speech-to-text). Unary models
|
|
680
|
+
* (e.g. `gemini-3.5-transcribe`) transcribe audio files; live models
|
|
681
|
+
* (e.g. `gemini-3.5-transcribe-live`) stream transcription over the
|
|
682
|
+
* Gemini Live API WebSocket via `experimental_streamTranscribe`.
|
|
683
|
+
*/
|
|
684
|
+
transcription(modelId: GoogleTranscriptionModelId): TranscriptionModelV4;
|
|
685
|
+
/**
|
|
686
|
+
* Creates a model for transcription (speech-to-text).
|
|
687
|
+
*/
|
|
688
|
+
transcriptionModel(modelId: GoogleTranscriptionModelId): TranscriptionModelV4;
|
|
689
|
+
files(): FilesV4;
|
|
690
|
+
/**
|
|
691
|
+
* Creates a language model targeting the Gemini Interactions API
|
|
692
|
+
* (`POST /v1beta/interactions`). Pass:
|
|
693
|
+
* - a model ID (string),
|
|
694
|
+
* - `{ agent: <name> }` to use a known Gemini agent preset, or
|
|
695
|
+
* - `{ managedAgent: <name> }` to use a user-defined agent created via
|
|
696
|
+
* the `/v1beta/agents` endpoint.
|
|
697
|
+
*/
|
|
698
|
+
interactions(modelIdOrAgent: GoogleInteractionsModelId | {
|
|
699
|
+
agent: GoogleInteractionsAgentName;
|
|
700
|
+
} | {
|
|
701
|
+
managedAgent: string;
|
|
702
|
+
}): LanguageModelV4;
|
|
703
|
+
experimental_realtime: Experimental_RealtimeFactoryV4;
|
|
704
|
+
tools: typeof googleTools;
|
|
689
705
|
}
|
|
690
706
|
interface GoogleProviderSettings {
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
707
|
+
/**
|
|
708
|
+
* Use a different URL prefix for API calls, e.g. to use proxy servers.
|
|
709
|
+
* The default prefix is `https://generativelanguage.googleapis.com/v1beta`.
|
|
710
|
+
*/
|
|
711
|
+
baseURL?: string;
|
|
712
|
+
/**
|
|
713
|
+
* API key that is being send using the `x-goog-api-key` header.
|
|
714
|
+
* It defaults to the `GOOGLE_GENERATIVE_AI_API_KEY` environment variable.
|
|
715
|
+
*/
|
|
716
|
+
apiKey?: string;
|
|
717
|
+
/**
|
|
718
|
+
* Custom headers to include in the requests.
|
|
719
|
+
*/
|
|
720
|
+
headers?: Record<string, string | undefined>;
|
|
721
|
+
/**
|
|
722
|
+
* Custom fetch implementation. You can use it as a middleware to intercept requests,
|
|
723
|
+
* or to provide a custom fetch implementation for e.g. testing.
|
|
724
|
+
*/
|
|
725
|
+
fetch?: FetchFunction;
|
|
726
|
+
/**
|
|
727
|
+
* Optional function to generate a unique ID for each request.
|
|
728
|
+
*/
|
|
729
|
+
generateId?: () => string;
|
|
730
|
+
/**
|
|
731
|
+
* Custom WebSocket implementation. This is useful for testing or for
|
|
732
|
+
* runtimes that need a WebSocket constructor with header support.
|
|
733
|
+
*/
|
|
734
|
+
webSocket?: WebSocketConstructor;
|
|
735
|
+
/**
|
|
736
|
+
* Custom provider name
|
|
737
|
+
* Defaults to 'google.generative-ai'.
|
|
738
|
+
*/
|
|
739
|
+
name?: string;
|
|
724
740
|
}
|
|
725
741
|
/**
|
|
726
742
|
* Create a Google provider instance.
|
|
727
743
|
*/
|
|
728
|
-
declare function createGoogle(options?: GoogleProviderSettings): GoogleProvider;
|
|
744
|
+
export declare function createGoogle(options?: GoogleProviderSettings): GoogleProvider;
|
|
729
745
|
/**
|
|
730
746
|
* Default Google Generative AI provider instance.
|
|
731
747
|
*/
|
|
732
|
-
declare const google: GoogleProvider;
|
|
733
|
-
|
|
748
|
+
export declare const google: GoogleProvider;
|
|
749
|
+
//#endregion
|
|
750
|
+
//#region src/realtime/google-realtime-model.d.ts
|
|
734
751
|
type GoogleRealtimeModelConfig = {
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
752
|
+
provider: string;
|
|
753
|
+
baseURL: string;
|
|
754
|
+
headers: () => Record<string, string | undefined>;
|
|
755
|
+
fetch?: FetchFunction;
|
|
739
756
|
};
|
|
740
757
|
declare class GoogleRealtimeModel implements Experimental_RealtimeModelV4 {
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
+
readonly specificationVersion: "v4";
|
|
759
|
+
readonly provider: string;
|
|
760
|
+
readonly modelId: string;
|
|
761
|
+
private readonly config;
|
|
762
|
+
private readonly mapper;
|
|
763
|
+
constructor(modelId: string, config: GoogleRealtimeModelConfig);
|
|
764
|
+
doCreateClientSecret(options: Experimental_RealtimeModelV4ClientSecretOptions): Promise<Experimental_RealtimeModelV4ClientSecretResult>;
|
|
765
|
+
getWebSocketConfig(options: {
|
|
766
|
+
token: string;
|
|
767
|
+
url: string;
|
|
768
|
+
}): {
|
|
769
|
+
url: string;
|
|
770
|
+
protocols?: string[];
|
|
771
|
+
};
|
|
772
|
+
parseServerEvent(raw: unknown): Experimental_RealtimeModelV4ServerEvent | Experimental_RealtimeModelV4ServerEvent[];
|
|
773
|
+
serializeClientEvent(event: Experimental_RealtimeModelV4ClientEvent): ReturnType<Experimental_RealtimeModelV4['serializeClientEvent']>;
|
|
774
|
+
buildSessionConfig(config: Experimental_RealtimeModelV4SessionConfig): Record<string, unknown>;
|
|
758
775
|
}
|
|
759
|
-
|
|
776
|
+
//#endregion
|
|
777
|
+
//#region src/realtime/google-realtime-model-options.d.ts
|
|
760
778
|
type GoogleRealtimeModelId = string;
|
|
761
779
|
type GoogleRealtimeModelOptions = {
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
780
|
+
/**
|
|
781
|
+
* Gemini Live Translation configuration.
|
|
782
|
+
*
|
|
783
|
+
* Required for `gemini-3.5-live-translate-preview` when translating speech
|
|
784
|
+
* to a target language.
|
|
785
|
+
*/
|
|
786
|
+
translationConfig?: {
|
|
787
|
+
/**
|
|
788
|
+
* BCP-47 language code of the language to translate into.
|
|
789
|
+
* Defaults to `en` in the Gemini API.
|
|
790
|
+
*/
|
|
791
|
+
targetLanguageCode?: string;
|
|
792
|
+
/**
|
|
793
|
+
* Whether input audio already in the target language should be echoed
|
|
794
|
+
* instead of producing silence.
|
|
795
|
+
*/
|
|
796
|
+
echoTargetLanguage?: boolean;
|
|
797
|
+
};
|
|
798
|
+
/**
|
|
799
|
+
* Gemini Live thinking configuration.
|
|
800
|
+
*
|
|
801
|
+
* Supported by Live models with background reasoning (e.g.
|
|
802
|
+
* `gemini-3.8-live-extended-thinking`), which can process multi-step
|
|
803
|
+
* reasoning and function calls while streaming audio responses. Not
|
|
804
|
+
* supported by latency-optimized models (e.g. `gemini-3.8-live`).
|
|
805
|
+
*/
|
|
806
|
+
thinkingConfig?: {
|
|
807
|
+
/**
|
|
808
|
+
* Thinking effort level. Background-reasoning Live models require exactly
|
|
809
|
+
* one of `thinkingLevel` or `thinkingBudget`; when neither is set, the
|
|
810
|
+
* provider sends `thinkingLevel: 'low'` on those models.
|
|
811
|
+
*/
|
|
812
|
+
thinkingLevel?: 'low' | 'medium' | 'high';
|
|
813
|
+
/**
|
|
814
|
+
* Token budget for background thinking. Mutually exclusive with
|
|
815
|
+
* `thinkingLevel`; setting it suppresses the default level.
|
|
816
|
+
*/
|
|
817
|
+
thinkingBudget?: number;
|
|
818
|
+
/**
|
|
819
|
+
* Whether thought summaries should be included in the response.
|
|
820
|
+
*/
|
|
821
|
+
includeThoughts?: boolean;
|
|
822
|
+
};
|
|
823
|
+
/**
|
|
824
|
+
* Default `behavior` stamped onto every function declaration in the
|
|
825
|
+
* session setup.
|
|
826
|
+
*
|
|
827
|
+
* Gemini 3.8 Live models default to `NON_BLOCKING` (asynchronous) function
|
|
828
|
+
* calling. Set to `BLOCKING` for synchronous calls on models that support it
|
|
829
|
+
* (e.g. `gemini-3.8-live`); background-reasoning models accept only
|
|
830
|
+
* `NON_BLOCKING`.
|
|
831
|
+
*/
|
|
832
|
+
defaultToolBehavior?: 'BLOCKING' | 'NON_BLOCKING';
|
|
815
833
|
};
|
|
816
|
-
|
|
834
|
+
//#endregion
|
|
835
|
+
//#region src/transcription/google-transcription-model.d.ts
|
|
817
836
|
interface GoogleTranscriptionModelConfig {
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
837
|
+
provider: string;
|
|
838
|
+
baseURL: string;
|
|
839
|
+
headers?: Resolvable<Record<string, string | undefined>>;
|
|
840
|
+
fetch?: FetchFunction;
|
|
841
|
+
webSocket?: WebSocketConstructor;
|
|
842
|
+
_internal?: {
|
|
843
|
+
currentDate?: () => Date;
|
|
844
|
+
finishGraceMs?: number;
|
|
845
|
+
};
|
|
827
846
|
}
|
|
828
|
-
declare class GoogleTranscriptionModel implements TranscriptionModelV4 {
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
847
|
+
export declare class GoogleTranscriptionModel implements TranscriptionModelV4 {
|
|
848
|
+
readonly modelId: GoogleTranscriptionModelId;
|
|
849
|
+
private readonly config;
|
|
850
|
+
readonly specificationVersion = "v4";
|
|
851
|
+
static [WORKFLOW_SERIALIZE](model: GoogleTranscriptionModel): {
|
|
852
|
+
modelId: string;
|
|
853
|
+
config: JSONObject;
|
|
854
|
+
};
|
|
855
|
+
static [WORKFLOW_DESERIALIZE](options: {
|
|
856
|
+
modelId: GoogleTranscriptionModelId;
|
|
857
|
+
config: GoogleTranscriptionModelConfig;
|
|
858
|
+
}): GoogleTranscriptionModel;
|
|
859
|
+
get provider(): string;
|
|
860
|
+
constructor(modelId: GoogleTranscriptionModelId, config: GoogleTranscriptionModelConfig);
|
|
861
|
+
private parseOptions;
|
|
862
|
+
doGenerate(options: Parameters<TranscriptionModelV4['doGenerate']>[0]): Promise<Awaited<ReturnType<TranscriptionModelV4['doGenerate']>>>;
|
|
863
|
+
doStream(options: Experimental_TranscriptionModelV4StreamOptions): Promise<Awaited<ReturnType<NonNullable<TranscriptionModelV4['doStream']>>>>;
|
|
845
864
|
}
|
|
846
|
-
|
|
865
|
+
//#endregion
|
|
866
|
+
//#region src/speech-translation/google-speech-translation-model.d.ts
|
|
847
867
|
type GoogleSpeechTranslationModelConfig = {
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
868
|
+
provider: string;
|
|
869
|
+
baseURL: string;
|
|
870
|
+
headers: () => Record<string, string | undefined>;
|
|
871
|
+
webSocket?: WebSocketConstructor;
|
|
872
|
+
_internal?: {
|
|
873
|
+
currentDate?: () => Date;
|
|
874
|
+
finishGraceMs?: number;
|
|
875
|
+
};
|
|
856
876
|
};
|
|
857
877
|
declare class GoogleSpeechTranslationModel implements Experimental_SpeechTranslationModelV4 {
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
878
|
+
readonly specificationVersion = "v4";
|
|
879
|
+
readonly modelId: GoogleSpeechTranslationModelId;
|
|
880
|
+
private readonly config;
|
|
881
|
+
static [WORKFLOW_SERIALIZE](model: GoogleSpeechTranslationModel): {
|
|
882
|
+
modelId: string;
|
|
883
|
+
config: import("@ai-sdk/provider").JSONObject;
|
|
884
|
+
};
|
|
885
|
+
static [WORKFLOW_DESERIALIZE](options: {
|
|
886
|
+
modelId: GoogleSpeechTranslationModelId;
|
|
887
|
+
config: GoogleSpeechTranslationModelConfig;
|
|
888
|
+
}): GoogleSpeechTranslationModel;
|
|
889
|
+
get provider(): string;
|
|
890
|
+
constructor(modelId: GoogleSpeechTranslationModelId, config: GoogleSpeechTranslationModelConfig);
|
|
891
|
+
doStream(options: Experimental_SpeechTranslationModelV4StreamOptions): Promise<Awaited<ReturnType<Experimental_SpeechTranslationModelV4['doStream']>>>;
|
|
872
892
|
}
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
893
|
+
//#endregion
|
|
894
|
+
//#region src/version.d.ts
|
|
895
|
+
export declare const VERSION: string;
|
|
896
|
+
//#endregion
|
|
897
|
+
export { GoogleRealtimeModel as Experimental_GoogleRealtimeModel, type GoogleRealtimeModelConfig as Experimental_GoogleRealtimeModelConfig, type GoogleRealtimeModelId as Experimental_GoogleRealtimeModelId, type GoogleRealtimeModelOptions as Experimental_GoogleRealtimeModelOptions, GoogleSpeechTranslationModel as Experimental_GoogleSpeechTranslationModel, GoogleSpeechTranslationModel as Experimental_GoogleTranslationModel, type GoogleSpeechTranslationModelConfig as Experimental_GoogleSpeechTranslationModelConfig, type GoogleSpeechTranslationModelConfig as Experimental_GoogleTranslationModelConfig, type GoogleSpeechTranslationModelId as Experimental_GoogleSpeechTranslationModelId, type GoogleSpeechTranslationModelId as Experimental_GoogleTranslationModelId, type GoogleSpeechTranslationModelOptions as Experimental_GoogleSpeechTranslationModelOptions, type GoogleSpeechTranslationModelOptions as Experimental_GoogleTranslationModelOptions, type GoogleEmbeddingModelOptions, type GoogleEmbeddingModelOptions as GoogleGenerativeAIEmbeddingProviderOptions, type GoogleErrorData, type GoogleFilesUploadOptions, type GoogleImageModelOptions as GoogleGenerativeAIImageProviderOptions, type GoogleImageModelOptions, type GoogleProvider as GoogleGenerativeAIProvider, type GoogleProvider, type GoogleProviderMetadata as GoogleGenerativeAIProviderMetadata, type GoogleProviderMetadata, type GoogleLanguageModelOptions as GoogleGenerativeAIProviderOptions, type GoogleLanguageModelOptions, type GoogleProviderSettings as GoogleGenerativeAIProviderSettings, type GoogleProviderSettings, type GoogleVideoModelId as GoogleGenerativeAIVideoModelId, type GoogleVideoModelId, type GoogleVideoModelOptions as GoogleGenerativeAIVideoProviderOptions, type GoogleVideoModelOptions, type GoogleInteractionsAgentName, type GoogleInteractionsModelId, type GoogleInteractionsProviderMetadata, type GoogleInteractionsVideoOptions, type GoogleLanguageModelInteractionsOptions, type GoogleSpeechModelId, type GoogleSpeechModelOptions, type GoogleTranscriptionModelId, type GoogleTranscriptionModelOptions, createGoogle as createGoogleGenerativeAI };
|
|
898
|
+
//# sourceMappingURL=index.d.ts.map
|