@ai-sdk/google 4.0.85 → 4.0.87
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 +20 -0
- package/dist/index.d.ts +766 -744
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +7846 -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 +5317 -6233
- package/dist/internal/index.js.map +1 -1
- package/docs/15-google.mdx +1 -1
- package/package.json +8 -8
- package/src/google-speech-api.ts +1 -0
- package/src/google-speech-model.ts +3 -0
- package/src/transcription/google-transcription-model.ts +4 -2
package/dist/internal/index.d.ts
CHANGED
|
@@ -1,559 +1,564 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
import { z } from 'zod/v4';
|
|
6
|
-
|
|
1
|
+
import { FetchFunction, InferSchema, Resolvable, WORKFLOW_DESERIALIZE, WORKFLOW_SERIALIZE, createToolNameMapping } from "@ai-sdk/provider-utils";
|
|
2
|
+
import { z } from "zod/v4";
|
|
3
|
+
import { JSONObject, LanguageModelV4, LanguageModelV4CallOptions, LanguageModelV4GenerateResult, LanguageModelV4StreamResult, SharedV4Warning, SpeechModelV4 } from "@ai-sdk/provider";
|
|
4
|
+
//#region src/google-prompt.d.ts
|
|
7
5
|
type GoogleSystemInstruction = {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
6
|
+
parts: Array<{
|
|
7
|
+
text: string;
|
|
8
|
+
}>;
|
|
11
9
|
};
|
|
12
10
|
type GoogleContent = {
|
|
13
|
-
|
|
14
|
-
|
|
11
|
+
role: 'user' | 'model';
|
|
12
|
+
parts: Array<GoogleContentPart>;
|
|
15
13
|
};
|
|
16
14
|
type GoogleContentPart = {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
15
|
+
text: string;
|
|
16
|
+
thought?: boolean;
|
|
17
|
+
thoughtSignature?: string;
|
|
20
18
|
} | {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
19
|
+
inlineData: {
|
|
20
|
+
mimeType: string;
|
|
21
|
+
data: string;
|
|
22
|
+
};
|
|
23
|
+
thought?: boolean;
|
|
24
|
+
thoughtSignature?: string;
|
|
27
25
|
} | {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
26
|
+
functionCall: {
|
|
27
|
+
id?: string;
|
|
28
|
+
name: string;
|
|
29
|
+
args: unknown;
|
|
30
|
+
};
|
|
31
|
+
thoughtSignature?: string;
|
|
34
32
|
} | {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
33
|
+
functionResponse: {
|
|
34
|
+
id?: string;
|
|
35
|
+
name: string;
|
|
36
|
+
response: unknown;
|
|
37
|
+
parts?: Array<GoogleFunctionResponsePart>;
|
|
38
|
+
};
|
|
41
39
|
} | {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
40
|
+
fileData: {
|
|
41
|
+
mimeType: string;
|
|
42
|
+
fileUri: string;
|
|
43
|
+
};
|
|
44
|
+
thought?: boolean;
|
|
45
|
+
thoughtSignature?: string;
|
|
48
46
|
} | {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
47
|
+
toolCall: {
|
|
48
|
+
toolType: string;
|
|
49
|
+
args?: unknown;
|
|
50
|
+
id: string;
|
|
51
|
+
};
|
|
52
|
+
thoughtSignature?: string;
|
|
55
53
|
} | {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
54
|
+
toolResponse: {
|
|
55
|
+
toolType: string;
|
|
56
|
+
response?: unknown;
|
|
57
|
+
id: string;
|
|
58
|
+
};
|
|
59
|
+
thoughtSignature?: string;
|
|
62
60
|
} | {
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
61
|
+
executableCode: {
|
|
62
|
+
language: string;
|
|
63
|
+
code: string;
|
|
64
|
+
};
|
|
67
65
|
} | {
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
66
|
+
codeExecutionResult: {
|
|
67
|
+
outcome: string;
|
|
68
|
+
output: string;
|
|
69
|
+
};
|
|
72
70
|
};
|
|
73
71
|
type GoogleFunctionResponsePart = {
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
72
|
+
inlineData: {
|
|
73
|
+
mimeType: string;
|
|
74
|
+
data: string;
|
|
75
|
+
};
|
|
78
76
|
} | {
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
77
|
+
fileData: {
|
|
78
|
+
mimeType: string;
|
|
79
|
+
fileUri: string;
|
|
80
|
+
};
|
|
83
81
|
};
|
|
84
|
-
|
|
82
|
+
//#endregion
|
|
83
|
+
//#region src/google-language-model-options.d.ts
|
|
85
84
|
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 & {});
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
85
|
+
//#endregion
|
|
86
|
+
//#region src/google-language-model.d.ts
|
|
87
|
+
export type GoogleLanguageModelConfig = {
|
|
88
|
+
provider: string;
|
|
89
|
+
baseURL: string;
|
|
90
|
+
headers?: Resolvable<Record<string, string | undefined>>;
|
|
91
|
+
fetch?: FetchFunction;
|
|
92
|
+
generateId: () => string;
|
|
93
|
+
/**
|
|
94
|
+
* The supported URLs for the model.
|
|
95
|
+
*/
|
|
96
|
+
supportedUrls?: () => LanguageModelV4['supportedUrls'];
|
|
97
|
+
/**
|
|
98
|
+
* Settings for downloading remote files in tool results before conversion.
|
|
99
|
+
*/
|
|
100
|
+
downloadToolResultFiles?: {
|
|
101
|
+
maxBytes: number;
|
|
102
|
+
supportsGoogleCloudStorageUrls?: boolean;
|
|
103
|
+
};
|
|
104
104
|
};
|
|
105
|
-
declare class GoogleLanguageModel implements LanguageModelV4 {
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
105
|
+
export declare class GoogleLanguageModel implements LanguageModelV4 {
|
|
106
|
+
readonly specificationVersion = "v4";
|
|
107
|
+
readonly modelId: GoogleModelId;
|
|
108
|
+
private readonly config;
|
|
109
|
+
private readonly generateId;
|
|
110
|
+
static [WORKFLOW_SERIALIZE](model: GoogleLanguageModel): {
|
|
111
|
+
modelId: string;
|
|
112
|
+
config: JSONObject;
|
|
113
|
+
};
|
|
114
|
+
static [WORKFLOW_DESERIALIZE](options: {
|
|
115
|
+
modelId: string;
|
|
116
|
+
config: GoogleLanguageModelConfig;
|
|
117
|
+
}): GoogleLanguageModel;
|
|
118
|
+
constructor(modelId: GoogleModelId, config: GoogleLanguageModelConfig);
|
|
119
|
+
get provider(): string;
|
|
120
|
+
get supportedUrls(): Record<string, RegExp[]> | PromiseLike<Record<string, RegExp[]>>;
|
|
121
|
+
static prepareRequest({ modelId, config, options: { prompt, maxOutputTokens, temperature, topP, topK, frequencyPenalty, presencePenalty, stopSequences, responseFormat, seed, tools, toolChoice, reasoning, providerOptions, abortSignal }, isStreaming }: {
|
|
122
|
+
modelId: GoogleModelId;
|
|
123
|
+
config: GoogleLanguageModelConfig;
|
|
124
|
+
options: LanguageModelV4CallOptions;
|
|
125
|
+
isStreaming?: boolean;
|
|
126
|
+
}): Promise<{
|
|
127
|
+
args: {
|
|
128
|
+
generationConfig: {
|
|
129
|
+
imageConfig?: {
|
|
130
|
+
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;
|
|
131
|
+
imageSize?: "1K" | "2K" | "4K" | "512" | undefined;
|
|
132
|
+
personGeneration?: "PERSON_GENERATION_UNSPECIFIED" | "ALLOW_ALL" | "ALLOW_ADULT" | "ALLOW_NONE" | undefined;
|
|
133
|
+
prominentPeople?: "PROMINENT_PEOPLE_UNSPECIFIED" | "ALLOW_PROMINENT_PEOPLE" | "BLOCK_PROMINENT_PEOPLE" | undefined;
|
|
134
|
+
imageOutputOptions?: {
|
|
135
|
+
mimeType?: "image/jpeg" | "image/png" | undefined;
|
|
136
|
+
compressionQuality?: number | undefined;
|
|
137
|
+
} | undefined;
|
|
138
|
+
} | undefined;
|
|
139
|
+
mediaResolution?: "MEDIA_RESOLUTION_UNSPECIFIED" | "MEDIA_RESOLUTION_LOW" | "MEDIA_RESOLUTION_MEDIUM" | "MEDIA_RESOLUTION_HIGH" | undefined;
|
|
140
|
+
responseModalities: ("TEXT" | "IMAGE")[] | undefined;
|
|
141
|
+
thinkingConfig: {
|
|
142
|
+
thinkingBudget?: number | undefined;
|
|
143
|
+
includeThoughts?: boolean | undefined;
|
|
144
|
+
thinkingLevel?: "minimal" | "low" | "medium" | "high" | undefined;
|
|
145
|
+
} | undefined;
|
|
146
|
+
audioTimestamp?: true | undefined;
|
|
147
|
+
maxOutputTokens: number | undefined;
|
|
148
|
+
temperature: number | undefined;
|
|
149
|
+
topK: number | undefined;
|
|
150
|
+
topP: number | undefined;
|
|
151
|
+
frequencyPenalty: number | undefined;
|
|
152
|
+
presencePenalty: number | undefined;
|
|
153
|
+
stopSequences: string[] | undefined;
|
|
154
|
+
seed: number | undefined;
|
|
155
|
+
responseMimeType: string | undefined;
|
|
156
|
+
responseJsonSchema: import("@ai-sdk/provider").JSONSchema7 | undefined;
|
|
157
|
+
};
|
|
158
|
+
contents: GoogleContent[];
|
|
159
|
+
systemInstruction: GoogleSystemInstruction | undefined;
|
|
160
|
+
safetySettings: {
|
|
161
|
+
category: "HARM_CATEGORY_UNSPECIFIED" | "HARM_CATEGORY_HATE_SPEECH" | "HARM_CATEGORY_DANGEROUS_CONTENT" | "HARM_CATEGORY_HARASSMENT" | "HARM_CATEGORY_SEXUALLY_EXPLICIT" | "HARM_CATEGORY_CIVIC_INTEGRITY";
|
|
162
|
+
threshold: "HARM_BLOCK_THRESHOLD_UNSPECIFIED" | "BLOCK_LOW_AND_ABOVE" | "BLOCK_MEDIUM_AND_ABOVE" | "BLOCK_ONLY_HIGH" | "BLOCK_NONE" | "OFF";
|
|
163
|
+
}[] | undefined;
|
|
164
|
+
tools: ({
|
|
165
|
+
functionDeclarations: {
|
|
166
|
+
name: string;
|
|
167
|
+
description: string;
|
|
168
|
+
parametersJsonSchema: unknown;
|
|
169
|
+
}[];
|
|
170
|
+
} | Record<string, any>)[] | undefined;
|
|
171
|
+
toolConfig: {
|
|
172
|
+
retrievalConfig?: {
|
|
173
|
+
latLng?: {
|
|
174
|
+
latitude: number;
|
|
175
|
+
longitude: number;
|
|
176
|
+
} | undefined;
|
|
177
|
+
} | undefined;
|
|
178
|
+
functionCallingConfig?: {
|
|
179
|
+
mode: "AUTO" | "NONE" | "ANY" | "VALIDATED";
|
|
180
|
+
allowedFunctionNames?: string[];
|
|
181
|
+
streamFunctionCallArguments?: boolean;
|
|
182
|
+
} | {
|
|
183
|
+
streamFunctionCallArguments: true;
|
|
184
|
+
mode?: "AUTO" | "NONE" | "ANY" | "VALIDATED" | undefined;
|
|
185
|
+
allowedFunctionNames?: string[];
|
|
186
|
+
} | undefined;
|
|
187
|
+
includeServerSideToolInvocations?: boolean;
|
|
188
|
+
} | undefined;
|
|
189
|
+
cachedContent: string | undefined;
|
|
190
|
+
labels: Record<string, string> | undefined;
|
|
191
|
+
serviceTier: "standard" | "flex" | "priority" | undefined;
|
|
113
192
|
};
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
imageConfig?: {
|
|
130
|
-
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;
|
|
131
|
-
imageSize?: "1K" | "2K" | "4K" | "512" | undefined;
|
|
132
|
-
personGeneration?: "PERSON_GENERATION_UNSPECIFIED" | "ALLOW_ALL" | "ALLOW_ADULT" | "ALLOW_NONE" | undefined;
|
|
133
|
-
prominentPeople?: "PROMINENT_PEOPLE_UNSPECIFIED" | "ALLOW_PROMINENT_PEOPLE" | "BLOCK_PROMINENT_PEOPLE" | undefined;
|
|
134
|
-
imageOutputOptions?: {
|
|
135
|
-
mimeType?: "image/jpeg" | "image/png" | undefined;
|
|
136
|
-
compressionQuality?: number | undefined;
|
|
137
|
-
} | undefined;
|
|
138
|
-
} | undefined;
|
|
139
|
-
mediaResolution?: "MEDIA_RESOLUTION_UNSPECIFIED" | "MEDIA_RESOLUTION_LOW" | "MEDIA_RESOLUTION_MEDIUM" | "MEDIA_RESOLUTION_HIGH" | undefined;
|
|
140
|
-
responseModalities: ("TEXT" | "IMAGE")[] | undefined;
|
|
141
|
-
thinkingConfig: {
|
|
142
|
-
thinkingBudget?: number | undefined;
|
|
143
|
-
includeThoughts?: boolean | undefined;
|
|
144
|
-
thinkingLevel?: "minimal" | "low" | "medium" | "high" | undefined;
|
|
145
|
-
} | undefined;
|
|
146
|
-
audioTimestamp?: true | undefined;
|
|
147
|
-
maxOutputTokens: number | undefined;
|
|
148
|
-
temperature: number | undefined;
|
|
149
|
-
topK: number | undefined;
|
|
150
|
-
topP: number | undefined;
|
|
151
|
-
frequencyPenalty: number | undefined;
|
|
152
|
-
presencePenalty: number | undefined;
|
|
153
|
-
stopSequences: string[] | undefined;
|
|
154
|
-
seed: number | undefined;
|
|
155
|
-
responseMimeType: string | undefined;
|
|
156
|
-
responseJsonSchema: _ai_sdk_provider.JSONSchema7 | undefined;
|
|
157
|
-
};
|
|
158
|
-
contents: GoogleContent[];
|
|
159
|
-
systemInstruction: GoogleSystemInstruction | undefined;
|
|
160
|
-
safetySettings: {
|
|
161
|
-
category: "HARM_CATEGORY_UNSPECIFIED" | "HARM_CATEGORY_HATE_SPEECH" | "HARM_CATEGORY_DANGEROUS_CONTENT" | "HARM_CATEGORY_HARASSMENT" | "HARM_CATEGORY_SEXUALLY_EXPLICIT" | "HARM_CATEGORY_CIVIC_INTEGRITY";
|
|
162
|
-
threshold: "HARM_BLOCK_THRESHOLD_UNSPECIFIED" | "BLOCK_LOW_AND_ABOVE" | "BLOCK_MEDIUM_AND_ABOVE" | "BLOCK_ONLY_HIGH" | "BLOCK_NONE" | "OFF";
|
|
163
|
-
}[] | undefined;
|
|
164
|
-
tools: ({
|
|
165
|
-
functionDeclarations: {
|
|
166
|
-
name: string;
|
|
167
|
-
description: string;
|
|
168
|
-
parametersJsonSchema: unknown;
|
|
169
|
-
}[];
|
|
170
|
-
} | Record<string, any>)[] | undefined;
|
|
171
|
-
toolConfig: {
|
|
172
|
-
retrievalConfig?: {
|
|
173
|
-
latLng?: {
|
|
174
|
-
latitude: number;
|
|
175
|
-
longitude: number;
|
|
176
|
-
} | undefined;
|
|
177
|
-
} | undefined;
|
|
178
|
-
functionCallingConfig?: {
|
|
179
|
-
mode: "AUTO" | "NONE" | "ANY" | "VALIDATED";
|
|
180
|
-
allowedFunctionNames?: string[];
|
|
181
|
-
streamFunctionCallArguments?: boolean;
|
|
182
|
-
} | {
|
|
183
|
-
streamFunctionCallArguments: true;
|
|
184
|
-
mode?: "AUTO" | "NONE" | "ANY" | "VALIDATED" | undefined;
|
|
185
|
-
allowedFunctionNames?: string[];
|
|
186
|
-
} | undefined;
|
|
187
|
-
includeServerSideToolInvocations?: boolean;
|
|
188
|
-
} | undefined;
|
|
189
|
-
cachedContent: string | undefined;
|
|
190
|
-
labels: Record<string, string> | undefined;
|
|
191
|
-
serviceTier: "standard" | "flex" | "priority" | undefined;
|
|
192
|
-
};
|
|
193
|
-
warnings: SharedV4Warning[];
|
|
194
|
-
providerOptionsNames: readonly string[];
|
|
195
|
-
extraHeaders: Record<string, string> | undefined;
|
|
196
|
-
toolNameMapping: _ai_sdk_provider_utils.ToolNameMapping;
|
|
197
|
-
}>;
|
|
198
|
-
private getArgs;
|
|
199
|
-
static convertGenerateContentResponse({ config, response, warnings, providerOptionsNames, toolNameMapping, }: {
|
|
200
|
-
config: GoogleLanguageModelConfig;
|
|
201
|
-
response: InferSchema<typeof responseSchema>;
|
|
202
|
-
warnings: SharedV4Warning[];
|
|
203
|
-
providerOptionsNames: readonly string[];
|
|
204
|
-
toolNameMapping?: ReturnType<typeof createToolNameMapping>;
|
|
205
|
-
}): LanguageModelV4GenerateResult;
|
|
206
|
-
doGenerate(options: LanguageModelV4CallOptions): Promise<LanguageModelV4GenerateResult>;
|
|
207
|
-
doStream(options: LanguageModelV4CallOptions): Promise<LanguageModelV4StreamResult>;
|
|
193
|
+
warnings: SharedV4Warning[];
|
|
194
|
+
providerOptionsNames: readonly string[];
|
|
195
|
+
extraHeaders: Record<string, string> | undefined;
|
|
196
|
+
toolNameMapping: import("@ai-sdk/provider-utils").ToolNameMapping;
|
|
197
|
+
}>;
|
|
198
|
+
private getArgs;
|
|
199
|
+
static convertGenerateContentResponse({ config, response, warnings, providerOptionsNames, toolNameMapping }: {
|
|
200
|
+
config: GoogleLanguageModelConfig;
|
|
201
|
+
response: InferSchema<typeof responseSchema>;
|
|
202
|
+
warnings: SharedV4Warning[];
|
|
203
|
+
providerOptionsNames: readonly string[];
|
|
204
|
+
toolNameMapping?: ReturnType<typeof createToolNameMapping>;
|
|
205
|
+
}): LanguageModelV4GenerateResult;
|
|
206
|
+
doGenerate(options: LanguageModelV4CallOptions): Promise<LanguageModelV4GenerateResult>;
|
|
207
|
+
doStream(options: LanguageModelV4CallOptions): Promise<LanguageModelV4StreamResult>;
|
|
208
208
|
}
|
|
209
|
-
declare const getGroundingMetadataSchema: () => z.ZodObject<{
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
209
|
+
export declare const getGroundingMetadataSchema: () => z.ZodObject<{
|
|
210
|
+
webSearchQueries: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
|
|
211
|
+
imageSearchQueries: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
|
|
212
|
+
retrievalQueries: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
|
|
213
|
+
searchEntryPoint: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
214
|
+
renderedContent: z.ZodString;
|
|
215
|
+
}, z.core.$strip>>>;
|
|
216
|
+
groundingChunks: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
217
|
+
web: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
218
|
+
uri: z.ZodString;
|
|
219
|
+
title: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
215
220
|
}, z.core.$strip>>>;
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
confidenceScore: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodNumber>>>;
|
|
251
|
-
}, z.core.$strip>>>>;
|
|
252
|
-
retrievalMetadata: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodObject<{
|
|
253
|
-
webDynamicRetrievalScore: z.ZodNumber;
|
|
254
|
-
}, z.core.$strip>, z.ZodObject<{}, z.core.$strip>]>>>;
|
|
221
|
+
image: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
222
|
+
sourceUri: z.ZodString;
|
|
223
|
+
imageUri: z.ZodString;
|
|
224
|
+
title: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
225
|
+
domain: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
226
|
+
}, z.core.$strip>>>;
|
|
227
|
+
retrievedContext: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
228
|
+
uri: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
229
|
+
title: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
230
|
+
text: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
231
|
+
fileSearchStore: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
232
|
+
}, z.core.$strip>>>;
|
|
233
|
+
maps: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
234
|
+
uri: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
235
|
+
title: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
236
|
+
text: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
237
|
+
placeId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
238
|
+
}, z.core.$strip>>>;
|
|
239
|
+
}, z.core.$strip>>>>;
|
|
240
|
+
groundingSupports: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
241
|
+
segment: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
242
|
+
startIndex: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
243
|
+
endIndex: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
244
|
+
text: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
245
|
+
}, z.core.$strip>>>;
|
|
246
|
+
segment_text: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
247
|
+
groundingChunkIndices: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodNumber>>>;
|
|
248
|
+
supportChunkIndices: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodNumber>>>;
|
|
249
|
+
confidenceScores: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodNumber>>>;
|
|
250
|
+
confidenceScore: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodNumber>>>;
|
|
251
|
+
}, z.core.$strip>>>>;
|
|
252
|
+
retrievalMetadata: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodObject<{
|
|
253
|
+
webDynamicRetrievalScore: z.ZodNumber;
|
|
254
|
+
}, z.core.$strip>, z.ZodObject<{}, z.core.$strip>]>>>;
|
|
255
255
|
}, z.core.$strip>;
|
|
256
|
-
declare const getUrlContextMetadataSchema: () => z.ZodObject<{
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
256
|
+
export declare const getUrlContextMetadataSchema: () => z.ZodObject<{
|
|
257
|
+
urlMetadata: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
258
|
+
retrievedUrl: z.ZodString;
|
|
259
|
+
urlRetrievalStatus: z.ZodString;
|
|
260
|
+
}, z.core.$strip>>>>;
|
|
261
261
|
}, z.core.$strip>;
|
|
262
|
-
declare const responseSchema:
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
} | null | undefined;
|
|
308
|
-
codeExecutionResult?: {
|
|
309
|
-
outcome: string;
|
|
310
|
-
output?: string | null | undefined;
|
|
311
|
-
} | null | undefined;
|
|
312
|
-
text?: string | null | undefined;
|
|
313
|
-
thought?: boolean | null | undefined;
|
|
314
|
-
thoughtSignature?: string | null | undefined;
|
|
315
|
-
})[] | null | undefined;
|
|
316
|
-
} | null | undefined;
|
|
317
|
-
finishReason?: string | null | undefined;
|
|
318
|
-
finishMessage?: string | null | undefined;
|
|
319
|
-
safetyRatings?: {
|
|
320
|
-
category?: string | null | undefined;
|
|
321
|
-
probability?: string | null | undefined;
|
|
322
|
-
probabilityScore?: number | null | undefined;
|
|
323
|
-
severity?: string | null | undefined;
|
|
324
|
-
severityScore?: number | null | undefined;
|
|
325
|
-
blocked?: boolean | null | undefined;
|
|
326
|
-
}[] | null | undefined;
|
|
327
|
-
groundingMetadata?: {
|
|
328
|
-
webSearchQueries?: string[] | null | undefined;
|
|
329
|
-
imageSearchQueries?: string[] | null | undefined;
|
|
330
|
-
retrievalQueries?: string[] | null | undefined;
|
|
331
|
-
searchEntryPoint?: {
|
|
332
|
-
renderedContent: string;
|
|
333
|
-
} | null | undefined;
|
|
334
|
-
groundingChunks?: {
|
|
335
|
-
web?: {
|
|
336
|
-
uri: string;
|
|
337
|
-
title?: string | null | undefined;
|
|
338
|
-
} | null | undefined;
|
|
339
|
-
image?: {
|
|
340
|
-
sourceUri: string;
|
|
341
|
-
imageUri: string;
|
|
342
|
-
title?: string | null | undefined;
|
|
343
|
-
domain?: string | null | undefined;
|
|
344
|
-
} | null | undefined;
|
|
345
|
-
retrievedContext?: {
|
|
346
|
-
uri?: string | null | undefined;
|
|
347
|
-
title?: string | null | undefined;
|
|
348
|
-
text?: string | null | undefined;
|
|
349
|
-
fileSearchStore?: string | null | undefined;
|
|
350
|
-
} | null | undefined;
|
|
351
|
-
maps?: {
|
|
352
|
-
uri?: string | null | undefined;
|
|
353
|
-
title?: string | null | undefined;
|
|
354
|
-
text?: string | null | undefined;
|
|
355
|
-
placeId?: string | null | undefined;
|
|
356
|
-
} | null | undefined;
|
|
357
|
-
}[] | null | undefined;
|
|
358
|
-
groundingSupports?: {
|
|
359
|
-
segment?: {
|
|
360
|
-
startIndex?: number | null | undefined;
|
|
361
|
-
endIndex?: number | null | undefined;
|
|
362
|
-
text?: string | null | undefined;
|
|
363
|
-
} | null | undefined;
|
|
364
|
-
segment_text?: string | null | undefined;
|
|
365
|
-
groundingChunkIndices?: number[] | null | undefined;
|
|
366
|
-
supportChunkIndices?: number[] | null | undefined;
|
|
367
|
-
confidenceScores?: number[] | null | undefined;
|
|
368
|
-
confidenceScore?: number[] | null | undefined;
|
|
369
|
-
}[] | null | undefined;
|
|
370
|
-
retrievalMetadata?: Record<string, never> | {
|
|
371
|
-
webDynamicRetrievalScore: number;
|
|
372
|
-
} | null | undefined;
|
|
262
|
+
export declare const responseSchema: import("@ai-sdk/provider-utils").LazySchema<{
|
|
263
|
+
responseId?: string | null | undefined;
|
|
264
|
+
candidates?: {
|
|
265
|
+
content?: Record<string, never> | {
|
|
266
|
+
parts?: ({
|
|
267
|
+
functionCall: {
|
|
268
|
+
id?: string | null | undefined;
|
|
269
|
+
name?: string | null | undefined;
|
|
270
|
+
args?: unknown;
|
|
271
|
+
partialArgs?: {
|
|
272
|
+
jsonPath: string;
|
|
273
|
+
stringValue?: string | null | undefined;
|
|
274
|
+
numberValue?: number | null | undefined;
|
|
275
|
+
boolValue?: boolean | null | undefined;
|
|
276
|
+
nullValue?: unknown;
|
|
277
|
+
willContinue?: boolean | null | undefined;
|
|
278
|
+
}[] | null | undefined;
|
|
279
|
+
willContinue?: boolean | null | undefined;
|
|
280
|
+
};
|
|
281
|
+
thoughtSignature?: string | null | undefined;
|
|
282
|
+
} | {
|
|
283
|
+
inlineData: {
|
|
284
|
+
mimeType: string;
|
|
285
|
+
data: string;
|
|
286
|
+
};
|
|
287
|
+
thought?: boolean | null | undefined;
|
|
288
|
+
thoughtSignature?: string | null | undefined;
|
|
289
|
+
} | {
|
|
290
|
+
toolCall: {
|
|
291
|
+
toolType: string;
|
|
292
|
+
id: string;
|
|
293
|
+
args?: unknown;
|
|
294
|
+
};
|
|
295
|
+
thoughtSignature?: string | null | undefined;
|
|
296
|
+
} | {
|
|
297
|
+
toolResponse: {
|
|
298
|
+
toolType: string;
|
|
299
|
+
id: string;
|
|
300
|
+
response?: unknown;
|
|
301
|
+
};
|
|
302
|
+
thoughtSignature?: string | null | undefined;
|
|
303
|
+
} | {
|
|
304
|
+
executableCode?: {
|
|
305
|
+
language: string;
|
|
306
|
+
code: string;
|
|
373
307
|
} | null | undefined;
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
urlRetrievalStatus: string;
|
|
378
|
-
}[] | null | undefined;
|
|
308
|
+
codeExecutionResult?: {
|
|
309
|
+
outcome: string;
|
|
310
|
+
output?: string | null | undefined;
|
|
379
311
|
} | null | undefined;
|
|
312
|
+
text?: string | null | undefined;
|
|
313
|
+
thought?: boolean | null | undefined;
|
|
314
|
+
thoughtSignature?: string | null | undefined;
|
|
315
|
+
})[] | null | undefined;
|
|
316
|
+
} | null | undefined;
|
|
317
|
+
finishReason?: string | null | undefined;
|
|
318
|
+
finishMessage?: string | null | undefined;
|
|
319
|
+
safetyRatings?: {
|
|
320
|
+
category?: string | null | undefined;
|
|
321
|
+
probability?: string | null | undefined;
|
|
322
|
+
probabilityScore?: number | null | undefined;
|
|
323
|
+
severity?: string | null | undefined;
|
|
324
|
+
severityScore?: number | null | undefined;
|
|
325
|
+
blocked?: boolean | null | undefined;
|
|
380
326
|
}[] | null | undefined;
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
}
|
|
327
|
+
groundingMetadata?: {
|
|
328
|
+
webSearchQueries?: string[] | null | undefined;
|
|
329
|
+
imageSearchQueries?: string[] | null | undefined;
|
|
330
|
+
retrievalQueries?: string[] | null | undefined;
|
|
331
|
+
searchEntryPoint?: {
|
|
332
|
+
renderedContent: string;
|
|
333
|
+
} | null | undefined;
|
|
334
|
+
groundingChunks?: {
|
|
335
|
+
web?: {
|
|
336
|
+
uri: string;
|
|
337
|
+
title?: string | null | undefined;
|
|
338
|
+
} | null | undefined;
|
|
339
|
+
image?: {
|
|
340
|
+
sourceUri: string;
|
|
341
|
+
imageUri: string;
|
|
342
|
+
title?: string | null | undefined;
|
|
343
|
+
domain?: string | null | undefined;
|
|
344
|
+
} | null | undefined;
|
|
345
|
+
retrievedContext?: {
|
|
346
|
+
uri?: string | null | undefined;
|
|
347
|
+
title?: string | null | undefined;
|
|
348
|
+
text?: string | null | undefined;
|
|
349
|
+
fileSearchStore?: string | null | undefined;
|
|
350
|
+
} | null | undefined;
|
|
351
|
+
maps?: {
|
|
352
|
+
uri?: string | null | undefined;
|
|
353
|
+
title?: string | null | undefined;
|
|
354
|
+
text?: string | null | undefined;
|
|
355
|
+
placeId?: string | null | undefined;
|
|
356
|
+
} | null | undefined;
|
|
357
|
+
}[] | null | undefined;
|
|
358
|
+
groundingSupports?: {
|
|
359
|
+
segment?: {
|
|
360
|
+
startIndex?: number | null | undefined;
|
|
361
|
+
endIndex?: number | null | undefined;
|
|
362
|
+
text?: string | null | undefined;
|
|
363
|
+
} | null | undefined;
|
|
364
|
+
segment_text?: string | null | undefined;
|
|
365
|
+
groundingChunkIndices?: number[] | null | undefined;
|
|
366
|
+
supportChunkIndices?: number[] | null | undefined;
|
|
367
|
+
confidenceScores?: number[] | null | undefined;
|
|
368
|
+
confidenceScore?: number[] | null | undefined;
|
|
369
|
+
}[] | null | undefined;
|
|
370
|
+
retrievalMetadata?: Record<string, never> | {
|
|
371
|
+
webDynamicRetrievalScore: number;
|
|
372
|
+
} | null | undefined;
|
|
411
373
|
} | null | undefined;
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
probabilityScore?: number | null | undefined;
|
|
418
|
-
severity?: string | null | undefined;
|
|
419
|
-
severityScore?: number | null | undefined;
|
|
420
|
-
blocked?: boolean | null | undefined;
|
|
421
|
-
}[] | null | undefined;
|
|
374
|
+
urlContextMetadata?: {
|
|
375
|
+
urlMetadata?: {
|
|
376
|
+
retrievedUrl: string;
|
|
377
|
+
urlRetrievalStatus: string;
|
|
378
|
+
}[] | null | undefined;
|
|
422
379
|
} | null | undefined;
|
|
380
|
+
}[] | null | undefined;
|
|
381
|
+
usageMetadata?: {
|
|
382
|
+
[x: string]: unknown;
|
|
383
|
+
cachedContentTokenCount?: number | null | undefined;
|
|
384
|
+
thoughtsTokenCount?: number | null | undefined;
|
|
385
|
+
promptTokenCount?: number | null | undefined;
|
|
386
|
+
candidatesTokenCount?: number | null | undefined;
|
|
387
|
+
toolUsePromptTokenCount?: number | null | undefined;
|
|
388
|
+
totalTokenCount?: number | null | undefined;
|
|
389
|
+
trafficType?: string | null | undefined;
|
|
390
|
+
serviceTier?: string | null | undefined;
|
|
391
|
+
promptTokensDetails?: {
|
|
392
|
+
[x: string]: unknown;
|
|
393
|
+
modality: string;
|
|
394
|
+
tokenCount: number;
|
|
395
|
+
}[] | null | undefined;
|
|
396
|
+
cacheTokensDetails?: {
|
|
397
|
+
[x: string]: unknown;
|
|
398
|
+
modality: string;
|
|
399
|
+
tokenCount: number;
|
|
400
|
+
}[] | null | undefined;
|
|
401
|
+
candidatesTokensDetails?: {
|
|
402
|
+
[x: string]: unknown;
|
|
403
|
+
modality: string;
|
|
404
|
+
tokenCount: number;
|
|
405
|
+
}[] | null | undefined;
|
|
406
|
+
toolUsePromptTokensDetails?: {
|
|
407
|
+
[x: string]: unknown;
|
|
408
|
+
modality: string;
|
|
409
|
+
tokenCount: number;
|
|
410
|
+
}[] | null | undefined;
|
|
411
|
+
} | null | undefined;
|
|
412
|
+
promptFeedback?: {
|
|
413
|
+
blockReason?: string | null | undefined;
|
|
414
|
+
safetyRatings?: {
|
|
415
|
+
category?: string | null | undefined;
|
|
416
|
+
probability?: string | null | undefined;
|
|
417
|
+
probabilityScore?: number | null | undefined;
|
|
418
|
+
severity?: string | null | undefined;
|
|
419
|
+
severityScore?: number | null | undefined;
|
|
420
|
+
blocked?: boolean | null | undefined;
|
|
421
|
+
}[] | null | undefined;
|
|
422
|
+
} | null | undefined;
|
|
423
423
|
}>;
|
|
424
424
|
type CandidateSchema = NonNullable<InferSchema<typeof responseSchema>['candidates']>[number];
|
|
425
|
-
type GroundingMetadataSchema = NonNullable<CandidateSchema['groundingMetadata']>;
|
|
426
|
-
type UrlContextMetadataSchema = NonNullable<CandidateSchema['urlContextMetadata']>;
|
|
427
|
-
type SafetyRatingSchema = NonNullable<CandidateSchema['safetyRatings']>[number];
|
|
428
|
-
type PromptFeedbackSchema = NonNullable<InferSchema<typeof responseSchema>['promptFeedback']>;
|
|
429
|
-
type UsageMetadataSchema = NonNullable<InferSchema<typeof responseSchema>['usageMetadata']>;
|
|
430
|
-
|
|
425
|
+
export type GroundingMetadataSchema = NonNullable<CandidateSchema['groundingMetadata']>;
|
|
426
|
+
export type UrlContextMetadataSchema = NonNullable<CandidateSchema['urlContextMetadata']>;
|
|
427
|
+
export type SafetyRatingSchema = NonNullable<CandidateSchema['safetyRatings']>[number];
|
|
428
|
+
export type PromptFeedbackSchema = NonNullable<InferSchema<typeof responseSchema>['promptFeedback']>;
|
|
429
|
+
export type UsageMetadataSchema = NonNullable<InferSchema<typeof responseSchema>['usageMetadata']>;
|
|
430
|
+
//#endregion
|
|
431
|
+
//#region src/google-speech-model-options.d.ts
|
|
431
432
|
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 & {});
|
|
432
|
-
|
|
433
|
+
//#endregion
|
|
434
|
+
//#region src/google-speech-model.d.ts
|
|
433
435
|
interface GoogleSpeechModelConfig {
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
436
|
+
provider: string;
|
|
437
|
+
baseURL: string;
|
|
438
|
+
headers?: Resolvable<Record<string, string | undefined>>;
|
|
439
|
+
fetch?: FetchFunction;
|
|
440
|
+
_internal?: {
|
|
441
|
+
currentDate?: () => Date;
|
|
442
|
+
};
|
|
441
443
|
}
|
|
442
|
-
declare class GoogleSpeechModel implements SpeechModelV4 {
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
444
|
+
export declare class GoogleSpeechModel implements SpeechModelV4 {
|
|
445
|
+
readonly modelId: GoogleSpeechModelId;
|
|
446
|
+
private readonly config;
|
|
447
|
+
readonly specificationVersion = "v4";
|
|
448
|
+
static [WORKFLOW_SERIALIZE](model: GoogleSpeechModel): {
|
|
449
|
+
modelId: string;
|
|
450
|
+
config: import("@ai-sdk/provider").JSONObject;
|
|
451
|
+
};
|
|
452
|
+
static [WORKFLOW_DESERIALIZE](options: {
|
|
453
|
+
modelId: GoogleSpeechModelId;
|
|
454
|
+
config: GoogleSpeechModelConfig;
|
|
455
|
+
}): GoogleSpeechModel;
|
|
456
|
+
get provider(): string;
|
|
457
|
+
constructor(modelId: GoogleSpeechModelId, config: GoogleSpeechModelConfig);
|
|
458
|
+
private getArgs;
|
|
459
|
+
doGenerate(options: Parameters<SpeechModelV4['doGenerate']>[0]): Promise<Awaited<ReturnType<SpeechModelV4['doGenerate']>>>;
|
|
458
460
|
}
|
|
459
|
-
|
|
461
|
+
//#endregion
|
|
462
|
+
//#region src/google-speech-input.d.ts
|
|
460
463
|
/**
|
|
461
464
|
* Inspects speech input without replacing provider option validation. This is
|
|
462
465
|
* also used by intermediaries that need the transcript or voice kind before
|
|
463
466
|
* invoking a model. Model support for structured turns is validated separately.
|
|
464
467
|
*/
|
|
465
|
-
declare function getGoogleSpeechInput({ text, voice, providerOptions
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
468
|
+
export declare function getGoogleSpeechInput({ text, voice, providerOptions }: {
|
|
469
|
+
text: string;
|
|
470
|
+
voice?: string;
|
|
471
|
+
providerOptions?: Record<string, unknown>;
|
|
469
472
|
}): {
|
|
470
|
-
|
|
471
|
-
|
|
473
|
+
text: string;
|
|
474
|
+
usesCustomVoice: boolean;
|
|
472
475
|
};
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
}
|
|
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
|
-
|
|
476
|
+
//#endregion
|
|
477
|
+
//#region src/google-tools.d.ts
|
|
478
|
+
export declare const googleTools: {
|
|
479
|
+
/**
|
|
480
|
+
* Creates a Google search tool that gives Google direct access to real-time web content.
|
|
481
|
+
* Must have name "google_search".
|
|
482
|
+
*/
|
|
483
|
+
googleSearch: import("@ai-sdk/provider-utils").ProviderExecutedToolFactory<{}, {}, {
|
|
484
|
+
[x: string]: unknown;
|
|
485
|
+
searchTypes?: {
|
|
486
|
+
webSearch?: Record<string, never> | undefined;
|
|
487
|
+
imageSearch?: Record<string, never> | undefined;
|
|
488
|
+
} | undefined;
|
|
489
|
+
timeRangeFilter?: {
|
|
490
|
+
startTime: string;
|
|
491
|
+
endTime: string;
|
|
492
|
+
} | undefined;
|
|
493
|
+
}, {}>;
|
|
494
|
+
/**
|
|
495
|
+
* Creates an Enterprise Web Search tool for grounding responses using a compliance-focused web index.
|
|
496
|
+
* Designed for highly-regulated industries (finance, healthcare, public sector).
|
|
497
|
+
* Does not log customer data and supports VPC service controls.
|
|
498
|
+
* Must have name "enterprise_web_search".
|
|
499
|
+
*
|
|
500
|
+
* @note Only available on Vertex AI. Requires Gemini 2.0 or newer.
|
|
501
|
+
*
|
|
502
|
+
* @see https://cloud.google.com/vertex-ai/generative-ai/docs/grounding/web-grounding-enterprise
|
|
503
|
+
*/
|
|
504
|
+
enterpriseWebSearch: import("@ai-sdk/provider-utils").ProviderExecutedToolFactory<{}, {}, {}, {}>;
|
|
505
|
+
/**
|
|
506
|
+
* Creates a Google Maps grounding tool that gives the model access to Google Maps data.
|
|
507
|
+
* Must have name "google_maps".
|
|
508
|
+
*
|
|
509
|
+
* @see https://ai.google.dev/gemini-api/docs/maps-grounding
|
|
510
|
+
* @see https://cloud.google.com/vertex-ai/generative-ai/docs/grounding/grounding-with-google-maps
|
|
511
|
+
*/
|
|
512
|
+
googleMaps: import("@ai-sdk/provider-utils").ProviderExecutedToolFactory<{}, {}, {}, {}>;
|
|
513
|
+
/**
|
|
514
|
+
* Creates a URL context tool that gives Google direct access to real-time web content.
|
|
515
|
+
* Must have name "url_context".
|
|
516
|
+
*/
|
|
517
|
+
urlContext: import("@ai-sdk/provider-utils").ProviderExecutedToolFactory<{}, {}, {}, {}>;
|
|
518
|
+
/**
|
|
519
|
+
* Enables Retrieval Augmented Generation (RAG) via the Gemini File Search tool.
|
|
520
|
+
* Must have name "file_search".
|
|
521
|
+
*
|
|
522
|
+
* @param fileSearchStoreNames - Fully-qualified File Search store resource names.
|
|
523
|
+
* @param metadataFilter - Optional filter expression to restrict the files that can be retrieved.
|
|
524
|
+
* @param topK - Optional result limit for the number of chunks returned from File Search.
|
|
525
|
+
*
|
|
526
|
+
* @see https://ai.google.dev/gemini-api/docs/file-search
|
|
527
|
+
*/
|
|
528
|
+
fileSearch: import("@ai-sdk/provider-utils").ProviderExecutedToolFactory<{}, {}, {
|
|
529
|
+
[x: string]: unknown;
|
|
530
|
+
fileSearchStoreNames: string[];
|
|
531
|
+
topK?: number | undefined;
|
|
532
|
+
metadataFilter?: string | undefined;
|
|
533
|
+
}, {}>;
|
|
534
|
+
/**
|
|
535
|
+
* A tool that enables the model to generate and run Python code.
|
|
536
|
+
* Must have name "code_execution".
|
|
537
|
+
*
|
|
538
|
+
* @note Ensure the selected model supports Code Execution.
|
|
539
|
+
* Multi-tool usage with the code execution tool is typically compatible with Gemini >=2 models.
|
|
540
|
+
*
|
|
541
|
+
* @see https://ai.google.dev/gemini-api/docs/code-execution (Google AI)
|
|
542
|
+
* @see https://cloud.google.com/vertex-ai/generative-ai/docs/model-reference/code-execution-api (Vertex AI)
|
|
543
|
+
*/
|
|
544
|
+
codeExecution: import("@ai-sdk/provider-utils").ProviderExecutedToolFactory<{
|
|
545
|
+
language: string;
|
|
546
|
+
code: string;
|
|
547
|
+
}, {
|
|
548
|
+
outcome: string;
|
|
549
|
+
output: string;
|
|
550
|
+
}, {}, {}>;
|
|
551
|
+
/**
|
|
552
|
+
* Creates a Vertex RAG Store tool that enables the model to perform RAG searches against a Vertex RAG Store.
|
|
553
|
+
* Must have name "vertex_rag_store".
|
|
554
|
+
*/
|
|
555
|
+
vertexRagStore: import("@ai-sdk/provider-utils").ProviderExecutedToolFactory<{}, {}, {
|
|
556
|
+
ragCorpus: string;
|
|
557
|
+
topK?: number;
|
|
558
|
+
}, {}>;
|
|
555
559
|
};
|
|
556
|
-
|
|
560
|
+
//#endregion
|
|
561
|
+
//#region src/interactions/google-interactions-language-model-options.d.ts
|
|
557
562
|
/**
|
|
558
563
|
* Type-only union of Gemini model IDs that the Interactions API accepts via
|
|
559
564
|
* `model:`. Mirrors `Model` from `googleapis/js-genai`
|
|
@@ -564,48 +569,50 @@ declare const googleTools: {
|
|
|
564
569
|
* may diverge over time.
|
|
565
570
|
*/
|
|
566
571
|
type GoogleInteractionsModelId = 'gemini-2.5-computer-use-preview-10-2025' | 'gemini-2.5-flash' | 'gemini-2.5-flash-image' | 'gemini-2.5-flash-lite' | 'gemini-2.5-flash-lite-preview-09-2025' | 'gemini-2.5-flash-native-audio-preview-12-2025' | 'gemini-2.5-flash-preview-09-2025' | 'gemini-2.5-flash-preview-tts' | 'gemini-2.5-pro' | 'gemini-2.5-pro-preview-tts' | 'gemini-3-flash-preview' | 'gemini-3-pro-image-preview' | 'gemini-3-pro-preview' | 'gemini-3.1-pro-preview' | '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' | 'lyria-3-clip-preview' | 'lyria-3-pro-preview' | (string & {});
|
|
567
|
-
|
|
572
|
+
//#endregion
|
|
573
|
+
//#region src/interactions/google-interactions-language-model.d.ts
|
|
568
574
|
type GoogleInteractionsConfig = {
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
+
provider: string;
|
|
576
|
+
baseURL: string;
|
|
577
|
+
headers?: Resolvable<Record<string, string | undefined>>;
|
|
578
|
+
fetch?: FetchFunction;
|
|
579
|
+
generateId: () => string;
|
|
580
|
+
supportedUrls?: () => LanguageModelV4['supportedUrls'];
|
|
575
581
|
};
|
|
576
582
|
type GoogleInteractionsModelInput = GoogleInteractionsModelId | {
|
|
577
|
-
|
|
583
|
+
agent: string;
|
|
578
584
|
} | {
|
|
579
|
-
|
|
585
|
+
managedAgent: string;
|
|
580
586
|
};
|
|
581
|
-
declare class GoogleInteractionsLanguageModel implements LanguageModelV4 {
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
587
|
+
export declare class GoogleInteractionsLanguageModel implements LanguageModelV4 {
|
|
588
|
+
readonly specificationVersion = "v4";
|
|
589
|
+
readonly modelId: string;
|
|
590
|
+
/**
|
|
591
|
+
* Optional agent name. When provided, the request body sends `agent:` instead
|
|
592
|
+
* of `model:` and rejects `generation_config` (warned, not thrown).
|
|
593
|
+
*/
|
|
594
|
+
readonly agent: string | undefined;
|
|
595
|
+
private readonly config;
|
|
596
|
+
static [WORKFLOW_SERIALIZE](model: GoogleInteractionsLanguageModel): {
|
|
597
|
+
agent: string | undefined;
|
|
598
|
+
modelId: string;
|
|
599
|
+
config: import("@ai-sdk/provider").JSONObject;
|
|
600
|
+
};
|
|
601
|
+
static [WORKFLOW_DESERIALIZE](options: {
|
|
602
|
+
modelId: string;
|
|
603
|
+
agent?: string;
|
|
604
|
+
config: GoogleInteractionsConfig;
|
|
605
|
+
}): GoogleInteractionsLanguageModel;
|
|
606
|
+
constructor(modelOrAgent: GoogleInteractionsModelInput, config: GoogleInteractionsConfig);
|
|
607
|
+
get provider(): string;
|
|
608
|
+
get supportedUrls(): Record<string, RegExp[]> | PromiseLike<Record<string, RegExp[]>>;
|
|
609
|
+
private getArgs;
|
|
610
|
+
doGenerate(options: LanguageModelV4CallOptions): Promise<LanguageModelV4GenerateResult>;
|
|
611
|
+
doStream(options: LanguageModelV4CallOptions): Promise<LanguageModelV4StreamResult>;
|
|
612
|
+
private doStreamBackground;
|
|
607
613
|
}
|
|
608
|
-
|
|
614
|
+
//#endregion
|
|
615
|
+
//#region src/interactions/google-interactions-agent.d.ts
|
|
609
616
|
/**
|
|
610
617
|
* Type-only module: declares the union of supported Gemini Interactions agent
|
|
611
618
|
* names. Used by the `google.interactions({ agent })` factory branch.
|
|
@@ -616,5 +623,6 @@ declare class GoogleInteractionsLanguageModel implements LanguageModelV4 {
|
|
|
616
623
|
* `GoogleInteractionsModelInput`.
|
|
617
624
|
*/
|
|
618
625
|
type GoogleInteractionsAgentName = 'deep-research-pro-preview-12-2025' | 'deep-research-preview-04-2026' | 'deep-research-max-preview-04-2026' | 'antigravity-preview-05-2026';
|
|
619
|
-
|
|
620
|
-
export {
|
|
626
|
+
//#endregion
|
|
627
|
+
export type { GoogleInteractionsAgentName, GoogleInteractionsModelId, GoogleInteractionsModelInput, GoogleModelId };
|
|
628
|
+
//# sourceMappingURL=index.d.ts.map
|