@langchain/google 0.2.12 → 0.2.13
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 +16 -0
- package/dist/chat_models/api_types/generate_content.d.cts +0 -2
- package/dist/chat_models/api_types/generate_content.d.ts +0 -2
- package/dist/chat_models/api_types/interactions.d.cts +1423 -0
- package/dist/chat_models/api_types/interactions.d.ts +1423 -0
- package/dist/chat_models/base.cjs +12 -11
- package/dist/chat_models/base.cjs.map +1 -1
- package/dist/chat_models/base.d.cts +3 -5
- package/dist/chat_models/base.d.ts +3 -5
- package/dist/chat_models/base.js +12 -11
- package/dist/chat_models/base.js.map +1 -1
- package/dist/chat_models/handlers/base.cjs +1 -2
- package/dist/chat_models/handlers/base.d.cts +0 -2
- package/dist/chat_models/handlers/base.d.ts +0 -2
- package/dist/chat_models/handlers/base.js +1 -2
- package/dist/chat_models/handlers/generate_content.cjs +5 -6
- package/dist/chat_models/handlers/generate_content.d.cts +0 -2
- package/dist/chat_models/handlers/generate_content.d.ts +0 -2
- package/dist/chat_models/handlers/generate_content.js +5 -6
- package/dist/chat_models/handlers/index.cjs +2 -0
- package/dist/chat_models/handlers/index.d.cts +2 -1
- package/dist/chat_models/handlers/index.d.ts +2 -1
- package/dist/chat_models/handlers/index.js +2 -1
- package/dist/chat_models/handlers/interactions.cjs +303 -0
- package/dist/chat_models/handlers/interactions.cjs.map +1 -0
- package/dist/chat_models/handlers/interactions.d.cts +33 -0
- package/dist/chat_models/handlers/interactions.d.ts +33 -0
- package/dist/chat_models/handlers/interactions.js +303 -0
- package/dist/chat_models/handlers/interactions.js.map +1 -0
- package/dist/chat_models/index.cjs +5 -4
- package/dist/chat_models/index.cjs.map +1 -1
- package/dist/chat_models/index.d.cts +4 -5
- package/dist/chat_models/index.d.ts +4 -5
- package/dist/chat_models/index.js +5 -5
- package/dist/chat_models/index.js.map +1 -1
- package/dist/chat_models/node.cjs +3 -4
- package/dist/chat_models/node.d.cts +1 -3
- package/dist/chat_models/node.d.ts +1 -3
- package/dist/chat_models/node.js +3 -4
- package/dist/chat_models/profiles.cjs +1 -2
- package/dist/chat_models/profiles.js +1 -2
- package/dist/chat_models/types.cjs +1 -2
- package/dist/chat_models/types.cjs.map +1 -1
- package/dist/chat_models/types.d.cts +524 -23
- package/dist/chat_models/types.d.ts +524 -23
- package/dist/chat_models/types.js +1 -2
- package/dist/chat_models/types.js.map +1 -1
- package/dist/clients/index.cjs +3 -4
- package/dist/clients/index.d.cts +0 -2
- package/dist/clients/index.d.ts +0 -2
- package/dist/clients/index.js +3 -4
- package/dist/clients/node.cjs +4 -5
- package/dist/clients/node.d.cts +0 -2
- package/dist/clients/node.d.ts +0 -2
- package/dist/clients/node.js +4 -5
- package/dist/const.cjs +1 -2
- package/dist/const.js +1 -2
- package/dist/converters/generate_content/messages.cjs +1 -2
- package/dist/converters/generate_content/messages.js +1 -2
- package/dist/converters/generate_content/params.cjs +1 -2
- package/dist/converters/generate_content/params.js +1 -2
- package/dist/converters/generate_content/stream_events.cjs +1 -2
- package/dist/converters/generate_content/stream_events.js +1 -2
- package/dist/converters/generate_content/tools.cjs +1 -2
- package/dist/converters/generate_content/tools.js +1 -2
- package/dist/converters/interactions/messages.cjs +766 -0
- package/dist/converters/interactions/messages.cjs.map +1 -0
- package/dist/converters/interactions/messages.js +759 -0
- package/dist/converters/interactions/messages.js.map +1 -0
- package/dist/converters/interactions/params.cjs +244 -0
- package/dist/converters/interactions/params.cjs.map +1 -0
- package/dist/converters/interactions/params.js +237 -0
- package/dist/converters/interactions/params.js.map +1 -0
- package/dist/converters/interactions/stream_events.cjs +769 -0
- package/dist/converters/interactions/stream_events.cjs.map +1 -0
- package/dist/converters/interactions/stream_events.js +768 -0
- package/dist/converters/interactions/stream_events.js.map +1 -0
- package/dist/converters/interactions/tools.cjs +229 -0
- package/dist/converters/interactions/tools.cjs.map +1 -0
- package/dist/converters/interactions/tools.js +228 -0
- package/dist/converters/interactions/tools.js.map +1 -0
- package/dist/converters/shared/params.cjs +1 -2
- package/dist/converters/shared/params.js +1 -2
- package/dist/index.cjs +2 -0
- package/dist/index.d.cts +3 -2
- package/dist/index.d.ts +3 -2
- package/dist/index.js +2 -1
- package/dist/node.cjs +1 -1
- package/dist/node.d.cts +1 -1
- package/dist/node.d.ts +1 -1
- package/dist/node.js +1 -1
- package/dist/utils/errors.cjs +1 -2
- package/dist/utils/errors.js +1 -2
- package/dist/utils/gcp-auth.cjs +3 -4
- package/dist/utils/gcp-auth.d.cts +0 -2
- package/dist/utils/gcp-auth.d.ts +0 -2
- package/dist/utils/gcp-auth.js +3 -4
- package/dist/utils/handler.cjs +1 -2
- package/dist/utils/handler.d.cts +0 -2
- package/dist/utils/handler.d.ts +0 -2
- package/dist/utils/handler.js +1 -2
- package/dist/utils/metadata.cjs +1 -2
- package/dist/utils/metadata.js +1 -2
- package/dist/utils/misc.cjs +1 -2
- package/dist/utils/misc.d.cts +0 -2
- package/dist/utils/misc.d.ts +0 -2
- package/dist/utils/misc.js +1 -2
- package/dist/utils/stream.cjs +1 -2
- package/dist/utils/stream.js +1 -2
- package/package.json +11 -9
|
@@ -0,0 +1,1423 @@
|
|
|
1
|
+
export declare namespace Interactions {
|
|
2
|
+
/** The Interaction resource. */
|
|
3
|
+
interface Interaction {
|
|
4
|
+
/** The agent to interact with. */
|
|
5
|
+
agent?: AgentOption;
|
|
6
|
+
/** Configuration parameters for the agent interaction. */
|
|
7
|
+
agent_config?: AntigravityAgentConfig | CodeMenderAgentConfig | DeepResearchAgentConfig | DynamicAgentConfig;
|
|
8
|
+
/**
|
|
9
|
+
* Input only. Whether to run the model interaction in the background.
|
|
10
|
+
*/
|
|
11
|
+
background?: boolean;
|
|
12
|
+
/**
|
|
13
|
+
* The name of the cached content used as context to serve the prediction. Note: only used in explicit caching, where users can have control over caching (e.g. what content to cache) and enjoy guaranteed cost savings. Format: cachedContents/{cachedContent}
|
|
14
|
+
*/
|
|
15
|
+
cached_content?: string;
|
|
16
|
+
/**
|
|
17
|
+
* Required. Output only. The time at which the response was created in ISO 8601 format
|
|
18
|
+
* (YYYY-MM-DDThh:mm:ssZ).
|
|
19
|
+
*/
|
|
20
|
+
readonly created?: string;
|
|
21
|
+
/**
|
|
22
|
+
* The environment configuration for the interaction. Can be an object
|
|
23
|
+
* specifying remote environment sources or a string referencing an existing
|
|
24
|
+
* environment ID.
|
|
25
|
+
*/
|
|
26
|
+
environment?: EnvironmentConfig | string;
|
|
27
|
+
/**
|
|
28
|
+
* Output only. The environment ID for the interaction. Only populated if environment
|
|
29
|
+
* config is set in the request.
|
|
30
|
+
*/
|
|
31
|
+
readonly environment_id?: string;
|
|
32
|
+
/**
|
|
33
|
+
* Output only. Diagnostic faults / platform errors recorded on the interaction.
|
|
34
|
+
*/
|
|
35
|
+
readonly errors?: Array<Error>;
|
|
36
|
+
/** Configuration parameters for model interactions. */
|
|
37
|
+
generation_config?: GenerationConfig;
|
|
38
|
+
/**
|
|
39
|
+
* Required. Output only. A unique identifier for the interaction completion.
|
|
40
|
+
*/
|
|
41
|
+
readonly id?: string;
|
|
42
|
+
/** The input for the interaction. */
|
|
43
|
+
input?: InteractionsInput;
|
|
44
|
+
/**
|
|
45
|
+
* The labels with user-defined metadata for the request.
|
|
46
|
+
*
|
|
47
|
+
* Label keys and values can be no longer than 63 characters
|
|
48
|
+
* (Unicode codepoints) and can only contain lowercase letters, numeric
|
|
49
|
+
* characters, underscores, and dashes. International characters are allowed.
|
|
50
|
+
* Label values are optional. Label keys must start with a letter.
|
|
51
|
+
*/
|
|
52
|
+
labels?: Record<string, unknown>;
|
|
53
|
+
/**
|
|
54
|
+
* The model that will complete your prompt.\n\nSee [models](https://ai.google.dev/gemini-api/docs/models) for additional details.
|
|
55
|
+
*/
|
|
56
|
+
model?: ModelOption;
|
|
57
|
+
/** The ID of the previous interaction, if any. */
|
|
58
|
+
previous_interaction_id?: string;
|
|
59
|
+
/**
|
|
60
|
+
* Enforces that the generated response is a JSON object that complies with
|
|
61
|
+
* the JSON schema specified in this field.
|
|
62
|
+
*/
|
|
63
|
+
response_format?: ResponseFormat | Array<ResponseFormat>;
|
|
64
|
+
/**
|
|
65
|
+
* The mime type of the response. This is required if response_format is set.
|
|
66
|
+
*/
|
|
67
|
+
response_mime_type?: string;
|
|
68
|
+
/**
|
|
69
|
+
* The requested modalities of the response (TEXT, IMAGE, AUDIO).
|
|
70
|
+
*/
|
|
71
|
+
response_modalities?: Array<ResponseModality>;
|
|
72
|
+
/** Safety settings for the interaction. */
|
|
73
|
+
safety_settings?: Array<SafetySetting>;
|
|
74
|
+
service_tier?: ServiceTier;
|
|
75
|
+
/** Required. Output only. The status of the interaction. */
|
|
76
|
+
readonly status: "in_progress" | "requires_action" | "completed" | "failed" | "cancelled" | "incomplete" | "budget_exceeded" | "queued" | (string & {});
|
|
77
|
+
/**
|
|
78
|
+
* Required. Output only. The steps that make up the interaction, when included in the response.
|
|
79
|
+
*/
|
|
80
|
+
readonly steps?: Array<Step>;
|
|
81
|
+
/**
|
|
82
|
+
* Input only. Whether to store the response and request for later retrieval.
|
|
83
|
+
*/
|
|
84
|
+
store?: boolean;
|
|
85
|
+
/** Input only. Whether the interaction will be streamed. */
|
|
86
|
+
stream?: boolean;
|
|
87
|
+
/** System instruction for the interaction. */
|
|
88
|
+
system_instruction?: string;
|
|
89
|
+
/**
|
|
90
|
+
* A list of tool declarations the model may call during interaction.
|
|
91
|
+
*/
|
|
92
|
+
tools?: Array<Interactions.Tools.Tool>;
|
|
93
|
+
/**
|
|
94
|
+
* Required. Output only. The time at which the response was last updated in ISO 8601 format
|
|
95
|
+
* (YYYY-MM-DDThh:mm:ssZ).
|
|
96
|
+
*/
|
|
97
|
+
readonly updated?: string;
|
|
98
|
+
/** Statistics on the interaction request's token usage. */
|
|
99
|
+
usage?: Usage;
|
|
100
|
+
/** Message for configuring webhook events for a request. */
|
|
101
|
+
webhook_config?: WebhookConfig;
|
|
102
|
+
}
|
|
103
|
+
/** Interaction for generating the completion using agents. */
|
|
104
|
+
interface AgentInteraction {
|
|
105
|
+
/** The agent to interact with. */
|
|
106
|
+
agent: AgentOption;
|
|
107
|
+
/** Configuration parameters for the agent interaction. */
|
|
108
|
+
agent_config?: AntigravityAgentConfig | CodeMenderAgentConfig | DeepResearchAgentConfig | DynamicAgentConfig;
|
|
109
|
+
/**
|
|
110
|
+
* Input only. Whether to run the model interaction in the background.
|
|
111
|
+
*/
|
|
112
|
+
background?: boolean;
|
|
113
|
+
/**
|
|
114
|
+
* The environment configuration for the interaction. Can be an object
|
|
115
|
+
* specifying remote environment sources or a string referencing an existing
|
|
116
|
+
* environment ID.
|
|
117
|
+
*/
|
|
118
|
+
environment?: EnvironmentConfig | string;
|
|
119
|
+
/** The input for the interaction. */
|
|
120
|
+
input?: InteractionsInput;
|
|
121
|
+
/**
|
|
122
|
+
* The labels with user-defined metadata for the request.
|
|
123
|
+
*
|
|
124
|
+
* Label keys and values can be no longer than 63 characters
|
|
125
|
+
* (Unicode codepoints) and can only contain lowercase letters, numeric
|
|
126
|
+
* characters, underscores, and dashes. International characters are allowed.
|
|
127
|
+
* Label values are optional. Label keys must start with a letter.
|
|
128
|
+
*/
|
|
129
|
+
labels?: Record<string, unknown>;
|
|
130
|
+
/** The ID of the previous interaction, if any. */
|
|
131
|
+
previous_interaction_id?: string;
|
|
132
|
+
/**
|
|
133
|
+
* Enforces that the generated response is a JSON object that complies with
|
|
134
|
+
* the JSON schema specified in this field.
|
|
135
|
+
*/
|
|
136
|
+
response_format?: ResponseFormat | Array<ResponseFormat>;
|
|
137
|
+
/**
|
|
138
|
+
* The mime type of the response. This is required if response_format is set.
|
|
139
|
+
*/
|
|
140
|
+
response_mime_type?: string;
|
|
141
|
+
/**
|
|
142
|
+
* The requested modalities of the response (TEXT, IMAGE, AUDIO).
|
|
143
|
+
*/
|
|
144
|
+
response_modalities?: Array<ResponseModality>;
|
|
145
|
+
/** Safety settings for the interaction. */
|
|
146
|
+
safety_settings?: Array<SafetySetting>;
|
|
147
|
+
service_tier?: ServiceTier;
|
|
148
|
+
/**
|
|
149
|
+
* Input only. Whether to store the response and request for later retrieval.
|
|
150
|
+
*/
|
|
151
|
+
store?: boolean;
|
|
152
|
+
/** Input only. Whether the interaction will be streamed. */
|
|
153
|
+
stream?: boolean;
|
|
154
|
+
/** System instruction for the interaction. */
|
|
155
|
+
system_instruction?: string;
|
|
156
|
+
/**
|
|
157
|
+
* A list of tool declarations the model may call during interaction.
|
|
158
|
+
*/
|
|
159
|
+
tools?: Array<Interactions.Tools.Tool>;
|
|
160
|
+
/** Message for configuring webhook events for a request. */
|
|
161
|
+
webhook_config?: WebhookConfig;
|
|
162
|
+
}
|
|
163
|
+
/** Interaction for generating the completion using models. */
|
|
164
|
+
interface ModelInteraction {
|
|
165
|
+
/**
|
|
166
|
+
* Input only. Whether to run the model interaction in the background.
|
|
167
|
+
*/
|
|
168
|
+
background?: boolean;
|
|
169
|
+
/**
|
|
170
|
+
* The name of the cached content used as context to serve the prediction. Note: only used in explicit caching, where users can have control over caching (e.g. what content to cache) and enjoy guaranteed cost savings. Format: cachedContents/{cachedContent}
|
|
171
|
+
*/
|
|
172
|
+
cached_content?: string;
|
|
173
|
+
/**
|
|
174
|
+
* Required. Output only. The time at which the response was created in ISO 8601 format
|
|
175
|
+
* (YYYY-MM-DDThh:mm:ssZ).
|
|
176
|
+
*/
|
|
177
|
+
readonly created: string;
|
|
178
|
+
/**
|
|
179
|
+
* The environment configuration for the interaction. Can be an object
|
|
180
|
+
* specifying remote environment sources or a string referencing an existing
|
|
181
|
+
* environment ID.
|
|
182
|
+
*/
|
|
183
|
+
environment?: EnvironmentConfig | string;
|
|
184
|
+
/**
|
|
185
|
+
* Output only. The environment ID for the interaction. Only populated if environment
|
|
186
|
+
* config is set in the request.
|
|
187
|
+
*/
|
|
188
|
+
readonly environment_id?: string;
|
|
189
|
+
/** Configuration parameters for model interactions. */
|
|
190
|
+
generation_config?: GenerationConfig;
|
|
191
|
+
/**
|
|
192
|
+
* Required. Output only. A unique identifier for the interaction completion.
|
|
193
|
+
*/
|
|
194
|
+
readonly id: string;
|
|
195
|
+
/** The input for the interaction. */
|
|
196
|
+
input?: InteractionsInput;
|
|
197
|
+
/**
|
|
198
|
+
* The labels with user-defined metadata for the request.
|
|
199
|
+
*
|
|
200
|
+
* Label keys and values can be no longer than 63 characters
|
|
201
|
+
* (Unicode codepoints) and can only contain lowercase letters, numeric
|
|
202
|
+
* characters, underscores, and dashes. International characters are allowed.
|
|
203
|
+
* Label values are optional. Label keys must start with a letter.
|
|
204
|
+
*/
|
|
205
|
+
labels?: Record<string, unknown>;
|
|
206
|
+
/**
|
|
207
|
+
* The model that will complete your prompt.\n\nSee [models](https://ai.google.dev/gemini-api/docs/models) for additional details.
|
|
208
|
+
*/
|
|
209
|
+
model: ModelOption;
|
|
210
|
+
/** The ID of the previous interaction, if any. */
|
|
211
|
+
previous_interaction_id?: string;
|
|
212
|
+
/**
|
|
213
|
+
* Enforces that the generated response is a JSON object that complies with
|
|
214
|
+
* the JSON schema specified in this field.
|
|
215
|
+
*/
|
|
216
|
+
response_format?: ResponseFormat | Array<ResponseFormat>;
|
|
217
|
+
/**
|
|
218
|
+
* The mime type of the response. This is required if response_format is set.
|
|
219
|
+
*/
|
|
220
|
+
response_mime_type?: string;
|
|
221
|
+
/**
|
|
222
|
+
* The requested modalities of the response (TEXT, IMAGE, AUDIO).
|
|
223
|
+
*/
|
|
224
|
+
response_modalities?: Array<ResponseModality>;
|
|
225
|
+
/** Safety settings for the interaction. */
|
|
226
|
+
safety_settings?: Array<SafetySetting>;
|
|
227
|
+
service_tier?: ServiceTier;
|
|
228
|
+
/** Required. Output only. The status of the interaction. */
|
|
229
|
+
readonly status: "in_progress" | "requires_action" | "completed" | "failed" | "cancelled" | "incomplete" | "budget_exceeded" | "queued" | (string & {});
|
|
230
|
+
/**
|
|
231
|
+
* Input only. Whether to store the response and request for later retrieval.
|
|
232
|
+
*/
|
|
233
|
+
store?: boolean;
|
|
234
|
+
/** Input only. Whether the interaction will be streamed. */
|
|
235
|
+
stream?: boolean;
|
|
236
|
+
/** System instruction for the interaction. */
|
|
237
|
+
system_instruction?: string;
|
|
238
|
+
/**
|
|
239
|
+
* A list of tool declarations the model may call during interaction.
|
|
240
|
+
*/
|
|
241
|
+
tools?: Array<Interactions.Tools.Tool>;
|
|
242
|
+
/**
|
|
243
|
+
* Required. Output only. The time at which the response was last updated in ISO 8601 format
|
|
244
|
+
* (YYYY-MM-DDThh:mm:ssZ).
|
|
245
|
+
*/
|
|
246
|
+
readonly updated: string;
|
|
247
|
+
/** Message for configuring webhook events for a request. */
|
|
248
|
+
webhook_config?: WebhookConfig;
|
|
249
|
+
}
|
|
250
|
+
/** The agent to interact with. */
|
|
251
|
+
type AgentOption = "deep-research-pro-preview-12-2025" | "deep-research-preview-04-2026" | "deep-research-max-preview-04-2026" | "antigravity-preview-05-2026" | (string & {});
|
|
252
|
+
/**
|
|
253
|
+
* Configuration for the Antigravity agent runtime.
|
|
254
|
+
* Provides server-side control over the agent's execution environment
|
|
255
|
+
* and tool configuration.
|
|
256
|
+
*/
|
|
257
|
+
interface AntigravityAgentConfig {
|
|
258
|
+
/** Max total tokens for the agent run. */
|
|
259
|
+
max_total_tokens?: string;
|
|
260
|
+
/** The model to use for agent reasoning. */
|
|
261
|
+
model?: string;
|
|
262
|
+
type: unknown;
|
|
263
|
+
}
|
|
264
|
+
/** Configuration for the CodeMender agent. */
|
|
265
|
+
interface CodeMenderAgentConfig {
|
|
266
|
+
/**
|
|
267
|
+
* Request parameters specific to FIND sessions, used for discovering
|
|
268
|
+
* vulnerabilities in a codebase.
|
|
269
|
+
*/
|
|
270
|
+
find_request?: FindRequest;
|
|
271
|
+
/**
|
|
272
|
+
* Request parameters specific to FIX sessions, used for generating and
|
|
273
|
+
* validating security patches.
|
|
274
|
+
*/
|
|
275
|
+
fix_request?: FixRequest;
|
|
276
|
+
/**
|
|
277
|
+
* The name of the model to use for the CodeMender agent. One
|
|
278
|
+
* CodeMender session will only use one model.
|
|
279
|
+
*/
|
|
280
|
+
model?: string;
|
|
281
|
+
/** The configuration of CodeMender sessions. */
|
|
282
|
+
session_config?: SessionConfig;
|
|
283
|
+
/**
|
|
284
|
+
* Parameter for grouping multiple interactions that belong to
|
|
285
|
+
* the same CodeMender session.
|
|
286
|
+
*/
|
|
287
|
+
session_id?: string;
|
|
288
|
+
type: unknown;
|
|
289
|
+
}
|
|
290
|
+
/** Configuration for the Deep Research agent. */
|
|
291
|
+
interface DeepResearchAgentConfig {
|
|
292
|
+
/**
|
|
293
|
+
* Enables human-in-the-loop planning for the Deep Research agent. If set to
|
|
294
|
+
* true, the Deep Research agent will provide a research plan in its response.
|
|
295
|
+
* The agent will then proceed only if the user confirms the plan in the next
|
|
296
|
+
* turn.
|
|
297
|
+
*/
|
|
298
|
+
collaborative_planning?: boolean;
|
|
299
|
+
/** Enables bigquery tool for the Deep Research agent. */
|
|
300
|
+
enable_bigquery_tool?: boolean;
|
|
301
|
+
thinking_summaries?: ThinkingSummaries;
|
|
302
|
+
type: unknown;
|
|
303
|
+
/** Whether to include visualizations in the response. */
|
|
304
|
+
visualization?: "off" | "auto" | (string & {});
|
|
305
|
+
}
|
|
306
|
+
/** Configuration for dynamic agents. */
|
|
307
|
+
interface DynamicAgentConfig {
|
|
308
|
+
type: unknown;
|
|
309
|
+
}
|
|
310
|
+
/** Configuration for a custom environment. */
|
|
311
|
+
interface EnvironmentConfig {
|
|
312
|
+
/** Environment variables to set in the sandbox environment. */
|
|
313
|
+
env?: Record<string, unknown>;
|
|
314
|
+
/**
|
|
315
|
+
* Optional. The environment ID for the interaction. If specified, the request will
|
|
316
|
+
* update the existing environment instead of creating a new one.
|
|
317
|
+
*/
|
|
318
|
+
environment_id?: string;
|
|
319
|
+
/** Network configuration for the environment. */
|
|
320
|
+
network?: EnvironmentNetworkEgressAllowlist | "disabled" | (string & {});
|
|
321
|
+
sources?: Array<Source>;
|
|
322
|
+
type: unknown;
|
|
323
|
+
}
|
|
324
|
+
/** Error message from an interaction. */
|
|
325
|
+
interface Error {
|
|
326
|
+
/** A URI that identifies the error type. */
|
|
327
|
+
code?: string;
|
|
328
|
+
/** A human-readable error message. */
|
|
329
|
+
message?: string;
|
|
330
|
+
}
|
|
331
|
+
/** Configuration parameters for model interactions. */
|
|
332
|
+
interface GenerationConfig {
|
|
333
|
+
/** The configuration for image interaction. */
|
|
334
|
+
image_config?: ImageConfig;
|
|
335
|
+
/** The maximum number of tokens to include in the response. */
|
|
336
|
+
max_output_tokens?: number;
|
|
337
|
+
/** Seed used in decoding for reproducibility. */
|
|
338
|
+
seed?: number;
|
|
339
|
+
/** Optional. Speech and multi-speaker configuration. */
|
|
340
|
+
speech_config?: SpeakerConfig | Array<SpeechConfig>;
|
|
341
|
+
/**
|
|
342
|
+
* A list of character sequences that will stop output interaction.
|
|
343
|
+
*/
|
|
344
|
+
stop_sequences?: Array<string>;
|
|
345
|
+
/** Controls the randomness of the output. */
|
|
346
|
+
temperature?: number;
|
|
347
|
+
thinking_level?: ThinkingLevel;
|
|
348
|
+
thinking_summaries?: ThinkingSummaries;
|
|
349
|
+
/** The tool choice configuration. */
|
|
350
|
+
tool_choice?: ToolChoiceConfig | "auto" | "any" | "none" | "validated" | (string & {});
|
|
351
|
+
/**
|
|
352
|
+
* The maximum cumulative probability of tokens to consider when sampling.
|
|
353
|
+
*/
|
|
354
|
+
top_p?: number;
|
|
355
|
+
/** Configuration for speech recognition (transcription). */
|
|
356
|
+
transcription_config?: TranscriptionConfig;
|
|
357
|
+
/** Configuration options for video generation. */
|
|
358
|
+
video_config?: VideoConfig;
|
|
359
|
+
}
|
|
360
|
+
/** The input for the interaction. */
|
|
361
|
+
type InteractionsInput = Content | Array<Step> | Array<Content> | string;
|
|
362
|
+
/**
|
|
363
|
+
* The model that will complete your prompt.\n\nSee [models](https://ai.google.dev/gemini-api/docs/models) for additional details.
|
|
364
|
+
*/
|
|
365
|
+
type ModelOption = "gemma-4-26b-a4b-it" | "gemma-4-31b-it" | "gemini-flash-latest" | "gemini-flash-lite-latest" | "gemini-pro-latest" | "gemini-2.5-flash" | "gemini-2.5-pro" | "gemini-2.5-flash-lite" | "gemini-3.5-flash-lite" | "gemini-2.5-flash-image" | "gemini-3-flash-preview" | "gemini-3.1-pro-preview" | "gemini-3.1-pro-preview-customtools" | "gemini-3.1-flash-lite" | "gemini-3.1-flash-lite-image" | "gemini-3-pro-image" | "nano-banana-pro-preview" | "gemini-3.1-flash-image" | "gemini-nano-banana-2.1" | "gemini-3.1-flash-tts-preview" | "gemini-3.5-flash" | "gemini-3.6-flash" | "gemini-3.7-flash" | "gemini-3.8-flash" | "gemini-4-argon" | "gemini-3.8-flash-tts" | "gemini-3.8-flash-lite-tts" | "lyria-3-clip-preview" | "lyria-3-pro-preview" | "gemini-robotics-er-1.6-preview" | "gemini-robotics-er-2-preview" | "lyria-3.5" | "gemini-omni-1.1-flash" | "gemini-omni-flash-preview" | (string & {});
|
|
366
|
+
type ResponseFormat = AudioResponseFormat | ImageResponseFormat | TextResponseFormat | VideoResponseFormat | Record<string, unknown>;
|
|
367
|
+
type ResponseModality = "text" | "image" | "audio" | "video" | "document" | (string & {});
|
|
368
|
+
/**
|
|
369
|
+
* A safety setting that affects the safety-blocking behavior.
|
|
370
|
+
*
|
|
371
|
+
* A SafetySetting consists of a
|
|
372
|
+
* harm category and a
|
|
373
|
+
* threshold for that
|
|
374
|
+
* category.
|
|
375
|
+
*/
|
|
376
|
+
interface SafetySetting {
|
|
377
|
+
/**
|
|
378
|
+
* Optional. The method for blocking content. If not specified, the default
|
|
379
|
+
* behavior is to use the probability score.
|
|
380
|
+
*/
|
|
381
|
+
method?: "severity" | "probability" | (string & {});
|
|
382
|
+
/**
|
|
383
|
+
* Required. The threshold for blocking content. If the harm probability
|
|
384
|
+
* exceeds this threshold, the content will be blocked.
|
|
385
|
+
*/
|
|
386
|
+
threshold: "block_low_and_above" | "block_medium_and_above" | "block_only_high" | "block_none" | "off" | (string & {});
|
|
387
|
+
type: HarmCategory;
|
|
388
|
+
}
|
|
389
|
+
type ServiceTier = "flex" | "standard" | "priority" | "deferred" | (string & {});
|
|
390
|
+
/** A step in the interaction. */
|
|
391
|
+
type Step = CodeExecutionCallStep | CodeExecutionResultStep | FileSearchCallStep | FileSearchResultStep | FunctionCallStep | FunctionResultStep | GoogleMapsCallStep | GoogleMapsResultStep | GoogleSearchCallStep | GoogleSearchResultStep | McpServerToolCallStep | McpServerToolResultStep | ModelOutputStep | ProcessingCallStep | ProcessingResultStep | RetrievalCallStep | RetrievalResultStep | ThoughtStep | UrlContextCallStep | UrlContextResultStep | UserInputStep;
|
|
392
|
+
/** Statistics on the interaction request's token usage. */
|
|
393
|
+
interface Usage {
|
|
394
|
+
/** A breakdown of cached token usage by modality. */
|
|
395
|
+
cached_tokens_by_modality?: Array<ModalityTokens>;
|
|
396
|
+
/** Grounding tool count. */
|
|
397
|
+
grounding_tool_count?: Array<GroundingToolCount>;
|
|
398
|
+
/** A breakdown of input token usage by modality. */
|
|
399
|
+
input_tokens_by_modality?: Array<ModalityTokens>;
|
|
400
|
+
/** A breakdown of output token usage by modality. */
|
|
401
|
+
output_tokens_by_modality?: Array<ModalityTokens>;
|
|
402
|
+
/** A breakdown of tool-use token usage by modality. */
|
|
403
|
+
tool_use_tokens_by_modality?: Array<ModalityTokens>;
|
|
404
|
+
/**
|
|
405
|
+
* Number of tokens in the cached part of the prompt (the cached content).
|
|
406
|
+
*/
|
|
407
|
+
total_cached_tokens?: number;
|
|
408
|
+
/** Number of tokens in the prompt (context). */
|
|
409
|
+
total_input_tokens?: number;
|
|
410
|
+
/** Total number of tokens across all the generated responses. */
|
|
411
|
+
total_output_tokens?: number;
|
|
412
|
+
/** Number of tokens of thoughts for thinking models. */
|
|
413
|
+
total_thought_tokens?: number;
|
|
414
|
+
/**
|
|
415
|
+
* Total token count for the interaction request (prompt + responses + other
|
|
416
|
+
* internal tokens).
|
|
417
|
+
*/
|
|
418
|
+
total_tokens?: number;
|
|
419
|
+
/** Number of tokens present in tool-use prompt(s). */
|
|
420
|
+
total_tool_use_tokens?: number;
|
|
421
|
+
}
|
|
422
|
+
/** Message for configuring webhook events for a request. */
|
|
423
|
+
interface WebhookConfig {
|
|
424
|
+
/**
|
|
425
|
+
* Optional. If set, these webhook URIs will be used for webhook events instead of the
|
|
426
|
+
* registered webhooks.
|
|
427
|
+
*/
|
|
428
|
+
uris?: Array<string>;
|
|
429
|
+
/**
|
|
430
|
+
* Optional. The user metadata that will be returned on each event emission to the
|
|
431
|
+
* webhooks.
|
|
432
|
+
*/
|
|
433
|
+
user_metadata?: Record<string, unknown>;
|
|
434
|
+
}
|
|
435
|
+
namespace Tools {
|
|
436
|
+
/** A tool that can be used by the model. */
|
|
437
|
+
type Tool = CodeExecution | ComputerUse | FileSearch | Function | GoogleMaps | GoogleSearch | McpServer | Retrieval | UrlContext;
|
|
438
|
+
/** A tool that can be used by the model to execute code. */
|
|
439
|
+
interface CodeExecution {
|
|
440
|
+
type: unknown;
|
|
441
|
+
}
|
|
442
|
+
/**
|
|
443
|
+
* A tool that can be used by the model to interact with the computer.
|
|
444
|
+
*/
|
|
445
|
+
interface ComputerUse {
|
|
446
|
+
/** Optional. Disabled safety policies for computer use. */
|
|
447
|
+
disabled_safety_policies?: Array<"financial_transactions" | "sensitive_data_modification" | "communication_tool" | "account_creation" | "data_modification" | "user_consent_management" | "legal_terms_and_agreements" | (string & {})>;
|
|
448
|
+
/**
|
|
449
|
+
* Whether enable the prompt injection detection check on computer-use
|
|
450
|
+
* request.
|
|
451
|
+
*/
|
|
452
|
+
enable_prompt_injection_detection?: boolean;
|
|
453
|
+
/** The environment being operated. */
|
|
454
|
+
environment?: "browser" | "mobile" | "desktop" | (string & {});
|
|
455
|
+
/**
|
|
456
|
+
* The list of predefined functions that are excluded from the model call.
|
|
457
|
+
*/
|
|
458
|
+
excluded_predefined_functions?: Array<string>;
|
|
459
|
+
type: unknown;
|
|
460
|
+
}
|
|
461
|
+
/** A tool that can be used by the model to search files. */
|
|
462
|
+
interface FileSearch {
|
|
463
|
+
/** The file search store names to search. */
|
|
464
|
+
file_search_store_names?: Array<string>;
|
|
465
|
+
/**
|
|
466
|
+
* Metadata filter to apply to the semantic retrieval documents and chunks.
|
|
467
|
+
*/
|
|
468
|
+
metadata_filter?: string;
|
|
469
|
+
/** The number of semantic retrieval chunks to retrieve. */
|
|
470
|
+
top_k?: number;
|
|
471
|
+
type: unknown;
|
|
472
|
+
}
|
|
473
|
+
/** A tool that can be used by the model. */
|
|
474
|
+
interface Function {
|
|
475
|
+
/** A description of the function. */
|
|
476
|
+
description?: string;
|
|
477
|
+
/** The name of the function. */
|
|
478
|
+
name?: string;
|
|
479
|
+
/** The JSON Schema for the function's parameters. */
|
|
480
|
+
parameters?: unknown;
|
|
481
|
+
type: unknown;
|
|
482
|
+
}
|
|
483
|
+
/** A tool that can be used by the model to call Google Maps. */
|
|
484
|
+
interface GoogleMaps {
|
|
485
|
+
/**
|
|
486
|
+
* Whether to return a widget context token in the tool call result of the
|
|
487
|
+
* response.
|
|
488
|
+
*/
|
|
489
|
+
enable_widget?: boolean;
|
|
490
|
+
/** The latitude of the user's location. */
|
|
491
|
+
latitude?: number;
|
|
492
|
+
/** The longitude of the user's location. */
|
|
493
|
+
longitude?: number;
|
|
494
|
+
type: unknown;
|
|
495
|
+
}
|
|
496
|
+
/** A tool that can be used by the model to search Google. */
|
|
497
|
+
interface GoogleSearch {
|
|
498
|
+
/** The types of search grounding to enable. */
|
|
499
|
+
search_types?: Array<"web_search" | "image_search" | "enterprise_web_search" | (string & {})>;
|
|
500
|
+
type: unknown;
|
|
501
|
+
}
|
|
502
|
+
/**
|
|
503
|
+
* A MCPServer is a server that can be called by the model to perform actions.
|
|
504
|
+
*/
|
|
505
|
+
interface McpServer {
|
|
506
|
+
/** The allowed tools. */
|
|
507
|
+
allowed_tools?: Array<AllowedTools>;
|
|
508
|
+
/**
|
|
509
|
+
* Optional: Fields for authentication headers, timeouts, etc., if needed.
|
|
510
|
+
*/
|
|
511
|
+
headers?: Record<string, unknown>;
|
|
512
|
+
/** The name of the MCPServer. */
|
|
513
|
+
name?: string;
|
|
514
|
+
type: unknown;
|
|
515
|
+
/**
|
|
516
|
+
* The full URL for the MCPServer endpoint.
|
|
517
|
+
* Example: "https://api.example.com/mcp"
|
|
518
|
+
*/
|
|
519
|
+
url?: string;
|
|
520
|
+
}
|
|
521
|
+
/** A tool that can be used by the model to retrieve files. */
|
|
522
|
+
interface Retrieval {
|
|
523
|
+
/** Used to specify configuration for ExaAISearch. */
|
|
524
|
+
exa_ai_search_config?: ExaAISearchConfig;
|
|
525
|
+
/** Used to specify configuration for ParallelAISearch. */
|
|
526
|
+
parallel_ai_search_config?: ParallelAISearchConfig;
|
|
527
|
+
/** Use to specify configuration for RAG Store. */
|
|
528
|
+
rag_store_config?: RagStoreConfig;
|
|
529
|
+
/** The types of file retrieval to enable. */
|
|
530
|
+
retrieval_types?: Array<"vertex_ai_search" | "rag_store" | "exa_ai_search" | "parallel_ai_search" | (string & {})>;
|
|
531
|
+
type: unknown;
|
|
532
|
+
/** Used to specify configuration for VertexAISearch. */
|
|
533
|
+
vertex_ai_search_config?: VertexAISearchConfig;
|
|
534
|
+
}
|
|
535
|
+
/** A tool that can be used by the model to fetch URL context. */
|
|
536
|
+
interface UrlContext {
|
|
537
|
+
type: unknown;
|
|
538
|
+
}
|
|
539
|
+
/** The configuration for allowed tools. */
|
|
540
|
+
interface AllowedTools {
|
|
541
|
+
/** The mode of the tool choice. */
|
|
542
|
+
mode?: "auto" | "any" | "none" | "validated" | (string & {});
|
|
543
|
+
/** The names of the allowed tools. */
|
|
544
|
+
tools?: Array<string>;
|
|
545
|
+
}
|
|
546
|
+
/** Used to specify configuration for ExaAISearch. */
|
|
547
|
+
interface ExaAISearchConfig {
|
|
548
|
+
/** Required. The API key for ExaAiSearch. */
|
|
549
|
+
api_key: string;
|
|
550
|
+
/**
|
|
551
|
+
* Optional. This field can be used to pass any parameter from the Exa.ai Search API.
|
|
552
|
+
*/
|
|
553
|
+
custom_config?: Record<string, unknown>;
|
|
554
|
+
}
|
|
555
|
+
/** Config for filters. */
|
|
556
|
+
interface Filter {
|
|
557
|
+
/** Optional. String for metadata filtering. */
|
|
558
|
+
metadata_filter?: string;
|
|
559
|
+
/**
|
|
560
|
+
* Optional. Only returns contexts with vector distance smaller than the
|
|
561
|
+
* threshold.
|
|
562
|
+
*/
|
|
563
|
+
vector_distance_threshold?: number;
|
|
564
|
+
/**
|
|
565
|
+
* Optional. Only returns contexts with vector similarity larger than the
|
|
566
|
+
* threshold.
|
|
567
|
+
*/
|
|
568
|
+
vector_similarity_threshold?: number;
|
|
569
|
+
}
|
|
570
|
+
/** Config for Hybrid Search. */
|
|
571
|
+
interface HybridSearch {
|
|
572
|
+
/**
|
|
573
|
+
* Optional. Alpha value controls the weight between dense and sparse vector search
|
|
574
|
+
* results.
|
|
575
|
+
*/
|
|
576
|
+
alpha?: number;
|
|
577
|
+
}
|
|
578
|
+
/** Used to specify configuration for ParallelAISearch. */
|
|
579
|
+
interface ParallelAISearchConfig {
|
|
580
|
+
/** Optional. The API key for ParallelAiSearch. */
|
|
581
|
+
api_key?: string;
|
|
582
|
+
/** Optional. Custom configs for ParallelAiSearch. */
|
|
583
|
+
custom_config?: Record<string, unknown>;
|
|
584
|
+
}
|
|
585
|
+
/** The definition of the Rag resource. */
|
|
586
|
+
interface RagResource {
|
|
587
|
+
/** Optional. RagCorpora resource name. */
|
|
588
|
+
rag_corpus?: string;
|
|
589
|
+
/**
|
|
590
|
+
* Optional. rag_file_id. The files should be in the same rag_corpus set in
|
|
591
|
+
* rag_corpus field.
|
|
592
|
+
*/
|
|
593
|
+
rag_file_ids?: Array<string>;
|
|
594
|
+
}
|
|
595
|
+
/** Specifies the context retrieval config. */
|
|
596
|
+
interface RagRetrievalConfig {
|
|
597
|
+
/** Config for filters. */
|
|
598
|
+
filter?: Filter;
|
|
599
|
+
/** Config for Hybrid Search. */
|
|
600
|
+
hybrid_search?: HybridSearch;
|
|
601
|
+
/** Config for ranking and reranking. */
|
|
602
|
+
ranking?: Ranking;
|
|
603
|
+
/** Optional. The number of contexts to retrieve. */
|
|
604
|
+
top_k?: number;
|
|
605
|
+
}
|
|
606
|
+
/** Use to specify configuration for RAG Store. */
|
|
607
|
+
interface RagStoreConfig {
|
|
608
|
+
/** Optional. The representation of the rag source. */
|
|
609
|
+
rag_resources?: Array<RagResource>;
|
|
610
|
+
/** Specifies the context retrieval config. */
|
|
611
|
+
rag_retrieval_config?: RagRetrievalConfig;
|
|
612
|
+
/**
|
|
613
|
+
* Optional. Number of top k results to return from the selected corpora.
|
|
614
|
+
*/
|
|
615
|
+
similarity_top_k?: number;
|
|
616
|
+
/**
|
|
617
|
+
* Optional. Only return results with vector distance smaller than the threshold.
|
|
618
|
+
*/
|
|
619
|
+
vector_distance_threshold?: number;
|
|
620
|
+
}
|
|
621
|
+
/** Config for ranking and reranking. */
|
|
622
|
+
interface Ranking {
|
|
623
|
+
/** Optional. The model name of the rank service. */
|
|
624
|
+
model_name?: string;
|
|
625
|
+
/** Config for Rank Service. */
|
|
626
|
+
rank_service?: RankService;
|
|
627
|
+
ranking_config: unknown;
|
|
628
|
+
}
|
|
629
|
+
/** Config for Rank Service. */
|
|
630
|
+
interface RankService {
|
|
631
|
+
/** Optional. The model name of the rank service. */
|
|
632
|
+
model_name?: string;
|
|
633
|
+
}
|
|
634
|
+
/** Used to specify configuration for VertexAISearch. */
|
|
635
|
+
interface VertexAISearchConfig {
|
|
636
|
+
/** Optional. Used to specify Vertex AI Search datastores. */
|
|
637
|
+
datastores?: Array<string>;
|
|
638
|
+
/** Optional. Used to specify Vertex AI Search engine. */
|
|
639
|
+
engine?: string;
|
|
640
|
+
}
|
|
641
|
+
}
|
|
642
|
+
/** Citation information for model-generated content. */
|
|
643
|
+
type Annotation = FileCitation | PlaceCitation | SpeechAnnotation | UrlCitation | WordInfo;
|
|
644
|
+
/** An audio content block. */
|
|
645
|
+
interface AudioContent {
|
|
646
|
+
/** The number of audio channels. */
|
|
647
|
+
channels?: number;
|
|
648
|
+
/** The audio content. */
|
|
649
|
+
data?: string;
|
|
650
|
+
/** The mime type of the audio. */
|
|
651
|
+
mime_type?: "audio/wav" | "audio/mp3" | "audio/aiff" | "audio/aac" | "audio/ogg" | "audio/flac" | "audio/mpeg" | "audio/m4a" | "audio/l16" | "audio/opus" | "audio/alaw" | "audio/mulaw" | "audio/webm" | (string & {});
|
|
652
|
+
/** The sample rate of the audio. */
|
|
653
|
+
sample_rate?: number;
|
|
654
|
+
type: unknown;
|
|
655
|
+
/** The URI of the audio. */
|
|
656
|
+
uri?: string;
|
|
657
|
+
}
|
|
658
|
+
/** Configuration for audio output format. */
|
|
659
|
+
interface AudioResponseFormat {
|
|
660
|
+
/**
|
|
661
|
+
* Bit rate in bits per second (bps). Only applicable for compressed formats
|
|
662
|
+
* (MP3, Opus).
|
|
663
|
+
*/
|
|
664
|
+
bit_rate?: number;
|
|
665
|
+
/** The delivery mode for the audio output. */
|
|
666
|
+
delivery?: "inline" | "uri" | (string & {});
|
|
667
|
+
/** The MIME type of the audio output. */
|
|
668
|
+
mime_type?: "audio/mp3" | "audio/ogg_opus" | "audio/l16" | "audio/wav" | "audio/alaw" | "audio/mulaw" | (string & {});
|
|
669
|
+
/** Sample rate in Hz. */
|
|
670
|
+
sample_rate?: number;
|
|
671
|
+
type: unknown;
|
|
672
|
+
}
|
|
673
|
+
/** Code execution call step. */
|
|
674
|
+
interface CodeExecutionCallStep {
|
|
675
|
+
/** The arguments to pass to the code execution. */
|
|
676
|
+
arguments: CodeExecutionCallStepArguments;
|
|
677
|
+
/** Required. A unique ID for this specific tool call. */
|
|
678
|
+
id: string;
|
|
679
|
+
/** A signature hash for backend validation. */
|
|
680
|
+
signature?: string;
|
|
681
|
+
type: unknown;
|
|
682
|
+
}
|
|
683
|
+
/** The arguments to pass to the code execution. */
|
|
684
|
+
interface CodeExecutionCallStepArguments {
|
|
685
|
+
/** The code to be executed. */
|
|
686
|
+
code?: string;
|
|
687
|
+
/** Programming language of the `code`. */
|
|
688
|
+
language?: "python" | (string & {});
|
|
689
|
+
}
|
|
690
|
+
/** Code execution result step. */
|
|
691
|
+
interface CodeExecutionResultStep {
|
|
692
|
+
/** Required. ID to match the ID from the function call block. */
|
|
693
|
+
call_id: string;
|
|
694
|
+
/** Whether the code execution resulted in an error. */
|
|
695
|
+
is_error?: boolean;
|
|
696
|
+
/** Required. The output of the code execution. */
|
|
697
|
+
result: string;
|
|
698
|
+
/** A signature hash for backend validation. */
|
|
699
|
+
signature?: string;
|
|
700
|
+
type: unknown;
|
|
701
|
+
}
|
|
702
|
+
/** The content of the response. */
|
|
703
|
+
type Content = AudioContent | DocumentContent | ImageContent | TextContent | VideoContent;
|
|
704
|
+
/** A document content block. */
|
|
705
|
+
interface DocumentContent {
|
|
706
|
+
/** The document content. */
|
|
707
|
+
data?: string;
|
|
708
|
+
/** The mime type of the document. */
|
|
709
|
+
mime_type?: "application/pdf" | "text/csv" | (string & {});
|
|
710
|
+
type: unknown;
|
|
711
|
+
/** The URI of the document. */
|
|
712
|
+
uri?: string;
|
|
713
|
+
}
|
|
714
|
+
/**
|
|
715
|
+
* A single domain allowlist rule with optional header injection.
|
|
716
|
+
*/
|
|
717
|
+
interface EgressRule {
|
|
718
|
+
/**
|
|
719
|
+
* Optional. Reference to a server-managed Credential resource by ID.
|
|
720
|
+
*/
|
|
721
|
+
credential?: string;
|
|
722
|
+
/**
|
|
723
|
+
* Domain to allow outbound requests to. Supports wildcards (e.g.
|
|
724
|
+
* '*.googleapis.com'). Use '*' to allow all domains.
|
|
725
|
+
*/
|
|
726
|
+
domain: string;
|
|
727
|
+
/**
|
|
728
|
+
* Headers to inject on all outbound requests matching this domain. Accepts a single dict or a list of dicts. The egress proxy injects these automatically.
|
|
729
|
+
*/
|
|
730
|
+
transform?: Array<Record<string, unknown>> | Record<string, unknown>;
|
|
731
|
+
}
|
|
732
|
+
/** Network egress configuration for the environment. */
|
|
733
|
+
interface EnvironmentNetworkEgressAllowlist {
|
|
734
|
+
/**
|
|
735
|
+
* List of allowed domains and their configurations. Set to `"disabled"`
|
|
736
|
+
* to block all network egress.
|
|
737
|
+
*/
|
|
738
|
+
allowlist?: Array<EgressRule> | "disabled" | (string & {});
|
|
739
|
+
}
|
|
740
|
+
/** A file citation annotation. */
|
|
741
|
+
interface FileCitation {
|
|
742
|
+
/** User provided metadata about the retrieved context. */
|
|
743
|
+
custom_metadata?: Record<string, unknown>;
|
|
744
|
+
/** The URI of the file. */
|
|
745
|
+
document_uri?: string;
|
|
746
|
+
/** End of the attributed segment, exclusive. */
|
|
747
|
+
end_index?: number;
|
|
748
|
+
/** The name of the file. */
|
|
749
|
+
file_name?: string;
|
|
750
|
+
/** Media ID in-case of image citations, if applicable. */
|
|
751
|
+
media_id?: string;
|
|
752
|
+
/** Page number of the cited document, if applicable. */
|
|
753
|
+
page_number?: number;
|
|
754
|
+
/** Source attributed for a portion of the text. */
|
|
755
|
+
source?: string;
|
|
756
|
+
/**
|
|
757
|
+
* Start of segment of the response that is attributed to this source.
|
|
758
|
+
*
|
|
759
|
+
* Index indicates the start of the segment, measured in bytes.
|
|
760
|
+
*/
|
|
761
|
+
start_index?: number;
|
|
762
|
+
type: unknown;
|
|
763
|
+
}
|
|
764
|
+
/** Content of a single file in the codebase. */
|
|
765
|
+
interface FileContent {
|
|
766
|
+
/** The UTF-8 encoded text content of the file. */
|
|
767
|
+
content?: string;
|
|
768
|
+
/** The relative path of the file from the project root. */
|
|
769
|
+
path?: string;
|
|
770
|
+
}
|
|
771
|
+
/** File Search call step. */
|
|
772
|
+
interface FileSearchCallStep {
|
|
773
|
+
/** Required. A unique ID for this specific tool call. */
|
|
774
|
+
id: string;
|
|
775
|
+
/** A signature hash for backend validation. */
|
|
776
|
+
signature?: string;
|
|
777
|
+
type: unknown;
|
|
778
|
+
}
|
|
779
|
+
/** File Search result step. */
|
|
780
|
+
interface FileSearchResultStep {
|
|
781
|
+
/** Required. ID to match the ID from the function call block. */
|
|
782
|
+
call_id: string;
|
|
783
|
+
/** A signature hash for backend validation. */
|
|
784
|
+
signature?: string;
|
|
785
|
+
type: unknown;
|
|
786
|
+
}
|
|
787
|
+
/**
|
|
788
|
+
* Request parameters specific to FIND sessions, used for discovering
|
|
789
|
+
* vulnerabilities in a codebase.
|
|
790
|
+
*/
|
|
791
|
+
interface FindRequest {
|
|
792
|
+
/**
|
|
793
|
+
* Additional context or custom instructions provided by the user to guide
|
|
794
|
+
* the vulnerability analysis.
|
|
795
|
+
*/
|
|
796
|
+
description?: string;
|
|
797
|
+
/**
|
|
798
|
+
* The identifier of a specific finding to verify. This is primarily used in
|
|
799
|
+
* VERIFY mode to focus the agent's execution-based validation on a single
|
|
800
|
+
* vulnerability.
|
|
801
|
+
*/
|
|
802
|
+
finding_id?: string;
|
|
803
|
+
/** The mode of the find session. */
|
|
804
|
+
mode?: "scan" | "verify" | (string & {});
|
|
805
|
+
/** A list of source files to provide as context for the scan. */
|
|
806
|
+
source_files?: Array<FileContent>;
|
|
807
|
+
}
|
|
808
|
+
/**
|
|
809
|
+
* Request parameters specific to FIX sessions, used for generating and
|
|
810
|
+
* validating security patches.
|
|
811
|
+
*/
|
|
812
|
+
interface FixRequest {
|
|
813
|
+
/**
|
|
814
|
+
* Additional context or custom instructions provided by the user to guide
|
|
815
|
+
* the patch generation process.
|
|
816
|
+
*/
|
|
817
|
+
description?: string;
|
|
818
|
+
/**
|
|
819
|
+
* The identifier of the specific security finding to be remediated. This ID
|
|
820
|
+
* maps to a previously discovered vulnerability.
|
|
821
|
+
*/
|
|
822
|
+
finding_id?: string;
|
|
823
|
+
/**
|
|
824
|
+
* A list of source files providing context for the remediation. These files
|
|
825
|
+
* are typically the ones containing the identified vulnerability.
|
|
826
|
+
*/
|
|
827
|
+
source_files?: Array<FileContent>;
|
|
828
|
+
}
|
|
829
|
+
/** A function tool call step. */
|
|
830
|
+
interface FunctionCallStep {
|
|
831
|
+
/** Required. The arguments to pass to the function. */
|
|
832
|
+
arguments: Record<string, unknown>;
|
|
833
|
+
/** Required. A unique ID for this specific tool call. */
|
|
834
|
+
id: string;
|
|
835
|
+
/** Required. The name of the tool to call. */
|
|
836
|
+
name: string;
|
|
837
|
+
type: unknown;
|
|
838
|
+
}
|
|
839
|
+
/** Result of a function tool call. */
|
|
840
|
+
interface FunctionResultStep {
|
|
841
|
+
/** Required. ID to match the ID from the function call block. */
|
|
842
|
+
call_id: string;
|
|
843
|
+
/** Whether the tool call resulted in an error. */
|
|
844
|
+
is_error?: boolean;
|
|
845
|
+
/** The name of the tool that was called. */
|
|
846
|
+
name?: string;
|
|
847
|
+
/** Required. The result of the tool call. */
|
|
848
|
+
result: Array<ImageContent | TextContent> | Record<string, unknown> | string;
|
|
849
|
+
type: unknown;
|
|
850
|
+
}
|
|
851
|
+
/** Google Maps call step. */
|
|
852
|
+
interface GoogleMapsCallStep {
|
|
853
|
+
/** The arguments to pass to the Google Maps tool. */
|
|
854
|
+
arguments?: GoogleMapsCallStepArguments;
|
|
855
|
+
/** Required. A unique ID for this specific tool call. */
|
|
856
|
+
id: string;
|
|
857
|
+
/** A signature hash for backend validation. */
|
|
858
|
+
signature?: string;
|
|
859
|
+
type: unknown;
|
|
860
|
+
}
|
|
861
|
+
/** The arguments to pass to the Google Maps tool. */
|
|
862
|
+
interface GoogleMapsCallStepArguments {
|
|
863
|
+
/** The queries to be executed. */
|
|
864
|
+
queries?: Array<string>;
|
|
865
|
+
}
|
|
866
|
+
/** The result of the Google Maps. */
|
|
867
|
+
interface GoogleMapsResultItem {
|
|
868
|
+
places?: Array<GoogleMapsResultPlaces>;
|
|
869
|
+
widget_context_token?: string;
|
|
870
|
+
}
|
|
871
|
+
interface GoogleMapsResultPlaces {
|
|
872
|
+
name?: string;
|
|
873
|
+
place_id?: string;
|
|
874
|
+
review_snippets?: Array<ReviewSnippet>;
|
|
875
|
+
url?: string;
|
|
876
|
+
}
|
|
877
|
+
/** Google Maps result step. */
|
|
878
|
+
interface GoogleMapsResultStep {
|
|
879
|
+
/** Required. ID to match the ID from the function call block. */
|
|
880
|
+
call_id: string;
|
|
881
|
+
result: Array<GoogleMapsResultItem>;
|
|
882
|
+
/** A signature hash for backend validation. */
|
|
883
|
+
signature?: string;
|
|
884
|
+
type: unknown;
|
|
885
|
+
}
|
|
886
|
+
/** Google Search call step. */
|
|
887
|
+
interface GoogleSearchCallStep {
|
|
888
|
+
/** The arguments to pass to Google Search. */
|
|
889
|
+
arguments: GoogleSearchCallStepArguments;
|
|
890
|
+
/** Required. A unique ID for this specific tool call. */
|
|
891
|
+
id: string;
|
|
892
|
+
/** The type of search grounding enabled. */
|
|
893
|
+
search_type?: "web_search" | "image_search" | "enterprise_web_search" | (string & {});
|
|
894
|
+
/** A signature hash for backend validation. */
|
|
895
|
+
signature?: string;
|
|
896
|
+
type: unknown;
|
|
897
|
+
}
|
|
898
|
+
/** The arguments to pass to Google Search. */
|
|
899
|
+
interface GoogleSearchCallStepArguments {
|
|
900
|
+
/** Web search queries for the following-up web search. */
|
|
901
|
+
queries?: Array<string>;
|
|
902
|
+
}
|
|
903
|
+
/** The result of the Google Search. */
|
|
904
|
+
interface GoogleSearchResultItem {
|
|
905
|
+
/**
|
|
906
|
+
* Web content snippet that can be embedded in a web page or an app webview.
|
|
907
|
+
*/
|
|
908
|
+
search_suggestions?: string;
|
|
909
|
+
}
|
|
910
|
+
/** Google Search result step. */
|
|
911
|
+
interface GoogleSearchResultStep {
|
|
912
|
+
/** Required. ID to match the ID from the function call block. */
|
|
913
|
+
call_id: string;
|
|
914
|
+
/** Whether the Google Search resulted in an error. */
|
|
915
|
+
is_error?: boolean;
|
|
916
|
+
/** Required. The results of the Google Search. */
|
|
917
|
+
result: Array<GoogleSearchResultItem>;
|
|
918
|
+
/** A signature hash for backend validation. */
|
|
919
|
+
signature?: string;
|
|
920
|
+
type: unknown;
|
|
921
|
+
}
|
|
922
|
+
/** The number of grounding tool counts. */
|
|
923
|
+
interface GroundingToolCount {
|
|
924
|
+
/** The number of grounding tool counts. */
|
|
925
|
+
count?: number;
|
|
926
|
+
/** The grounding tool type associated with the count. */
|
|
927
|
+
type?: "google_search" | "google_maps" | "retrieval" | (string & {});
|
|
928
|
+
}
|
|
929
|
+
type HarmCategory = "hate_speech" | "dangerous_content" | "harassment" | "sexually_explicit" | "civic_integrity" | "image_hate" | "image_dangerous_content" | "image_harassment" | "image_sexually_explicit" | "jailbreak" | (string & {});
|
|
930
|
+
/** The configuration for image interaction. */
|
|
931
|
+
interface ImageConfig {
|
|
932
|
+
/**
|
|
933
|
+
* The aspect ratio of the image to generate. Supported aspect ratios: 1:1,
|
|
934
|
+
* 2:3, 3:2, 3:4, 4:3, 9:16, 16:9, 21:9.
|
|
935
|
+
*
|
|
936
|
+
* If not specified, the model will choose a default aspect ratio based on any
|
|
937
|
+
* reference images provided.
|
|
938
|
+
*/
|
|
939
|
+
aspect_ratio?: "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" | (string & {});
|
|
940
|
+
/**
|
|
941
|
+
* Specifies the size of generated images. Supported values are `1K`, `2K`,
|
|
942
|
+
* `4K`. If not specified, the model will use default value `1K`.
|
|
943
|
+
*/
|
|
944
|
+
image_size?: "1K" | "2K" | "4K" | "512" | (string & {});
|
|
945
|
+
}
|
|
946
|
+
/** An image content block. */
|
|
947
|
+
interface ImageContent {
|
|
948
|
+
/** The image content. */
|
|
949
|
+
data?: string;
|
|
950
|
+
/** The mime type of the image. */
|
|
951
|
+
mime_type?: "image/png" | "image/jpeg" | "image/webp" | "image/heic" | "image/heif" | "image/gif" | "image/bmp" | "image/tiff" | (string & {});
|
|
952
|
+
resolution?: MediaResolution;
|
|
953
|
+
type: unknown;
|
|
954
|
+
/** The URI of the image. */
|
|
955
|
+
uri?: string;
|
|
956
|
+
}
|
|
957
|
+
/** Configuration for image output format. */
|
|
958
|
+
interface ImageResponseFormat {
|
|
959
|
+
/** The aspect ratio for the image output. */
|
|
960
|
+
aspect_ratio?: "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" | (string & {});
|
|
961
|
+
/** The delivery mode for the image output. */
|
|
962
|
+
delivery?: "inline" | "uri" | (string & {});
|
|
963
|
+
/** The size of the image output. */
|
|
964
|
+
image_size?: "512" | "1K" | "2K" | "4K" | (string & {});
|
|
965
|
+
/** The MIME type of the image output. */
|
|
966
|
+
mime_type?: "image/jpeg" | (string & {});
|
|
967
|
+
type: unknown;
|
|
968
|
+
}
|
|
969
|
+
/** MCPServer tool call step. */
|
|
970
|
+
interface McpServerToolCallStep {
|
|
971
|
+
/** Required. The JSON object of arguments for the function. */
|
|
972
|
+
arguments: Record<string, unknown>;
|
|
973
|
+
/** Required. A unique ID for this specific tool call. */
|
|
974
|
+
id: string;
|
|
975
|
+
/** Required. The name of the tool which was called. */
|
|
976
|
+
name: string;
|
|
977
|
+
/** Required. The name of the used MCP server. */
|
|
978
|
+
server_name: string;
|
|
979
|
+
type: unknown;
|
|
980
|
+
}
|
|
981
|
+
/** MCPServer tool result step. */
|
|
982
|
+
interface McpServerToolResultStep {
|
|
983
|
+
/** Required. ID to match the ID from the function call block. */
|
|
984
|
+
call_id: string;
|
|
985
|
+
/**
|
|
986
|
+
* Name of the tool which is called for this specific tool call.
|
|
987
|
+
*/
|
|
988
|
+
name?: string;
|
|
989
|
+
/**
|
|
990
|
+
* Required. The output from the MCP server call. Can be simple text or rich content.
|
|
991
|
+
*/
|
|
992
|
+
result: Array<ImageContent | TextContent> | Record<string, unknown> | string;
|
|
993
|
+
/** The name of the used MCP server. */
|
|
994
|
+
server_name?: string;
|
|
995
|
+
type: unknown;
|
|
996
|
+
}
|
|
997
|
+
type MediaProcessing = StaticMediaProcessing;
|
|
998
|
+
type MediaResolution = "low" | "medium" | "high" | "ultra_high" | (string & {});
|
|
999
|
+
/** The token count for a single response modality. */
|
|
1000
|
+
interface ModalityTokens {
|
|
1001
|
+
modality?: ResponseModality;
|
|
1002
|
+
/** Number of tokens for the modality. */
|
|
1003
|
+
tokens?: number;
|
|
1004
|
+
}
|
|
1005
|
+
/** Output generated by the model. */
|
|
1006
|
+
interface ModelOutputStep {
|
|
1007
|
+
content?: Array<Content>;
|
|
1008
|
+
/**
|
|
1009
|
+
* The `Status` type defines a logical error model that is suitable for
|
|
1010
|
+
* different programming environments, including REST APIs and RPC APIs. It is
|
|
1011
|
+
* used by [gRPC](https://github.com/grpc). Each `Status` message contains
|
|
1012
|
+
* three pieces of data: error code, error message, and error details.
|
|
1013
|
+
*
|
|
1014
|
+
* You can find out more about this error model and how to work with it in the
|
|
1015
|
+
* [API Design Guide](https://cloud.google.com/apis/design/errors).
|
|
1016
|
+
*/
|
|
1017
|
+
error?: Status;
|
|
1018
|
+
type: unknown;
|
|
1019
|
+
}
|
|
1020
|
+
/** A place citation annotation. */
|
|
1021
|
+
interface PlaceCitation {
|
|
1022
|
+
/** End of the attributed segment, exclusive. */
|
|
1023
|
+
end_index?: number;
|
|
1024
|
+
/** Title of the place. */
|
|
1025
|
+
name?: string;
|
|
1026
|
+
/** The ID of the place, in `places/{place_id}` format. */
|
|
1027
|
+
place_id?: string;
|
|
1028
|
+
/**
|
|
1029
|
+
* Snippets of reviews that are used to generate answers about the
|
|
1030
|
+
* features of a given place in Google Maps.
|
|
1031
|
+
*/
|
|
1032
|
+
review_snippets?: Array<ReviewSnippet>;
|
|
1033
|
+
/**
|
|
1034
|
+
* Start of segment of the response that is attributed to this source.
|
|
1035
|
+
*
|
|
1036
|
+
* Index indicates the start of the segment, measured in bytes.
|
|
1037
|
+
*/
|
|
1038
|
+
start_index?: number;
|
|
1039
|
+
type: unknown;
|
|
1040
|
+
/** URI reference of the place. */
|
|
1041
|
+
url?: string;
|
|
1042
|
+
}
|
|
1043
|
+
/**
|
|
1044
|
+
* A server-initiated processing step for media analysis (e.g. video
|
|
1045
|
+
* understanding).
|
|
1046
|
+
*/
|
|
1047
|
+
interface ProcessingCallStep {
|
|
1048
|
+
/** Required. A unique ID for this specific tool call. */
|
|
1049
|
+
id: string;
|
|
1050
|
+
/** A signature hash for backend validation. */
|
|
1051
|
+
signature?: string;
|
|
1052
|
+
type: unknown;
|
|
1053
|
+
}
|
|
1054
|
+
/** The result of a server-initiated media processing step. */
|
|
1055
|
+
interface ProcessingResultStep {
|
|
1056
|
+
/** Required. ID to match the ID from the function call block. */
|
|
1057
|
+
call_id: string;
|
|
1058
|
+
/** A signature hash for backend validation. */
|
|
1059
|
+
signature?: string;
|
|
1060
|
+
type: unknown;
|
|
1061
|
+
}
|
|
1062
|
+
/**
|
|
1063
|
+
* Retrieval call step.
|
|
1064
|
+
* Used by Vertex Retrieval tools such as Parallel AI, Exa AI, Vertex AI Search,
|
|
1065
|
+
* etc. RetrievalType decides which tool is used.
|
|
1066
|
+
*/
|
|
1067
|
+
interface RetrievalCallStep {
|
|
1068
|
+
/** The arguments to pass to Retrieval tools. */
|
|
1069
|
+
arguments: RetrievalStepArguments;
|
|
1070
|
+
/** Required. A unique ID for this specific tool call. */
|
|
1071
|
+
id: string;
|
|
1072
|
+
/** The type of retrieval tools. */
|
|
1073
|
+
retrieval_type?: "vertex_ai_search" | "rag_store" | "exa_ai_search" | "parallel_ai_search" | (string & {});
|
|
1074
|
+
/** A signature hash for backend validation. */
|
|
1075
|
+
signature?: string;
|
|
1076
|
+
type: unknown;
|
|
1077
|
+
}
|
|
1078
|
+
/**
|
|
1079
|
+
* Vertex Retrieval result step.
|
|
1080
|
+
* Used by Vertex Retrieval tools such as Parallel AI, Exa AI, Vertex AI Search,
|
|
1081
|
+
* etc.
|
|
1082
|
+
*/
|
|
1083
|
+
interface RetrievalResultStep {
|
|
1084
|
+
/** Required. ID to match the ID from the function call block. */
|
|
1085
|
+
call_id: string;
|
|
1086
|
+
/** Whether the retrieval resulted in an error. */
|
|
1087
|
+
is_error?: boolean;
|
|
1088
|
+
/** A signature hash for backend validation. */
|
|
1089
|
+
signature?: string;
|
|
1090
|
+
type: unknown;
|
|
1091
|
+
}
|
|
1092
|
+
/** The arguments to pass to Retrieval tools. */
|
|
1093
|
+
interface RetrievalStepArguments {
|
|
1094
|
+
/** Queries for Retrieval information. */
|
|
1095
|
+
queries?: Array<string>;
|
|
1096
|
+
}
|
|
1097
|
+
/**
|
|
1098
|
+
* Encapsulates a snippet of a user review that answers a question about
|
|
1099
|
+
* the features of a specific place in Google Maps.
|
|
1100
|
+
*/
|
|
1101
|
+
interface ReviewSnippet {
|
|
1102
|
+
/** The ID of the review snippet. */
|
|
1103
|
+
review_id?: string;
|
|
1104
|
+
/** Title of the review. */
|
|
1105
|
+
title?: string;
|
|
1106
|
+
/** A link that corresponds to the user review on Google Maps. */
|
|
1107
|
+
url?: string;
|
|
1108
|
+
}
|
|
1109
|
+
/** The configuration of CodeMender sessions. */
|
|
1110
|
+
interface SessionConfig {
|
|
1111
|
+
/**
|
|
1112
|
+
* The maximum number of interaction rounds the agent is allowed to perform
|
|
1113
|
+
* before reaching a timeout.
|
|
1114
|
+
*/
|
|
1115
|
+
max_rounds?: number;
|
|
1116
|
+
}
|
|
1117
|
+
/** Configuration for smart transcription mode. */
|
|
1118
|
+
interface SmartTranscriptionMode {
|
|
1119
|
+
type: unknown;
|
|
1120
|
+
}
|
|
1121
|
+
/** A source to be mounted into the environment. */
|
|
1122
|
+
interface Source {
|
|
1123
|
+
/** The inline content if `type` is `INLINE`. */
|
|
1124
|
+
content?: string;
|
|
1125
|
+
/** Optional encoding for inline content (e.g. `base64`). */
|
|
1126
|
+
encoding?: string;
|
|
1127
|
+
/**
|
|
1128
|
+
* The source of the environment.
|
|
1129
|
+
* For Cloud Storage, this is the Cloud Storage path.
|
|
1130
|
+
* For GitHub, this is the GitHub path.
|
|
1131
|
+
*/
|
|
1132
|
+
source?: string;
|
|
1133
|
+
/** Where the source should appear in the environment. */
|
|
1134
|
+
target?: string;
|
|
1135
|
+
type?: "gcs" | "inline" | "repository" | "skill_registry" | (string & {});
|
|
1136
|
+
}
|
|
1137
|
+
/** Configuration for multi-speaker and speech generation. */
|
|
1138
|
+
interface SpeakerConfig {
|
|
1139
|
+
/** Individual speaker configurations. */
|
|
1140
|
+
speakers?: Array<SpeechConfig>;
|
|
1141
|
+
}
|
|
1142
|
+
/** Speech annotation for text content. */
|
|
1143
|
+
interface SpeechAnnotation {
|
|
1144
|
+
/** End of the attributed segment, exclusive. */
|
|
1145
|
+
end_index?: number;
|
|
1146
|
+
/** The speaker to associate with this turn. */
|
|
1147
|
+
speaker?: string;
|
|
1148
|
+
/**
|
|
1149
|
+
* Start of segment of the response that is attributed to this source.
|
|
1150
|
+
*
|
|
1151
|
+
* Index indicates the start of the segment, measured in bytes.
|
|
1152
|
+
*/
|
|
1153
|
+
start_index?: number;
|
|
1154
|
+
/** Style instruction for the speech synthesis. */
|
|
1155
|
+
style?: string;
|
|
1156
|
+
type: unknown;
|
|
1157
|
+
}
|
|
1158
|
+
/** The configuration for speech interaction. */
|
|
1159
|
+
interface SpeechConfig {
|
|
1160
|
+
/** The language of the speech. */
|
|
1161
|
+
language?: string;
|
|
1162
|
+
/**
|
|
1163
|
+
* The speaker's name, it should match the speaker name given in the prompt.
|
|
1164
|
+
*/
|
|
1165
|
+
speaker?: string;
|
|
1166
|
+
/** The voice of the speaker. */
|
|
1167
|
+
voice?: string;
|
|
1168
|
+
}
|
|
1169
|
+
interface StaticMediaProcessing {
|
|
1170
|
+
/**
|
|
1171
|
+
* Optional. Segment end time. Specified as a decimal number of seconds followed
|
|
1172
|
+
* by an 's' suffix, e.g., "30s". Must be non-negative and greater than
|
|
1173
|
+
* `start_offset` if `start_offset` is set.
|
|
1174
|
+
*/
|
|
1175
|
+
end_offset?: string;
|
|
1176
|
+
/** Optional. Video frame-rate sampling density. */
|
|
1177
|
+
fps?: number;
|
|
1178
|
+
/**
|
|
1179
|
+
* Optional. Segment start time. Specified as a decimal number of seconds followed
|
|
1180
|
+
* by an 's' suffix, e.g., "10.5s". Must be non-negative.
|
|
1181
|
+
*/
|
|
1182
|
+
start_offset?: string;
|
|
1183
|
+
type: unknown;
|
|
1184
|
+
}
|
|
1185
|
+
/**
|
|
1186
|
+
* The `Status` type defines a logical error model that is suitable for
|
|
1187
|
+
* different programming environments, including REST APIs and RPC APIs. It is
|
|
1188
|
+
* used by [gRPC](https://github.com/grpc). Each `Status` message contains
|
|
1189
|
+
* three pieces of data: error code, error message, and error details.
|
|
1190
|
+
*
|
|
1191
|
+
* You can find out more about this error model and how to work with it in the
|
|
1192
|
+
* [API Design Guide](https://cloud.google.com/apis/design/errors).
|
|
1193
|
+
*/
|
|
1194
|
+
interface Status {
|
|
1195
|
+
/**
|
|
1196
|
+
* The status code, which should be an enum value of google.rpc.Code.
|
|
1197
|
+
*/
|
|
1198
|
+
code?: number;
|
|
1199
|
+
/**
|
|
1200
|
+
* A list of messages that carry the error details. There is a common set of
|
|
1201
|
+
* message types for APIs to use.
|
|
1202
|
+
*/
|
|
1203
|
+
details?: Array<Record<string, unknown>>;
|
|
1204
|
+
/**
|
|
1205
|
+
* A developer-facing error message, which should be in English. Any
|
|
1206
|
+
* user-facing error message should be localized and sent in the
|
|
1207
|
+
* google.rpc.Status.details field, or localized by the client.
|
|
1208
|
+
*/
|
|
1209
|
+
message?: string;
|
|
1210
|
+
}
|
|
1211
|
+
/** A text content block. */
|
|
1212
|
+
interface TextContent {
|
|
1213
|
+
/** Citation information for model-generated content. */
|
|
1214
|
+
annotations?: Array<Annotation>;
|
|
1215
|
+
/** Required. The text content. */
|
|
1216
|
+
text: string;
|
|
1217
|
+
type: unknown;
|
|
1218
|
+
}
|
|
1219
|
+
/** Configuration for text output format. */
|
|
1220
|
+
interface TextResponseFormat {
|
|
1221
|
+
/** The MIME type of the text output. */
|
|
1222
|
+
mime_type?: "application/json" | "text/plain" | (string & {});
|
|
1223
|
+
/**
|
|
1224
|
+
* The JSON schema that the output should conform to. Only applicable when
|
|
1225
|
+
* mime_type is application/json.
|
|
1226
|
+
*/
|
|
1227
|
+
schema?: Record<string, unknown>;
|
|
1228
|
+
type: unknown;
|
|
1229
|
+
}
|
|
1230
|
+
type ThinkingLevel = "minimal" | "low" | "medium" | "high" | (string & {});
|
|
1231
|
+
type ThinkingSummaries = "auto" | "none" | (string & {});
|
|
1232
|
+
type ThoughtContent = ImageContent | TextContent;
|
|
1233
|
+
/** A thought step. */
|
|
1234
|
+
interface ThoughtStep {
|
|
1235
|
+
/** A signature hash for backend validation. */
|
|
1236
|
+
signature?: string;
|
|
1237
|
+
/** A summary of the thought. */
|
|
1238
|
+
summary?: Array<ThoughtContent>;
|
|
1239
|
+
type: unknown;
|
|
1240
|
+
}
|
|
1241
|
+
/** The tool choice configuration containing allowed tools. */
|
|
1242
|
+
interface ToolChoiceConfig {
|
|
1243
|
+
/** The configuration for allowed tools. */
|
|
1244
|
+
allowed_tools?: Interactions.Tools.AllowedTools;
|
|
1245
|
+
}
|
|
1246
|
+
/** Configuration for speech recognition (transcription). */
|
|
1247
|
+
interface TranscriptionConfig {
|
|
1248
|
+
/** Optional. A list of phrases to bias the ASR model towards. */
|
|
1249
|
+
adaptation_phrases?: Array<string>;
|
|
1250
|
+
/**
|
|
1251
|
+
* Optional. A list of custom vocabulary phrases to bias the speech recognition model
|
|
1252
|
+
* toward recognizing specific terms.
|
|
1253
|
+
*/
|
|
1254
|
+
custom_vocabulary?: Array<string>;
|
|
1255
|
+
/**
|
|
1256
|
+
* Optional. Configures speaker diarization. Supported values: "speaker".
|
|
1257
|
+
*/
|
|
1258
|
+
diarization_mode?: string;
|
|
1259
|
+
/**
|
|
1260
|
+
* Optional. BCP-47 language codes providing hints about the languages present in the
|
|
1261
|
+
* audio. If omitted or empty, defaults to automatic language detection.
|
|
1262
|
+
*/
|
|
1263
|
+
language_codes?: Array<string>;
|
|
1264
|
+
/**
|
|
1265
|
+
* Deprecated: use language_codes. BCP-47 language codes providing hints about the languages present in the audio.
|
|
1266
|
+
*/
|
|
1267
|
+
language_hints?: Array<string>;
|
|
1268
|
+
/** Discriminated transcription mode options or enum. */
|
|
1269
|
+
mode?: TranscriptionMode | "verbatim" | "smart" | (string & {});
|
|
1270
|
+
/**
|
|
1271
|
+
* Optional. The granularity of timestamps to include in the transcription output.
|
|
1272
|
+
* Supported values: "word". If empty, no timestamps are generated.
|
|
1273
|
+
*/
|
|
1274
|
+
timestamp_granularities?: Array<string>;
|
|
1275
|
+
}
|
|
1276
|
+
/** Configuration for transcription mode. */
|
|
1277
|
+
type TranscriptionMode = SmartTranscriptionMode | VerbatimTranscriptionMode;
|
|
1278
|
+
/** A URL citation annotation. */
|
|
1279
|
+
interface UrlCitation {
|
|
1280
|
+
/** End of the attributed segment, exclusive. */
|
|
1281
|
+
end_index?: number;
|
|
1282
|
+
/**
|
|
1283
|
+
* Start of segment of the response that is attributed to this source.
|
|
1284
|
+
*
|
|
1285
|
+
* Index indicates the start of the segment, measured in bytes.
|
|
1286
|
+
*/
|
|
1287
|
+
start_index?: number;
|
|
1288
|
+
/** The title of the URL. */
|
|
1289
|
+
title?: string;
|
|
1290
|
+
type: unknown;
|
|
1291
|
+
/** The URL. */
|
|
1292
|
+
url?: string;
|
|
1293
|
+
}
|
|
1294
|
+
/** The arguments to pass to the URL context. */
|
|
1295
|
+
interface UrlContextCallArguments {
|
|
1296
|
+
/** The URLs to fetch. */
|
|
1297
|
+
urls?: Array<string>;
|
|
1298
|
+
}
|
|
1299
|
+
/** URL context call step. */
|
|
1300
|
+
interface UrlContextCallStep {
|
|
1301
|
+
/** The arguments to pass to the URL context. */
|
|
1302
|
+
arguments: UrlContextCallArguments;
|
|
1303
|
+
/** Required. A unique ID for this specific tool call. */
|
|
1304
|
+
id: string;
|
|
1305
|
+
/** A signature hash for backend validation. */
|
|
1306
|
+
signature?: string;
|
|
1307
|
+
type: unknown;
|
|
1308
|
+
}
|
|
1309
|
+
/** The result of the URL context. */
|
|
1310
|
+
interface UrlContextResult {
|
|
1311
|
+
/** The status of the URL retrieval. */
|
|
1312
|
+
status?: "success" | "error" | "paywall" | "unsafe" | (string & {});
|
|
1313
|
+
/** The URL that was fetched. */
|
|
1314
|
+
url?: string;
|
|
1315
|
+
}
|
|
1316
|
+
/** URL context result step. */
|
|
1317
|
+
interface UrlContextResultStep {
|
|
1318
|
+
/** Required. ID to match the ID from the function call block. */
|
|
1319
|
+
call_id: string;
|
|
1320
|
+
/** Whether the URL context resulted in an error. */
|
|
1321
|
+
is_error?: boolean;
|
|
1322
|
+
/** Required. The results of the URL context. */
|
|
1323
|
+
result: Array<UrlContextResult>;
|
|
1324
|
+
/** A signature hash for backend validation. */
|
|
1325
|
+
signature?: string;
|
|
1326
|
+
type: unknown;
|
|
1327
|
+
}
|
|
1328
|
+
/** Input provided by the user. */
|
|
1329
|
+
interface UserInputStep {
|
|
1330
|
+
content?: Array<Content>;
|
|
1331
|
+
type: unknown;
|
|
1332
|
+
}
|
|
1333
|
+
/** Configuration for verbatim transcription mode. */
|
|
1334
|
+
interface VerbatimTranscriptionMode {
|
|
1335
|
+
/**
|
|
1336
|
+
* Optional. Configures speaker diarization. Supported values: "speaker".
|
|
1337
|
+
*/
|
|
1338
|
+
diarization_mode?: string;
|
|
1339
|
+
/**
|
|
1340
|
+
* Optional. The granularity of timestamps to include in the transcription output.
|
|
1341
|
+
* Supported values: "word". If empty, no timestamps are generated.
|
|
1342
|
+
*/
|
|
1343
|
+
timestamp_granularities?: Array<string>;
|
|
1344
|
+
type: unknown;
|
|
1345
|
+
}
|
|
1346
|
+
/** Configuration options for video generation. */
|
|
1347
|
+
interface VideoConfig {
|
|
1348
|
+
/**
|
|
1349
|
+
* Optional task mode for video generation. If not specified, the model
|
|
1350
|
+
* automatically determines the appropriate mode based on the provided text
|
|
1351
|
+
* prompt and input media.
|
|
1352
|
+
*/
|
|
1353
|
+
task?: "text_to_video" | "image_to_video" | "reference_to_video" | "edit" | "extend" | (string & {});
|
|
1354
|
+
}
|
|
1355
|
+
/** A video content block. */
|
|
1356
|
+
interface VideoContent {
|
|
1357
|
+
/** The video content. */
|
|
1358
|
+
data?: string;
|
|
1359
|
+
/** The mime type of the video. */
|
|
1360
|
+
mime_type?: "video/mp4" | "video/mpeg" | "video/mpg" | "video/mov" | "video/avi" | "video/x-flv" | "video/webm" | "video/wmv" | "video/3gpp" | (string & {});
|
|
1361
|
+
/**
|
|
1362
|
+
* A user-defined name for this content block. Can be referenced by the model
|
|
1363
|
+
* in the final response.
|
|
1364
|
+
*/
|
|
1365
|
+
name?: string;
|
|
1366
|
+
/** How the model processes this video for understanding. */
|
|
1367
|
+
processing?: MediaProcessing | "static" | "agentic" | (string & {});
|
|
1368
|
+
resolution?: MediaResolution;
|
|
1369
|
+
type: unknown;
|
|
1370
|
+
/** The URI of the video. */
|
|
1371
|
+
uri?: string;
|
|
1372
|
+
}
|
|
1373
|
+
/** Configuration for video output format. */
|
|
1374
|
+
interface VideoResponseFormat {
|
|
1375
|
+
/** The aspect ratio for the video output. */
|
|
1376
|
+
aspect_ratio?: "16:9" | "9:16" | (string & {});
|
|
1377
|
+
/** The delivery mode for the video output. */
|
|
1378
|
+
delivery?: "inline" | "uri" | (string & {});
|
|
1379
|
+
/** The duration for the video output. */
|
|
1380
|
+
duration?: string;
|
|
1381
|
+
/**
|
|
1382
|
+
* The Cloud Storage URI to store the video output. Required for Vertex if
|
|
1383
|
+
* delivery mode is URI.
|
|
1384
|
+
*/
|
|
1385
|
+
gcs_uri?: string;
|
|
1386
|
+
/** The video output resolution. Defaults to 720p. */
|
|
1387
|
+
resolution?: "360p" | "720p" | "1080p" | "4k" | (string & {});
|
|
1388
|
+
type: unknown;
|
|
1389
|
+
}
|
|
1390
|
+
/**
|
|
1391
|
+
* Word-level ASR annotation for transcription output.
|
|
1392
|
+
* Carries the word text, optional timing, and optional speaker attribution.
|
|
1393
|
+
*/
|
|
1394
|
+
interface WordInfo {
|
|
1395
|
+
/** End of the attributed segment, exclusive. */
|
|
1396
|
+
end_index?: number;
|
|
1397
|
+
/**
|
|
1398
|
+
* End offset in time of the word relative to the start of the audio.
|
|
1399
|
+
* Present when timestamp_granularities contains "word".
|
|
1400
|
+
*/
|
|
1401
|
+
end_offset?: string;
|
|
1402
|
+
/**
|
|
1403
|
+
* Optional. Speaker label for this word (e.g. "spk_1", "spk_2").
|
|
1404
|
+
* Present when diarization_mode is set in TranscriptionConfig.
|
|
1405
|
+
*/
|
|
1406
|
+
speaker?: string;
|
|
1407
|
+
/**
|
|
1408
|
+
* Start of segment of the response that is attributed to this source.
|
|
1409
|
+
*
|
|
1410
|
+
* Index indicates the start of the segment, measured in bytes.
|
|
1411
|
+
*/
|
|
1412
|
+
start_index?: number;
|
|
1413
|
+
/**
|
|
1414
|
+
* Start offset in time of the word relative to the start of the audio.
|
|
1415
|
+
* Present when timestamp_granularities contains "word".
|
|
1416
|
+
*/
|
|
1417
|
+
start_offset?: string;
|
|
1418
|
+
/** The transcribed word. */
|
|
1419
|
+
text?: string;
|
|
1420
|
+
type: unknown;
|
|
1421
|
+
}
|
|
1422
|
+
}
|
|
1423
|
+
//# sourceMappingURL=interactions.d.cts.map
|