@ai-sdk/google-vertex 5.0.98 → 5.0.99
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 +13 -0
- package/dist/anthropic/edge/index.d.ts +84 -80
- package/dist/anthropic/edge/index.d.ts.map +1 -0
- package/dist/anthropic/edge/index.js +232 -272
- package/dist/anthropic/edge/index.js.map +1 -1
- package/dist/anthropic/index.d.ts +69 -66
- package/dist/anthropic/index.d.ts.map +1 -0
- package/dist/anthropic/index.js +166 -177
- package/dist/anthropic/index.js.map +1 -1
- package/dist/edge/index.d.ts +206 -194
- package/dist/edge/index.d.ts.map +1 -0
- package/dist/edge/index.js +1408 -1846
- package/dist/edge/index.js.map +1 -1
- package/dist/index.d.ts +265 -252
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +1349 -1761
- package/dist/index.js.map +1 -1
- package/dist/maas/edge/index.d.ts +62 -59
- package/dist/maas/edge/index.d.ts.map +1 -0
- package/dist/maas/edge/index.js +166 -196
- package/dist/maas/edge/index.js.map +1 -1
- package/dist/maas/index.d.ts +47 -45
- package/dist/maas/index.d.ts.map +1 -0
- package/dist/maas/index.js +101 -102
- package/dist/maas/index.js.map +1 -1
- package/dist/xai/edge/index.d.ts +77 -73
- package/dist/xai/edge/index.d.ts.map +1 -0
- package/dist/xai/edge/index.js +203 -235
- package/dist/xai/edge/index.js.map +1 -1
- package/dist/xai/index.d.ts +62 -59
- package/dist/xai/index.d.ts.map +1 -0
- package/dist/xai/index.js +138 -141
- package/dist/xai/index.js.map +1 -1
- package/docs/16-google-vertex.mdx +3 -3
- package/package.json +11 -11
package/dist/index.d.ts
CHANGED
|
@@ -1,246 +1,256 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
import { Resolvable, FetchFunction, WORKFLOW_SERIALIZE, WORKFLOW_DESERIALIZE, WebSocketConstructor } from '@ai-sdk/provider-utils';
|
|
9
|
-
|
|
1
|
+
import { FetchFunction, Resolvable, WORKFLOW_DESERIALIZE, WORKFLOW_SERIALIZE, WebSocketConstructor } from "@ai-sdk/provider-utils";
|
|
2
|
+
import { GoogleAuthOptions } from "google-auth-library";
|
|
3
|
+
import { GoogleInteractionsAgentName, GoogleInteractionsModelId } from "@ai-sdk/google/internal";
|
|
4
|
+
import { EmbeddingModelV4, Experimental_TranscriptionModelV4StreamOptions, Experimental_VideoModelV4, ImageModelV4, JSONObject, LanguageModelV4, ProviderV4, SpeechModelV4, TranscriptionModelV4 } from "@ai-sdk/provider";
|
|
5
|
+
import { z } from "zod/v4";
|
|
6
|
+
import { GoogleLanguageModelOptions, GoogleSpeechModelOptions } from "@ai-sdk/google";
|
|
7
|
+
//#region src/google-vertex-embedding-model-options.d.ts
|
|
10
8
|
type GoogleVertexEmbeddingModelId = 'textembedding-gecko' | 'textembedding-gecko@001' | 'textembedding-gecko@003' | 'textembedding-gecko-multilingual' | 'textembedding-gecko-multilingual@001' | 'text-multilingual-embedding-002' | 'text-embedding-004' | 'text-embedding-005' | 'gemini-embedding-001' | 'gemini-embedding-2' | 'gemini-embedding-2-preview' | (string & {});
|
|
11
9
|
declare const googleVertexEmbeddingModelOptions: z.ZodObject<{
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
10
|
+
outputDimensionality: z.ZodOptional<z.ZodNumber>;
|
|
11
|
+
taskType: z.ZodOptional<z.ZodEnum<{
|
|
12
|
+
SEMANTIC_SIMILARITY: "SEMANTIC_SIMILARITY";
|
|
13
|
+
CLASSIFICATION: "CLASSIFICATION";
|
|
14
|
+
CLUSTERING: "CLUSTERING";
|
|
15
|
+
RETRIEVAL_DOCUMENT: "RETRIEVAL_DOCUMENT";
|
|
16
|
+
RETRIEVAL_QUERY: "RETRIEVAL_QUERY";
|
|
17
|
+
QUESTION_ANSWERING: "QUESTION_ANSWERING";
|
|
18
|
+
FACT_VERIFICATION: "FACT_VERIFICATION";
|
|
19
|
+
CODE_RETRIEVAL_QUERY: "CODE_RETRIEVAL_QUERY";
|
|
20
|
+
}>>;
|
|
21
|
+
title: z.ZodOptional<z.ZodString>;
|
|
22
|
+
autoTruncate: z.ZodOptional<z.ZodBoolean>;
|
|
25
23
|
}, z.core.$strip>;
|
|
26
24
|
type GoogleVertexEmbeddingModelOptions = z.infer<typeof googleVertexEmbeddingModelOptions>;
|
|
27
|
-
|
|
25
|
+
//#endregion
|
|
26
|
+
//#region src/google-vertex-transcription-model-options.d.ts
|
|
28
27
|
type GoogleVertexTranscriptionModelId = 'chirp_2' | 'chirp_3' | 'telephony' | (string & {});
|
|
29
28
|
declare const googleVertexTranscriptionProviderOptionsSchema: z.ZodObject<{
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
29
|
+
languageCodes: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
30
|
+
enableAutomaticPunctuation: z.ZodOptional<z.ZodBoolean>;
|
|
31
|
+
enableWordTimeOffsets: z.ZodOptional<z.ZodBoolean>;
|
|
32
|
+
region: z.ZodOptional<z.ZodString>;
|
|
34
33
|
}, z.core.$strip>;
|
|
35
34
|
type GoogleVertexTranscriptionModelOptions = z.infer<typeof googleVertexTranscriptionProviderOptionsSchema>;
|
|
36
|
-
|
|
35
|
+
//#endregion
|
|
36
|
+
//#region src/google-vertex-image-model-options.d.ts
|
|
37
37
|
type GoogleVertexImageModelOptions = Omit<GoogleLanguageModelOptions, 'responseModalities'>;
|
|
38
|
-
|
|
38
|
+
//#endregion
|
|
39
|
+
//#region src/google-vertex-video-model-options.d.ts
|
|
39
40
|
type GoogleVertexVideoModelOptions = {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
41
|
+
pollIntervalMs?: number | null;
|
|
42
|
+
pollTimeoutMs?: number | null;
|
|
43
|
+
personGeneration?: 'dont_allow' | 'allow_adult' | 'allow_all' | null;
|
|
44
|
+
negativePrompt?: string | null;
|
|
45
|
+
generateAudio?: boolean | null;
|
|
46
|
+
gcsOutputDirectory?: string | null;
|
|
47
|
+
referenceImages?: Array<{
|
|
48
|
+
bytesBase64Encoded?: string;
|
|
49
|
+
gcsUri?: string;
|
|
50
|
+
}> | null;
|
|
51
|
+
[key: string]: unknown;
|
|
51
52
|
};
|
|
52
|
-
|
|
53
|
+
//#endregion
|
|
54
|
+
//#region src/google-vertex-video-settings.d.ts
|
|
53
55
|
type GoogleVertexVideoModelId = 'veo-2.0-generate-preview' | 'veo-2.0-generate-exp' | 'veo-2.0-generate-001' | 'veo-3.0-generate-001' | 'veo-3.0-fast-generate-001' | 'veo-3.0-generate-preview' | 'veo-3.0-fast-generate-preview' | 'veo-3.1-generate-001' | 'veo-3.1-fast-generate-001' | 'veo-3.1-generate-preview' | 'veo-3.1-fast-generate-preview' | (string & {});
|
|
54
|
-
|
|
56
|
+
//#endregion
|
|
57
|
+
//#region src/google-vertex-speech-model-options.d.ts
|
|
55
58
|
type GoogleVertexSpeechModelId = 'gemini-2.5-flash-tts' | 'gemini-2.5-pro-tts' | 'gemini-2.5-flash-lite-preview-tts' | 'gemini-3.1-flash-tts-preview' | 'chirp-3-hd' | (string & {});
|
|
56
59
|
type GoogleVertexSpeechModelOptions = GoogleSpeechModelOptions;
|
|
57
|
-
|
|
60
|
+
//#endregion
|
|
61
|
+
//#region src/google-vertex-config.d.ts
|
|
58
62
|
interface GoogleVertexConfig {
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
+
provider: string;
|
|
64
|
+
baseURL: string;
|
|
65
|
+
headers?: Resolvable<Record<string, string | undefined>>;
|
|
66
|
+
fetch?: FetchFunction;
|
|
63
67
|
}
|
|
64
|
-
|
|
68
|
+
//#endregion
|
|
69
|
+
//#region src/google-vertex-embedding-model.d.ts
|
|
65
70
|
declare class GoogleVertexEmbeddingModel implements EmbeddingModelV4 {
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
71
|
+
readonly specificationVersion = "v4";
|
|
72
|
+
readonly modelId: GoogleVertexEmbeddingModelId;
|
|
73
|
+
readonly supportsParallelCalls = true;
|
|
74
|
+
private readonly config;
|
|
75
|
+
static [WORKFLOW_SERIALIZE](model: GoogleVertexEmbeddingModel): {
|
|
76
|
+
modelId: string;
|
|
77
|
+
config: import("@ai-sdk/provider").JSONObject;
|
|
78
|
+
};
|
|
79
|
+
static [WORKFLOW_DESERIALIZE](options: {
|
|
80
|
+
modelId: string;
|
|
81
|
+
config: GoogleVertexConfig;
|
|
82
|
+
}): GoogleVertexEmbeddingModel;
|
|
83
|
+
get provider(): string;
|
|
84
|
+
get maxEmbeddingsPerCall(): number;
|
|
85
|
+
constructor(modelId: GoogleVertexEmbeddingModelId, config: GoogleVertexConfig);
|
|
86
|
+
doEmbed({ values, headers, abortSignal, providerOptions }: Parameters<EmbeddingModelV4['doEmbed']>[0]): Promise<Awaited<ReturnType<EmbeddingModelV4['doEmbed']>>>;
|
|
82
87
|
}
|
|
83
|
-
|
|
88
|
+
//#endregion
|
|
89
|
+
//#region src/google-vertex-image-settings.d.ts
|
|
84
90
|
type GoogleVertexImageModelId = 'gemini-2.5-flash-image' | 'gemini-3-pro-image-preview' | 'gemini-3.1-flash-image-preview' | (string & {});
|
|
85
|
-
|
|
91
|
+
//#endregion
|
|
92
|
+
//#region src/google-vertex-options.d.ts
|
|
86
93
|
type GoogleVertexModelId = 'gemini-3.8-flash' | 'gemini-3.7-flash' | 'gemini-3.6-flash' | 'gemini-3.5-flash' | 'gemini-3.5-flash-lite' | 'gemini-2.5-pro' | 'gemini-2.5-flash' | 'gemini-2.5-flash-lite' | 'gemini-2.0-flash-lite' | 'gemini-2.0-flash' | 'gemini-2.0-flash-001' | 'gemini-1.5-flash' | 'gemini-1.5-flash-001' | 'gemini-1.5-flash-002' | 'gemini-1.5-pro' | 'gemini-1.5-pro-001' | 'gemini-1.5-pro-002' | 'gemini-1.0-pro-001' | 'gemini-1.0-pro-vision-001' | 'gemini-1.0-pro' | 'gemini-1.0-pro-002' | 'gemini-2.0-flash-lite-preview-02-05' | 'gemini-2.5-flash-preview-09-2025' | 'gemini-3-pro-preview' | 'gemini-3-pro-image-preview' | 'gemini-3-flash-preview' | 'gemini-3.1-pro-preview' | 'gemini-3.1-flash-image-preview' | 'gemini-3.1-flash-lite-preview' | 'gemini-2.0-pro-exp-02-05' | 'gemini-2.0-flash-exp' | (string & {});
|
|
87
|
-
|
|
94
|
+
//#endregion
|
|
95
|
+
//#region src/google-vertex-tools.d.ts
|
|
88
96
|
declare const googleVertexTools: {
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
97
|
+
googleSearch: import("@ai-sdk/provider-utils").ProviderExecutedToolFactory<{}, {}, {
|
|
98
|
+
[x: string]: unknown;
|
|
99
|
+
searchTypes?: {
|
|
100
|
+
webSearch?: Record<string, never> | undefined;
|
|
101
|
+
imageSearch?: Record<string, never> | undefined;
|
|
102
|
+
} | undefined;
|
|
103
|
+
timeRangeFilter?: {
|
|
104
|
+
startTime: string;
|
|
105
|
+
endTime: string;
|
|
106
|
+
} | undefined;
|
|
107
|
+
}, {}>;
|
|
108
|
+
enterpriseWebSearch: import("@ai-sdk/provider-utils").ProviderExecutedToolFactory<{}, {}, {}, {}>;
|
|
109
|
+
googleMaps: import("@ai-sdk/provider-utils").ProviderExecutedToolFactory<{}, {}, {}, {}>;
|
|
110
|
+
urlContext: import("@ai-sdk/provider-utils").ProviderExecutedToolFactory<{}, {}, {}, {}>;
|
|
111
|
+
fileSearch: import("@ai-sdk/provider-utils").ProviderExecutedToolFactory<{}, {}, {
|
|
112
|
+
[x: string]: unknown;
|
|
113
|
+
fileSearchStoreNames: string[];
|
|
114
|
+
topK?: number | undefined;
|
|
115
|
+
metadataFilter?: string | undefined;
|
|
116
|
+
}, {}>;
|
|
117
|
+
codeExecution: import("@ai-sdk/provider-utils").ProviderExecutedToolFactory<{
|
|
118
|
+
language: string;
|
|
119
|
+
code: string;
|
|
120
|
+
}, {
|
|
121
|
+
outcome: string;
|
|
122
|
+
output: string;
|
|
123
|
+
}, {}, {}>;
|
|
124
|
+
vertexRagStore: import("@ai-sdk/provider-utils").ProviderExecutedToolFactory<{}, {}, {
|
|
125
|
+
ragCorpus: string;
|
|
126
|
+
topK?: number;
|
|
127
|
+
}, {}>;
|
|
120
128
|
};
|
|
121
|
-
|
|
129
|
+
//#endregion
|
|
130
|
+
//#region src/google-vertex-provider-base.d.ts
|
|
122
131
|
interface GoogleVertexProvider extends ProviderV4 {
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
132
|
+
/**
|
|
133
|
+
* Creates a model for text generation.
|
|
134
|
+
*/
|
|
135
|
+
(modelId: GoogleVertexModelId): LanguageModelV4;
|
|
136
|
+
languageModel: (modelId: GoogleVertexModelId) => LanguageModelV4;
|
|
137
|
+
/**
|
|
138
|
+
* Creates a language model targeting the Gemini Interactions API
|
|
139
|
+
* (`.../locations/{region}/interactions`) on Vertex, reusing the Vertex
|
|
140
|
+
* OAuth credentials. Pass a model id (e.g. `gemini-omni-flash-preview`) or an
|
|
141
|
+
* `{ agent }` / `{ managedAgent }` reference.
|
|
142
|
+
*/
|
|
143
|
+
interactions(modelIdOrAgent: GoogleInteractionsModelId | {
|
|
144
|
+
agent: GoogleInteractionsAgentName;
|
|
145
|
+
} | {
|
|
146
|
+
managedAgent: string;
|
|
147
|
+
}): LanguageModelV4;
|
|
148
|
+
/**
|
|
149
|
+
* Creates a model for image generation.
|
|
150
|
+
*/
|
|
151
|
+
image(modelId: GoogleVertexImageModelId): ImageModelV4;
|
|
152
|
+
/**
|
|
153
|
+
* Creates a model for image generation.
|
|
154
|
+
*/
|
|
155
|
+
imageModel(modelId: GoogleVertexImageModelId): ImageModelV4;
|
|
156
|
+
tools: typeof googleVertexTools;
|
|
157
|
+
/**
|
|
158
|
+
* @deprecated Use `embeddingModel` instead.
|
|
159
|
+
*/
|
|
160
|
+
textEmbeddingModel(modelId: GoogleVertexEmbeddingModelId): GoogleVertexEmbeddingModel;
|
|
161
|
+
/**
|
|
162
|
+
* Creates a model for video generation.
|
|
163
|
+
*/
|
|
164
|
+
video(modelId: GoogleVertexVideoModelId): Experimental_VideoModelV4;
|
|
165
|
+
/**
|
|
166
|
+
* Creates a model for video generation.
|
|
167
|
+
*/
|
|
168
|
+
videoModel(modelId: GoogleVertexVideoModelId): Experimental_VideoModelV4;
|
|
169
|
+
/**
|
|
170
|
+
* Creates a model for speech generation (text-to-speech).
|
|
171
|
+
*/
|
|
172
|
+
speech(modelId: GoogleVertexSpeechModelId): SpeechModelV4;
|
|
173
|
+
/**
|
|
174
|
+
* Creates a model for speech generation (text-to-speech).
|
|
175
|
+
*/
|
|
176
|
+
speechModel(modelId: GoogleVertexSpeechModelId): SpeechModelV4;
|
|
177
|
+
/**
|
|
178
|
+
* Creates a model for transcription (speech-to-text).
|
|
179
|
+
*/
|
|
180
|
+
transcription(modelId: GoogleVertexTranscriptionModelId): TranscriptionModelV4;
|
|
181
|
+
/**
|
|
182
|
+
* Creates a model for transcription (speech-to-text).
|
|
183
|
+
*/
|
|
184
|
+
transcriptionModel(modelId: GoogleVertexTranscriptionModelId): TranscriptionModelV4;
|
|
176
185
|
}
|
|
177
186
|
interface GoogleVertexProviderSettings$1 {
|
|
187
|
+
/**
|
|
188
|
+
* Optional. The API key for the Google Cloud project. If provided, the
|
|
189
|
+
* provider will use express mode with API key authentication. Defaults to
|
|
190
|
+
* the value of the `GOOGLE_VERTEX_API_KEY` environment variable.
|
|
191
|
+
*/
|
|
192
|
+
apiKey?: string;
|
|
193
|
+
/**
|
|
194
|
+
* Your Google Vertex location. Defaults to the environment variable `GOOGLE_VERTEX_LOCATION`.
|
|
195
|
+
*/
|
|
196
|
+
location?: string;
|
|
197
|
+
/**
|
|
198
|
+
* Your Google Vertex project. Defaults to the environment variable `GOOGLE_VERTEX_PROJECT`.
|
|
199
|
+
*/
|
|
200
|
+
project?: string;
|
|
201
|
+
/**
|
|
202
|
+
* Headers to use for requests. Can be:
|
|
203
|
+
* - A headers object
|
|
204
|
+
* - A Promise that resolves to a headers object
|
|
205
|
+
* - A function that returns a headers object
|
|
206
|
+
* - A function that returns a Promise of a headers object
|
|
207
|
+
*/
|
|
208
|
+
headers?: Resolvable<Record<string, string | undefined>>;
|
|
209
|
+
/**
|
|
210
|
+
* Custom fetch implementation. You can use it as a middleware to intercept requests,
|
|
211
|
+
* or to provide a custom fetch implementation for e.g. testing.
|
|
212
|
+
*/
|
|
213
|
+
fetch?: FetchFunction;
|
|
214
|
+
generateId?: () => string;
|
|
215
|
+
/**
|
|
216
|
+
* Base URL for the Google Vertex API calls.
|
|
217
|
+
*/
|
|
218
|
+
baseURL?: string;
|
|
219
|
+
/**
|
|
220
|
+
* Custom WebSocket implementation for streaming transcription. Useful for
|
|
221
|
+
* runtimes that need a WebSocket constructor with header support (e.g. the
|
|
222
|
+
* `ws` package in Node.js, which Vertex's OAuth Bearer header requires).
|
|
223
|
+
*/
|
|
224
|
+
webSocket?: WebSocketConstructor;
|
|
225
|
+
/**
|
|
226
|
+
* Settings for downloading remote files in tool results before sending them
|
|
227
|
+
* to Vertex as inline data.
|
|
228
|
+
*/
|
|
229
|
+
toolResultDownloads?: {
|
|
178
230
|
/**
|
|
179
|
-
*
|
|
180
|
-
* provider will use express mode with API key authentication. Defaults to
|
|
181
|
-
* the value of the `GOOGLE_VERTEX_API_KEY` environment variable.
|
|
182
|
-
*/
|
|
183
|
-
apiKey?: string;
|
|
184
|
-
/**
|
|
185
|
-
* Your Google Vertex location. Defaults to the environment variable `GOOGLE_VERTEX_LOCATION`.
|
|
231
|
+
* Maximum size in bytes for each downloaded file. Defaults to 7 MiB.
|
|
186
232
|
*/
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
* Your Google Vertex project. Defaults to the environment variable `GOOGLE_VERTEX_PROJECT`.
|
|
190
|
-
*/
|
|
191
|
-
project?: string;
|
|
192
|
-
/**
|
|
193
|
-
* Headers to use for requests. Can be:
|
|
194
|
-
* - A headers object
|
|
195
|
-
* - A Promise that resolves to a headers object
|
|
196
|
-
* - A function that returns a headers object
|
|
197
|
-
* - A function that returns a Promise of a headers object
|
|
198
|
-
*/
|
|
199
|
-
headers?: Resolvable<Record<string, string | undefined>>;
|
|
200
|
-
/**
|
|
201
|
-
* Custom fetch implementation. You can use it as a middleware to intercept requests,
|
|
202
|
-
* or to provide a custom fetch implementation for e.g. testing.
|
|
203
|
-
*/
|
|
204
|
-
fetch?: FetchFunction;
|
|
205
|
-
generateId?: () => string;
|
|
206
|
-
/**
|
|
207
|
-
* Base URL for the Google Vertex API calls.
|
|
208
|
-
*/
|
|
209
|
-
baseURL?: string;
|
|
210
|
-
/**
|
|
211
|
-
* Custom WebSocket implementation for streaming transcription. Useful for
|
|
212
|
-
* runtimes that need a WebSocket constructor with header support (e.g. the
|
|
213
|
-
* `ws` package in Node.js, which Vertex's OAuth Bearer header requires).
|
|
214
|
-
*/
|
|
215
|
-
webSocket?: WebSocketConstructor;
|
|
216
|
-
/**
|
|
217
|
-
* Settings for downloading remote files in tool results before sending them
|
|
218
|
-
* to Vertex as inline data.
|
|
219
|
-
*/
|
|
220
|
-
toolResultDownloads?: {
|
|
221
|
-
/**
|
|
222
|
-
* Maximum size in bytes for each downloaded file. Defaults to 7 MiB.
|
|
223
|
-
*/
|
|
224
|
-
maxBytes?: number;
|
|
225
|
-
};
|
|
233
|
+
maxBytes?: number;
|
|
234
|
+
};
|
|
226
235
|
}
|
|
227
|
-
|
|
236
|
+
//#endregion
|
|
237
|
+
//#region src/google-vertex-provider.d.ts
|
|
228
238
|
interface GoogleVertexProviderSettings extends GoogleVertexProviderSettings$1 {
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
239
|
+
/**
|
|
240
|
+
* Optional. The Authentication options provided by google-auth-library.
|
|
241
|
+
* Complete list of authentication options is documented in the
|
|
242
|
+
* GoogleAuthOptions interface:
|
|
243
|
+
* https://github.com/googleapis/google-auth-library-nodejs/blob/main/src/auth/googleauth.ts.
|
|
244
|
+
*/
|
|
245
|
+
googleAuthOptions?: GoogleAuthOptions;
|
|
236
246
|
}
|
|
237
|
-
|
|
238
|
-
declare function createGoogleVertex(options?: GoogleVertexProviderSettings): GoogleVertexProvider;
|
|
247
|
+
export declare function createGoogleVertex(options?: GoogleVertexProviderSettings): GoogleVertexProvider;
|
|
239
248
|
/**
|
|
240
249
|
* Default Google Vertex AI provider instance.
|
|
241
250
|
*/
|
|
242
|
-
declare const googleVertex: GoogleVertexProvider;
|
|
243
|
-
|
|
251
|
+
export declare const googleVertex: GoogleVertexProvider;
|
|
252
|
+
//#endregion
|
|
253
|
+
//#region src/gemini-transcription/google-vertex-gemini-transcription-model-options.d.ts
|
|
244
254
|
type GoogleVertexGeminiTranscriptionModelId = 'gemini-3.5-transcribe' | 'gemini-3.5-transcribe-live' | (string & {});
|
|
245
255
|
/**
|
|
246
256
|
* Speech recognition options for Gemini transcription models on Vertex,
|
|
@@ -249,30 +259,31 @@ type GoogleVertexGeminiTranscriptionModelId = 'gemini-3.5-transcribe' | 'gemini-
|
|
|
249
259
|
* `AudioTranscriptionConfig`.
|
|
250
260
|
*/
|
|
251
261
|
declare const googleVertexGeminiTranscriptionModelOptions: z.ZodObject<{
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
262
|
+
languageCodes: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
263
|
+
customVocabulary: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
264
|
+
wordTimestamp: z.ZodOptional<z.ZodBoolean>;
|
|
265
|
+
diarization: z.ZodOptional<z.ZodBoolean>;
|
|
266
|
+
mode: z.ZodOptional<z.ZodEnum<{
|
|
267
|
+
SMART: "SMART";
|
|
268
|
+
VERBATIM: "VERBATIM";
|
|
269
|
+
}>>;
|
|
260
270
|
}, z.core.$strip>;
|
|
261
271
|
type GoogleVertexTranscriptionModelGeminiOptions = z.infer<typeof googleVertexGeminiTranscriptionModelOptions>;
|
|
262
|
-
|
|
272
|
+
//#endregion
|
|
273
|
+
//#region src/gemini-transcription/google-vertex-gemini-transcription-model.d.ts
|
|
263
274
|
interface GoogleVertexGeminiTranscriptionModelConfig {
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
275
|
+
provider: string;
|
|
276
|
+
/** Regional base URL ending in `/publishers/google`. */
|
|
277
|
+
baseURL: string;
|
|
278
|
+
headers?: Resolvable<Record<string, string | undefined>>;
|
|
279
|
+
fetch?: FetchFunction;
|
|
280
|
+
webSocket?: WebSocketConstructor;
|
|
281
|
+
project: string;
|
|
282
|
+
location: string;
|
|
283
|
+
_internal?: {
|
|
284
|
+
currentDate?: () => Date;
|
|
285
|
+
finishGraceMs?: number;
|
|
286
|
+
};
|
|
276
287
|
}
|
|
277
288
|
/**
|
|
278
289
|
* Gemini transcription on Vertex AI. Unary variants transcribe via
|
|
@@ -280,25 +291,27 @@ interface GoogleVertexGeminiTranscriptionModelConfig {
|
|
|
280
291
|
* (`LlmBidiService/BidiGenerateContent`) with OAuth Bearer authentication
|
|
281
292
|
* from the provider's resolved headers.
|
|
282
293
|
*/
|
|
283
|
-
declare class GoogleVertexGeminiTranscriptionModel implements TranscriptionModelV4 {
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
294
|
+
export declare class GoogleVertexGeminiTranscriptionModel implements TranscriptionModelV4 {
|
|
295
|
+
readonly modelId: GoogleVertexGeminiTranscriptionModelId;
|
|
296
|
+
private readonly config;
|
|
297
|
+
readonly specificationVersion = "v4";
|
|
298
|
+
static [WORKFLOW_SERIALIZE](model: GoogleVertexGeminiTranscriptionModel): {
|
|
299
|
+
modelId: string;
|
|
300
|
+
config: JSONObject;
|
|
301
|
+
};
|
|
302
|
+
static [WORKFLOW_DESERIALIZE](options: {
|
|
303
|
+
modelId: GoogleVertexGeminiTranscriptionModelId;
|
|
304
|
+
config: GoogleVertexGeminiTranscriptionModelConfig;
|
|
305
|
+
}): GoogleVertexGeminiTranscriptionModel;
|
|
306
|
+
get provider(): string;
|
|
307
|
+
constructor(modelId: GoogleVertexGeminiTranscriptionModelId, config: GoogleVertexGeminiTranscriptionModelConfig);
|
|
308
|
+
private parseOptions;
|
|
309
|
+
doGenerate(options: Parameters<TranscriptionModelV4['doGenerate']>[0]): Promise<Awaited<ReturnType<TranscriptionModelV4['doGenerate']>>>;
|
|
310
|
+
doStream(options: Experimental_TranscriptionModelV4StreamOptions): Promise<Awaited<ReturnType<NonNullable<TranscriptionModelV4['doStream']>>>>;
|
|
300
311
|
}
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
312
|
+
//#endregion
|
|
313
|
+
//#region src/version.d.ts
|
|
314
|
+
export declare const VERSION: string;
|
|
315
|
+
//#endregion
|
|
316
|
+
export { type GoogleVertexEmbeddingModelOptions, type GoogleVertexGeminiTranscriptionModelId, type GoogleVertexImageModelOptions, type GoogleVertexImageModelOptions as GoogleVertexImageProviderOptions, type GoogleVertexProvider, type GoogleVertexProviderSettings, type GoogleVertexSpeechModelId, type GoogleVertexSpeechModelOptions, type GoogleVertexTranscriptionModelGeminiOptions, type GoogleVertexTranscriptionModelId, type GoogleVertexTranscriptionModelOptions, type GoogleVertexVideoModelId, type GoogleVertexVideoModelOptions, type GoogleVertexVideoModelOptions as GoogleVertexVideoProviderOptions, createGoogleVertex as createVertex, googleVertex as vertex };
|
|
317
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":["GoogleVertexProviderSettings","GoogleVertexProviderSettingsOriginal","TranscriptionModelV4StreamOptions"],"sources":["../src/google-vertex-embedding-model-options.ts","../src/google-vertex-transcription-model-options.ts","../src/google-vertex-image-model-options.ts","../src/google-vertex-video-model-options.ts","../src/google-vertex-video-settings.ts","../src/google-vertex-speech-model-options.ts","../src/google-vertex-config.ts","../src/google-vertex-embedding-model.ts","../src/google-vertex-image-settings.ts","../src/google-vertex-options.ts","../src/google-vertex-tools.ts","../src/google-vertex-provider-base.ts","../src/google-vertex-provider.ts","../src/gemini-transcription/google-vertex-gemini-transcription-model-options.ts","../src/gemini-transcription/google-vertex-gemini-transcription-model.ts","../src/version.ts"],"mappings":";;;;;;;KAGY;cAcC,mCAAiC,EAAA;;;;;;;;;;;;;;GA4C5C,EAAA,KAAA;KAEU,oCAAoC,EAAE,aACzC;;;KC5DG;cAMC,gDAA8C,EAAA;;;;;GA+BzD,EAAA,KAAA;KAEU,wCAAwC,EAAE,aAC7C;;;KC1CG,gCAAgC,KAC1C;;;KCAU;EAEV;EACA;EAGA;EACA;EACA;EAGA;EAGA,kBAAkB;IAChB;IACA;;GAGD;;;;KCtBS;;;KCMA;KAQA,iCAAiC;;;UCZ5B;EACf;EACA;EACA,UAAU,WAAW;EACrB,QAAQ;;;;cCgBG,sCAAsC;WACxC;WACA,SAAS;WACT;mBAEQ;UAET,oBAAoB,OAAO;;;;UAO3B,sBAAsB;IAC5B;IACA,QAAQ;MACT;MAIG;MAMA;EAKF,YAAA,SAAS,8BACT,QAAQ;EAMJ,UACJ,QACA,SACA,aACA,mBACC,WAAW,kCAAkC,QAC9C,QAAQ,WAAW;;;;KCnEX;;;KCGA;;;cCDC;;;;MAS0qlB,YAAC;MAAsD,cAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UC8D9tlB,6BAA6B;;;;GAI3C,SAAS,sBAAsB;EAEhC,gBAAgB,SAAS,wBAAwB;;;;;;;EAQjD,aACE,gBACI;IACE,OAAO;;IACP;MACL;;;;EAKH,MAAM,SAAS,2BAA2B;;;;EAK1C,WAAW,SAAS,2BAA2B;EAE/C,cAAc;;;;EAKd,mBACE,SAAS,+BACR;;;;EAKH,MAAM,SAAS,2BAA2B;;;;EAK1C,WAAW,SAAS,2BAA2B;;;;EAK/C,OAAO,SAAS,4BAA4B;;;;EAK5C,YAAY,SAAS,4BAA4B;;;;EAKjD,cACE,SAAS,mCACR;;;;EAKH,mBACE,SAAS,mCACR;;UAGYA;;;;;;EAMf;;;;EAKA;;;;EAKA;;;;;;;;EASA,UAAU,WAAW;;;;;EAMrB,QAAQ;EAGR;;;;EAKA;;;;;;EAOA,YAAY;;;;;EAMZ;;;;IAIE;;;;;UCpMa,qCAAqCC;;;;;;;EAOpD,oBAAoB;;wBAKN,mBACd,UAAS,+BACR;;;;qBAgCU,cAAY;;;KCpDb;;;;;;;cAWC,6CAA2C,EAAA;;;;;;;;;GAiCtD,EAAA,KAAA;KAEU,8CAA8C,EAAE,aACnD;;;UCuCC;EACR;;EAEA;EACA,UAAU,WAAW;EACrB,QAAQ;EACR,YAAY;EACZ;EACA;EACA;IACE,oBAAoB;IACpB;;;;;;;;;qBAUS,gDAAgD;WAyBhD,SAAS;mBACD;WAzBV;UAED,oBAAoB,OAAO;;;;UAO3B,sBAAsB;IAC5B,SAAS;IACT,QAAQ;MACT;MAOG;EAKO,YAAA,SAAS,wCACD,QAAQ;UAGb;EAeR,WACJ,SAAS,WAAW,yCACnB,QAAQ,QAAQ,WAAW;EAuGxB,SACJ,SAASC,iDACR,QACD,QAAQ,WAAW,YAAY;;;;qBCnQtB"}
|