@google/genai 1.32.0 → 1.34.0
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/README.md +233 -1
- package/dist/genai.d.ts +2092 -10
- package/dist/index.cjs +2285 -228
- package/dist/index.mjs +2286 -229
- package/dist/index.mjs.map +1 -1
- package/dist/node/index.cjs +2249 -195
- package/dist/node/index.mjs +2250 -196
- package/dist/node/index.mjs.map +1 -1
- package/dist/node/node.d.ts +2092 -10
- package/dist/web/index.mjs +2179 -125
- package/dist/web/index.mjs.map +1 -1
- package/dist/web/web.d.ts +2092 -10
- package/package.json +1 -1
package/dist/web/web.d.ts
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
|
|
1
3
|
import type { Client } from '@modelcontextprotocol/sdk/client/index.js';
|
|
2
4
|
import { GoogleAuthOptions } from 'google-auth-library';
|
|
5
|
+
import { ReadableStream as ReadableStream_2 } from 'stream/web';
|
|
3
6
|
|
|
4
7
|
/** Marks the end of user activity.
|
|
5
8
|
|
|
@@ -63,6 +66,41 @@ export declare enum AdapterSize {
|
|
|
63
66
|
ADAPTER_SIZE_THIRTY_TWO = "ADAPTER_SIZE_THIRTY_TWO"
|
|
64
67
|
}
|
|
65
68
|
|
|
69
|
+
/**
|
|
70
|
+
* The configuration for allowed tools.
|
|
71
|
+
*/
|
|
72
|
+
declare interface AllowedTools {
|
|
73
|
+
/**
|
|
74
|
+
* The mode of the tool choice.
|
|
75
|
+
*/
|
|
76
|
+
mode?: ToolChoiceType;
|
|
77
|
+
/**
|
|
78
|
+
* The names of the allowed tools.
|
|
79
|
+
*/
|
|
80
|
+
tools?: Array<string>;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* Citation information for model-generated content.
|
|
85
|
+
*/
|
|
86
|
+
declare interface Annotation {
|
|
87
|
+
/**
|
|
88
|
+
* End of the attributed segment, exclusive.
|
|
89
|
+
*/
|
|
90
|
+
end_index?: number;
|
|
91
|
+
/**
|
|
92
|
+
* Source attributed for a portion of the text. Could be a URL, title, or
|
|
93
|
+
* other identifier.
|
|
94
|
+
*/
|
|
95
|
+
source?: string;
|
|
96
|
+
/**
|
|
97
|
+
* Start of segment of the response that is attributed to this source.
|
|
98
|
+
*
|
|
99
|
+
* Index indicates the start of the segment, measured in bytes.
|
|
100
|
+
*/
|
|
101
|
+
start_index?: number;
|
|
102
|
+
}
|
|
103
|
+
|
|
66
104
|
/** The generic reusable api auth config. Deprecated. Please use AuthConfig (google/cloud/aiplatform/master/auth.proto) instead. This data type is not supported in Gemini API. */
|
|
67
105
|
export declare interface ApiAuth {
|
|
68
106
|
/** The API secret. */
|
|
@@ -81,7 +119,7 @@ export declare interface ApiAuthApiKeyConfig {
|
|
|
81
119
|
* The ApiClient class is used to send requests to the Gemini API or Vertex AI
|
|
82
120
|
* endpoints.
|
|
83
121
|
*/
|
|
84
|
-
declare class ApiClient {
|
|
122
|
+
declare class ApiClient implements GeminiNextGenAPIClientAdapter {
|
|
85
123
|
readonly clientOptions: ApiClientInitOptions;
|
|
86
124
|
constructor(opts: ApiClientInitOptions);
|
|
87
125
|
/**
|
|
@@ -102,6 +140,7 @@ declare class ApiClient {
|
|
|
102
140
|
isVertexAI(): boolean;
|
|
103
141
|
getProject(): string | undefined;
|
|
104
142
|
getLocation(): string | undefined;
|
|
143
|
+
getAuthHeaders(): Promise<Headers>;
|
|
105
144
|
getApiVersion(): string;
|
|
106
145
|
getBaseUrl(): string;
|
|
107
146
|
getRequestUrl(): string;
|
|
@@ -217,6 +256,31 @@ declare interface ApiClientInitOptions {
|
|
|
217
256
|
userAgentExtra?: string;
|
|
218
257
|
}
|
|
219
258
|
|
|
259
|
+
declare class APIConnectionError extends APIError<undefined, undefined, undefined> {
|
|
260
|
+
constructor({ message, cause }: {
|
|
261
|
+
message?: string | undefined;
|
|
262
|
+
cause?: Error | undefined;
|
|
263
|
+
});
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
declare class APIConnectionTimeoutError extends APIConnectionError {
|
|
267
|
+
constructor({ message }?: {
|
|
268
|
+
message?: string;
|
|
269
|
+
});
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
declare class APIError<TStatus extends number | undefined = number | undefined, THeaders extends Headers | undefined = Headers | undefined, TError extends Object | undefined = Object | undefined> extends GeminiNextGenAPIClientError {
|
|
273
|
+
/** HTTP status for the response that caused the error */
|
|
274
|
+
readonly status: TStatus;
|
|
275
|
+
/** HTTP headers for the response that caused the error */
|
|
276
|
+
readonly headers: THeaders;
|
|
277
|
+
/** JSON body of the response that caused the error */
|
|
278
|
+
readonly error: TError;
|
|
279
|
+
constructor(status: TStatus, error: TError, message: string | undefined, headers: THeaders);
|
|
280
|
+
private static makeMessage;
|
|
281
|
+
static generate(status: number | undefined, errorResponse: Object | undefined, message: string | undefined, headers: Headers | undefined): APIError;
|
|
282
|
+
}
|
|
283
|
+
|
|
220
284
|
/**
|
|
221
285
|
* API errors raised by the GenAI API.
|
|
222
286
|
*/
|
|
@@ -253,6 +317,68 @@ export declare interface ApiKeyConfig {
|
|
|
253
317
|
name?: string;
|
|
254
318
|
}
|
|
255
319
|
|
|
320
|
+
/**
|
|
321
|
+
* A subclass of `Promise` providing additional helper methods
|
|
322
|
+
* for interacting with the SDK.
|
|
323
|
+
*/
|
|
324
|
+
declare class APIPromise<T> extends Promise<T> {
|
|
325
|
+
private responsePromise;
|
|
326
|
+
private parseResponse;
|
|
327
|
+
private parsedPromise;
|
|
328
|
+
private client;
|
|
329
|
+
constructor(client: BaseGeminiNextGenAPIClient, responsePromise: Promise<APIResponseProps>, parseResponse?: (client: BaseGeminiNextGenAPIClient, props: APIResponseProps) => PromiseOrValue<T>);
|
|
330
|
+
_thenUnwrap<U>(transform: (data: T, props: APIResponseProps) => U): APIPromise<U>;
|
|
331
|
+
/**
|
|
332
|
+
* Gets the raw `Response` instance instead of parsing the response
|
|
333
|
+
* data.
|
|
334
|
+
*
|
|
335
|
+
* If you want to parse the response body but still get the `Response`
|
|
336
|
+
* instance, you can use {@link withResponse()}.
|
|
337
|
+
*
|
|
338
|
+
* 👋 Getting the wrong TypeScript type for `Response`?
|
|
339
|
+
* Try setting `"moduleResolution": "NodeNext"` or add `"lib": ["DOM"]`
|
|
340
|
+
* to your `tsconfig.json`.
|
|
341
|
+
*/
|
|
342
|
+
asResponse(): Promise<Response>;
|
|
343
|
+
/**
|
|
344
|
+
* Gets the parsed response data and the raw `Response` instance.
|
|
345
|
+
*
|
|
346
|
+
* If you just want to get the raw `Response` instance without parsing it,
|
|
347
|
+
* you can use {@link asResponse()}.
|
|
348
|
+
*
|
|
349
|
+
* 👋 Getting the wrong TypeScript type for `Response`?
|
|
350
|
+
* Try setting `"moduleResolution": "NodeNext"` or add `"lib": ["DOM"]`
|
|
351
|
+
* to your `tsconfig.json`.
|
|
352
|
+
*/
|
|
353
|
+
withResponse(): Promise<{
|
|
354
|
+
data: T;
|
|
355
|
+
response: Response;
|
|
356
|
+
}>;
|
|
357
|
+
private parse;
|
|
358
|
+
then<TResult1 = T, TResult2 = never>(onfulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | undefined | null): Promise<TResult1 | TResult2>;
|
|
359
|
+
catch<TResult = never>(onrejected?: ((reason: any) => TResult | PromiseLike<TResult>) | undefined | null): Promise<T | TResult>;
|
|
360
|
+
finally(onfinally?: (() => void) | undefined | null): Promise<T>;
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
declare abstract class APIResource {
|
|
364
|
+
/**
|
|
365
|
+
* The key path from the client. For example, a resource accessible as `client.resource.subresource` would
|
|
366
|
+
* have a property `static override readonly _key = Object.freeze(['resource', 'subresource'] as const);`.
|
|
367
|
+
*/
|
|
368
|
+
static readonly _key: readonly string[];
|
|
369
|
+
protected _client: BaseGeminiNextGenAPIClient;
|
|
370
|
+
constructor(client: BaseGeminiNextGenAPIClient);
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
declare type APIResponseProps = {
|
|
374
|
+
response: Response;
|
|
375
|
+
options: FinalRequestOptions;
|
|
376
|
+
controller: AbortController;
|
|
377
|
+
requestLogID: string;
|
|
378
|
+
retryOfRequestLogID: string | undefined;
|
|
379
|
+
startTime: number;
|
|
380
|
+
};
|
|
381
|
+
|
|
256
382
|
/** The API spec that the external API implements. This enum is not supported in Gemini API. */
|
|
257
383
|
export declare enum ApiSpec {
|
|
258
384
|
/**
|
|
@@ -269,6 +395,12 @@ export declare enum ApiSpec {
|
|
|
269
395
|
ELASTIC_SEARCH = "ELASTIC_SEARCH"
|
|
270
396
|
}
|
|
271
397
|
|
|
398
|
+
declare class APIUserAbortError extends APIError<undefined, undefined, undefined> {
|
|
399
|
+
constructor({ message }?: {
|
|
400
|
+
message?: string;
|
|
401
|
+
});
|
|
402
|
+
}
|
|
403
|
+
|
|
272
404
|
/** Representation of an audio chunk. */
|
|
273
405
|
export declare interface AudioChunk {
|
|
274
406
|
/** Raw bytes of audio data.
|
|
@@ -280,6 +412,24 @@ export declare interface AudioChunk {
|
|
|
280
412
|
sourceMetadata?: LiveMusicSourceMetadata;
|
|
281
413
|
}
|
|
282
414
|
|
|
415
|
+
/**
|
|
416
|
+
* An audio content block.
|
|
417
|
+
*/
|
|
418
|
+
declare interface AudioContent {
|
|
419
|
+
type: 'audio';
|
|
420
|
+
data?: string;
|
|
421
|
+
/**
|
|
422
|
+
* The mime type of the audio.
|
|
423
|
+
*/
|
|
424
|
+
mime_type?: AudioMimeType;
|
|
425
|
+
uri?: string;
|
|
426
|
+
}
|
|
427
|
+
|
|
428
|
+
/**
|
|
429
|
+
* The mime type of the audio.
|
|
430
|
+
*/
|
|
431
|
+
declare type AudioMimeType = 'audio/wav' | 'audio/mp3' | 'audio/aiff' | 'audio/aac' | 'audio/ogg' | 'audio/flac' | (string & {});
|
|
432
|
+
|
|
283
433
|
/** The audio transcription configuration in Setup. */
|
|
284
434
|
export declare interface AudioTranscriptionConfig {
|
|
285
435
|
}
|
|
@@ -346,6 +496,9 @@ export declare interface AuthConfigOidcConfig {
|
|
|
346
496
|
serviceAccount?: string;
|
|
347
497
|
}
|
|
348
498
|
|
|
499
|
+
declare class AuthenticationError extends APIError<401, Headers> {
|
|
500
|
+
}
|
|
501
|
+
|
|
349
502
|
/** Config for auth_tokens.create parameters. */
|
|
350
503
|
export declare interface AuthToken {
|
|
351
504
|
/** The name of the auth token. */
|
|
@@ -417,6 +570,259 @@ export declare interface AutomaticFunctionCallingConfig {
|
|
|
417
570
|
ignoreCallHistory?: boolean;
|
|
418
571
|
}
|
|
419
572
|
|
|
573
|
+
declare class BadRequestError extends APIError<400, Headers> {
|
|
574
|
+
}
|
|
575
|
+
|
|
576
|
+
declare interface BaseCreateAgentInteractionParams {
|
|
577
|
+
/**
|
|
578
|
+
* Body param: The name of the `Agent` used for generating the interaction.
|
|
579
|
+
*/
|
|
580
|
+
agent: (string & {}) | 'deep-research-pro-preview-12-2025';
|
|
581
|
+
/**
|
|
582
|
+
* Body param: The inputs for the interaction.
|
|
583
|
+
*/
|
|
584
|
+
input: string | Array<TextContent | ImageContent | AudioContent | DocumentContent | VideoContent | ThoughtContent | FunctionCallContent | FunctionResultContent | CodeExecutionCallContent | CodeExecutionResultContent | URLContextCallContent | URLContextResultContent | GoogleSearchCallContent | GoogleSearchResultContent | MCPServerToolCallContent | MCPServerToolResultContent | FileSearchResultContent> | Array<Turn> | TextContent | ImageContent | AudioContent | DocumentContent | VideoContent | ThoughtContent | FunctionCallContent | FunctionResultContent | CodeExecutionCallContent | CodeExecutionResultContent | URLContextCallContent | URLContextResultContent | GoogleSearchCallContent | GoogleSearchResultContent | MCPServerToolCallContent | MCPServerToolResultContent | FileSearchResultContent;
|
|
585
|
+
/**
|
|
586
|
+
* Path param: Which version of the API to use.
|
|
587
|
+
*/
|
|
588
|
+
api_version?: string;
|
|
589
|
+
/**
|
|
590
|
+
* Body param: Configuration for the agent.
|
|
591
|
+
*/
|
|
592
|
+
agent_config?: DynamicAgentConfig | DeepResearchAgentConfig;
|
|
593
|
+
/**
|
|
594
|
+
* Body param: Whether to run the model interaction in the background.
|
|
595
|
+
*/
|
|
596
|
+
background?: boolean;
|
|
597
|
+
/**
|
|
598
|
+
* Body param: The ID of the previous interaction, if any.
|
|
599
|
+
*/
|
|
600
|
+
previous_interaction_id?: string;
|
|
601
|
+
/**
|
|
602
|
+
* Body param: Enforces that the generated response is a JSON object that complies with
|
|
603
|
+
* the JSON schema specified in this field.
|
|
604
|
+
*/
|
|
605
|
+
response_format?: unknown;
|
|
606
|
+
/**
|
|
607
|
+
* Body param: The mime type of the response. This is required if response_format is set.
|
|
608
|
+
*/
|
|
609
|
+
response_mime_type?: string;
|
|
610
|
+
/**
|
|
611
|
+
* Body param: The requested modalities of the response (TEXT, IMAGE, AUDIO).
|
|
612
|
+
*/
|
|
613
|
+
response_modalities?: Array<'text' | 'image' | 'audio'>;
|
|
614
|
+
/**
|
|
615
|
+
* Body param: Input only. Whether to store the response and request for later retrieval.
|
|
616
|
+
*/
|
|
617
|
+
store?: boolean;
|
|
618
|
+
/**
|
|
619
|
+
* Body param: Input only. Whether the interaction will be streamed.
|
|
620
|
+
*/
|
|
621
|
+
stream?: boolean;
|
|
622
|
+
/**
|
|
623
|
+
* Body param: System instruction for the interaction.
|
|
624
|
+
*/
|
|
625
|
+
system_instruction?: string;
|
|
626
|
+
/**
|
|
627
|
+
* Body param: A list of tool declarations the model may call during interaction.
|
|
628
|
+
*/
|
|
629
|
+
tools?: Array<Tool_2>;
|
|
630
|
+
}
|
|
631
|
+
|
|
632
|
+
declare interface BaseCreateModelInteractionParams {
|
|
633
|
+
/**
|
|
634
|
+
* Body param: The inputs for the interaction.
|
|
635
|
+
*/
|
|
636
|
+
input: string | Array<TextContent | ImageContent | AudioContent | DocumentContent | VideoContent | ThoughtContent | FunctionCallContent | FunctionResultContent | CodeExecutionCallContent | CodeExecutionResultContent | URLContextCallContent | URLContextResultContent | GoogleSearchCallContent | GoogleSearchResultContent | MCPServerToolCallContent | MCPServerToolResultContent | FileSearchResultContent> | Array<Turn> | TextContent | ImageContent | AudioContent | DocumentContent | VideoContent | ThoughtContent | FunctionCallContent | FunctionResultContent | CodeExecutionCallContent | CodeExecutionResultContent | URLContextCallContent | URLContextResultContent | GoogleSearchCallContent | GoogleSearchResultContent | MCPServerToolCallContent | MCPServerToolResultContent | FileSearchResultContent;
|
|
637
|
+
/**
|
|
638
|
+
* Body param: The name of the `Model` used for generating the interaction.
|
|
639
|
+
*/
|
|
640
|
+
model: Model_2;
|
|
641
|
+
/**
|
|
642
|
+
* Path param: Which version of the API to use.
|
|
643
|
+
*/
|
|
644
|
+
api_version?: string;
|
|
645
|
+
/**
|
|
646
|
+
* Body param: Whether to run the model interaction in the background.
|
|
647
|
+
*/
|
|
648
|
+
background?: boolean;
|
|
649
|
+
/**
|
|
650
|
+
* Body param: Input only. Configuration parameters for the model interaction.
|
|
651
|
+
*/
|
|
652
|
+
generation_config?: GenerationConfig_2;
|
|
653
|
+
/**
|
|
654
|
+
* Body param: The ID of the previous interaction, if any.
|
|
655
|
+
*/
|
|
656
|
+
previous_interaction_id?: string;
|
|
657
|
+
/**
|
|
658
|
+
* Body param: Enforces that the generated response is a JSON object that complies with
|
|
659
|
+
* the JSON schema specified in this field.
|
|
660
|
+
*/
|
|
661
|
+
response_format?: unknown;
|
|
662
|
+
/**
|
|
663
|
+
* Body param: The mime type of the response. This is required if response_format is set.
|
|
664
|
+
*/
|
|
665
|
+
response_mime_type?: string;
|
|
666
|
+
/**
|
|
667
|
+
* Body param: The requested modalities of the response (TEXT, IMAGE, AUDIO).
|
|
668
|
+
*/
|
|
669
|
+
response_modalities?: Array<'text' | 'image' | 'audio'>;
|
|
670
|
+
/**
|
|
671
|
+
* Body param: Input only. Whether to store the response and request for later retrieval.
|
|
672
|
+
*/
|
|
673
|
+
store?: boolean;
|
|
674
|
+
/**
|
|
675
|
+
* Body param: Input only. Whether the interaction will be streamed.
|
|
676
|
+
*/
|
|
677
|
+
stream?: boolean;
|
|
678
|
+
/**
|
|
679
|
+
* Body param: System instruction for the interaction.
|
|
680
|
+
*/
|
|
681
|
+
system_instruction?: string;
|
|
682
|
+
/**
|
|
683
|
+
* Body param: A list of tool declarations the model may call during interaction.
|
|
684
|
+
*/
|
|
685
|
+
tools?: Array<Tool_2>;
|
|
686
|
+
}
|
|
687
|
+
|
|
688
|
+
/**
|
|
689
|
+
* Base class for Gemini Next Gen API API clients.
|
|
690
|
+
*/
|
|
691
|
+
declare class BaseGeminiNextGenAPIClient {
|
|
692
|
+
apiKey: string | null;
|
|
693
|
+
apiVersion: string;
|
|
694
|
+
baseURL: string;
|
|
695
|
+
maxRetries: number;
|
|
696
|
+
timeout: number;
|
|
697
|
+
logger: Logger;
|
|
698
|
+
logLevel: LogLevel | undefined;
|
|
699
|
+
fetchOptions: MergedRequestInit | undefined;
|
|
700
|
+
private fetch;
|
|
701
|
+
private encoder;
|
|
702
|
+
protected idempotencyHeader?: string;
|
|
703
|
+
private _options;
|
|
704
|
+
private clientAdapter;
|
|
705
|
+
/**
|
|
706
|
+
* API Client for interfacing with the Gemini Next Gen API API.
|
|
707
|
+
*
|
|
708
|
+
* @param {string | null | undefined} [opts.apiKey=process.env['GEMINI_API_KEY'] ?? null]
|
|
709
|
+
* @param {string | undefined} [opts.apiVersion=v1beta]
|
|
710
|
+
* @param {string} [opts.baseURL=process.env['GEMINI_NEXT_GEN_API_BASE_URL'] ?? https://generativelanguage.googleapis.com] - Override the default base URL for the API.
|
|
711
|
+
* @param {number} [opts.timeout=1 minute] - The maximum amount of time (in milliseconds) the client will wait for a response before timing out.
|
|
712
|
+
* @param {MergedRequestInit} [opts.fetchOptions] - Additional `RequestInit` options to be passed to `fetch` calls.
|
|
713
|
+
* @param {Fetch} [opts.fetch] - Specify a custom `fetch` function implementation.
|
|
714
|
+
* @param {number} [opts.maxRetries=2] - The maximum number of times the client will retry a request.
|
|
715
|
+
* @param {HeadersLike} opts.defaultHeaders - Default headers to include with every request to the API.
|
|
716
|
+
* @param {Record<string, string | undefined>} opts.defaultQuery - Default query parameters to include with every request to the API.
|
|
717
|
+
*/
|
|
718
|
+
constructor({ baseURL, apiKey, apiVersion, ...opts }: ClientOptions);
|
|
719
|
+
/**
|
|
720
|
+
* Create a new client instance re-using the same options given to the current client with optional overriding.
|
|
721
|
+
*/
|
|
722
|
+
withOptions(options: Partial<ClientOptions>): this;
|
|
723
|
+
/**
|
|
724
|
+
* Check whether the base URL is set to its default.
|
|
725
|
+
*/
|
|
726
|
+
private baseURLOverridden;
|
|
727
|
+
protected defaultQuery(): Record<string, string | undefined> | undefined;
|
|
728
|
+
protected validateHeaders({ values, nulls }: NullableHeaders): void;
|
|
729
|
+
protected authHeaders(opts: FinalRequestOptions): Promise<NullableHeaders | undefined>;
|
|
730
|
+
/**
|
|
731
|
+
* Basic re-implementation of `qs.stringify` for primitive types.
|
|
732
|
+
*/
|
|
733
|
+
protected stringifyQuery(query: Record<string, unknown>): string;
|
|
734
|
+
private getUserAgent;
|
|
735
|
+
protected defaultIdempotencyKey(): string;
|
|
736
|
+
protected makeStatusError(status: number, error: Object, message: string | undefined, headers: Headers): Errors.APIError;
|
|
737
|
+
buildURL(path: string, query: Record<string, unknown> | null | undefined, defaultBaseURL?: string | undefined): string;
|
|
738
|
+
/**
|
|
739
|
+
* Used as a callback for mutating the given `FinalRequestOptions` object.
|
|
740
|
+
|
|
741
|
+
*/
|
|
742
|
+
protected prepareOptions(options: FinalRequestOptions): Promise<void>;
|
|
743
|
+
/**
|
|
744
|
+
* Used as a callback for mutating the given `RequestInit` object.
|
|
745
|
+
*
|
|
746
|
+
* This is useful for cases where you want to add certain headers based off of
|
|
747
|
+
* the request properties, e.g. `method` or `url`.
|
|
748
|
+
*/
|
|
749
|
+
protected prepareRequest(request: _RequestInit, { url, options }: {
|
|
750
|
+
url: string;
|
|
751
|
+
options: FinalRequestOptions;
|
|
752
|
+
}): Promise<void>;
|
|
753
|
+
get<Rsp>(path: string, opts?: PromiseOrValue<RequestOptions>): APIPromise<Rsp>;
|
|
754
|
+
post<Rsp>(path: string, opts?: PromiseOrValue<RequestOptions>): APIPromise<Rsp>;
|
|
755
|
+
patch<Rsp>(path: string, opts?: PromiseOrValue<RequestOptions>): APIPromise<Rsp>;
|
|
756
|
+
put<Rsp>(path: string, opts?: PromiseOrValue<RequestOptions>): APIPromise<Rsp>;
|
|
757
|
+
delete<Rsp>(path: string, opts?: PromiseOrValue<RequestOptions>): APIPromise<Rsp>;
|
|
758
|
+
private methodRequest;
|
|
759
|
+
request<Rsp>(options: PromiseOrValue<FinalRequestOptions>, remainingRetries?: number | null): APIPromise<Rsp>;
|
|
760
|
+
private makeRequest;
|
|
761
|
+
fetchWithTimeout(url: _RequestInfo, init: _RequestInit | undefined, ms: number, controller: AbortController): Promise<Response>;
|
|
762
|
+
private shouldRetry;
|
|
763
|
+
private retryRequest;
|
|
764
|
+
private calculateDefaultRetryTimeoutMillis;
|
|
765
|
+
buildRequest(inputOptions: FinalRequestOptions, { retryCount }?: {
|
|
766
|
+
retryCount?: number;
|
|
767
|
+
}): Promise<{
|
|
768
|
+
req: FinalizedRequestInit;
|
|
769
|
+
url: string;
|
|
770
|
+
timeout: number;
|
|
771
|
+
}>;
|
|
772
|
+
private buildHeaders;
|
|
773
|
+
private buildBody;
|
|
774
|
+
static DEFAULT_TIMEOUT: number;
|
|
775
|
+
}
|
|
776
|
+
|
|
777
|
+
declare class BaseInteractions extends APIResource {
|
|
778
|
+
static readonly _key: readonly ['interactions'];
|
|
779
|
+
/**
|
|
780
|
+
* Creates a new interaction.
|
|
781
|
+
*
|
|
782
|
+
* @example
|
|
783
|
+
* ```ts
|
|
784
|
+
* const interaction = await client.interactions.create({
|
|
785
|
+
* input: 'string',
|
|
786
|
+
* model: 'gemini-2.5-pro',
|
|
787
|
+
* });
|
|
788
|
+
* ```
|
|
789
|
+
*/
|
|
790
|
+
create(params: CreateModelInteractionParamsNonStreaming, options?: RequestOptions): APIPromise<Interaction>;
|
|
791
|
+
create(params: CreateModelInteractionParamsStreaming, options?: RequestOptions): APIPromise<Stream<InteractionSSEEvent>>;
|
|
792
|
+
create(params: CreateAgentInteractionParamsNonStreaming, options?: RequestOptions): APIPromise<Interaction>;
|
|
793
|
+
create(params: CreateAgentInteractionParamsStreaming, options?: RequestOptions): APIPromise<Stream<InteractionSSEEvent>>;
|
|
794
|
+
create(params: BaseCreateModelInteractionParams | BaseCreateAgentInteractionParams, options?: RequestOptions): APIPromise<Stream<InteractionSSEEvent> | Interaction>;
|
|
795
|
+
/**
|
|
796
|
+
* Deletes the interaction by id.
|
|
797
|
+
*
|
|
798
|
+
* @example
|
|
799
|
+
* ```ts
|
|
800
|
+
* const interaction = await client.interactions.delete('id');
|
|
801
|
+
* ```
|
|
802
|
+
*/
|
|
803
|
+
delete(id: string, params?: InteractionDeleteParams | null | undefined, options?: RequestOptions): APIPromise<unknown>;
|
|
804
|
+
/**
|
|
805
|
+
* Cancels an interaction by id. This only applies to background interactions that are still running.
|
|
806
|
+
*
|
|
807
|
+
* @example
|
|
808
|
+
* ```ts
|
|
809
|
+
* const interaction = await client.interactions.cancel('id');
|
|
810
|
+
* ```
|
|
811
|
+
*/
|
|
812
|
+
cancel(id: string, params?: InteractionCancelParams | null | undefined, options?: RequestOptions): APIPromise<Interaction>;
|
|
813
|
+
/**
|
|
814
|
+
* Retrieves the full details of a single interaction based on its `Interaction.id`.
|
|
815
|
+
*
|
|
816
|
+
* @example
|
|
817
|
+
* ```ts
|
|
818
|
+
* const interaction = await client.interactions.get('id');
|
|
819
|
+
* ```
|
|
820
|
+
*/
|
|
821
|
+
get(id: string, params?: InteractionGetParamsNonStreaming, options?: RequestOptions): APIPromise<Interaction>;
|
|
822
|
+
get(id: string, params: InteractionGetParamsStreaming, options?: RequestOptions): APIPromise<Stream<InteractionSSEEvent>>;
|
|
823
|
+
get(id: string, params?: InteractionGetParamsBase | undefined, options?: RequestOptions): APIPromise<Stream<InteractionSSEEvent> | Interaction>;
|
|
824
|
+
}
|
|
825
|
+
|
|
420
826
|
/**
|
|
421
827
|
* @license
|
|
422
828
|
* Copyright 2025 Google LLC
|
|
@@ -705,6 +1111,11 @@ export declare enum BlockedReason {
|
|
|
705
1111
|
JAILBREAK = "JAILBREAK"
|
|
706
1112
|
}
|
|
707
1113
|
|
|
1114
|
+
declare const brand_privateNullableHeaders: unique symbol;
|
|
1115
|
+
|
|
1116
|
+
/** @ts-ignore For users with \@types/bun */
|
|
1117
|
+
declare type BunRequestInit = globalThis.FetchRequestInit;
|
|
1118
|
+
|
|
708
1119
|
/** A resource used in LLM queries for users to explicitly specify what to cache. */
|
|
709
1120
|
export declare interface CachedContent {
|
|
710
1121
|
/** The server-generated resource name of the cached content. */
|
|
@@ -1101,6 +1512,107 @@ export declare interface CitationMetadata {
|
|
|
1101
1512
|
citations?: Citation[];
|
|
1102
1513
|
}
|
|
1103
1514
|
|
|
1515
|
+
declare interface ClientOptions {
|
|
1516
|
+
/**
|
|
1517
|
+
* Defaults to process.env['GEMINI_API_KEY'].
|
|
1518
|
+
*/
|
|
1519
|
+
apiKey?: string | null | undefined;
|
|
1520
|
+
apiVersion?: string | undefined;
|
|
1521
|
+
/**
|
|
1522
|
+
* Override the default base URL for the API, e.g., "https://api.example.com/v2/"
|
|
1523
|
+
*
|
|
1524
|
+
* Defaults to process.env['GEMINI_NEXT_GEN_API_BASE_URL'].
|
|
1525
|
+
*/
|
|
1526
|
+
baseURL?: string | null | undefined;
|
|
1527
|
+
/**
|
|
1528
|
+
* The maximum amount of time (in milliseconds) that the client should wait for a response
|
|
1529
|
+
* from the server before timing out a single request.
|
|
1530
|
+
*
|
|
1531
|
+
* Note that request timeouts are retried by default, so in a worst-case scenario you may wait
|
|
1532
|
+
* much longer than this timeout before the promise succeeds or fails.
|
|
1533
|
+
*
|
|
1534
|
+
* @unit milliseconds
|
|
1535
|
+
*/
|
|
1536
|
+
timeout?: number | undefined;
|
|
1537
|
+
/**
|
|
1538
|
+
* Additional `RequestInit` options to be passed to `fetch` calls.
|
|
1539
|
+
* Properties will be overridden by per-request `fetchOptions`.
|
|
1540
|
+
*/
|
|
1541
|
+
fetchOptions?: MergedRequestInit | undefined;
|
|
1542
|
+
/**
|
|
1543
|
+
* Specify a custom `fetch` function implementation.
|
|
1544
|
+
*
|
|
1545
|
+
* If not provided, we expect that `fetch` is defined globally.
|
|
1546
|
+
*/
|
|
1547
|
+
fetch?: Fetch | undefined;
|
|
1548
|
+
/**
|
|
1549
|
+
* The maximum number of times that the client will retry a request in case of a
|
|
1550
|
+
* temporary failure, like a network error or a 5XX error from the server.
|
|
1551
|
+
*
|
|
1552
|
+
* @default 2
|
|
1553
|
+
*/
|
|
1554
|
+
maxRetries?: number | undefined;
|
|
1555
|
+
/**
|
|
1556
|
+
* Default headers to include with every request to the API.
|
|
1557
|
+
*
|
|
1558
|
+
* These can be removed in individual requests by explicitly setting the
|
|
1559
|
+
* header to `null` in request options.
|
|
1560
|
+
*/
|
|
1561
|
+
defaultHeaders?: HeadersLike | undefined;
|
|
1562
|
+
/**
|
|
1563
|
+
* Default query parameters to include with every request to the API.
|
|
1564
|
+
*
|
|
1565
|
+
* These can be removed in individual requests by explicitly setting the
|
|
1566
|
+
* param to `undefined` in request options.
|
|
1567
|
+
*/
|
|
1568
|
+
defaultQuery?: Record<string, string | undefined> | undefined;
|
|
1569
|
+
/**
|
|
1570
|
+
* Set the log level.
|
|
1571
|
+
*
|
|
1572
|
+
* Defaults to process.env['GEMINI_NEXT_GEN_API_LOG'] or 'warn' if it isn't set.
|
|
1573
|
+
*/
|
|
1574
|
+
logLevel?: LogLevel | undefined;
|
|
1575
|
+
/**
|
|
1576
|
+
* Set the logger.
|
|
1577
|
+
*
|
|
1578
|
+
* Defaults to globalThis.console.
|
|
1579
|
+
*/
|
|
1580
|
+
logger?: Logger | undefined;
|
|
1581
|
+
/**
|
|
1582
|
+
* The adapter to the parent API client instance (for accessing auth, project, location)
|
|
1583
|
+
*/
|
|
1584
|
+
clientAdapter: GeminiNextGenAPIClientAdapter;
|
|
1585
|
+
}
|
|
1586
|
+
|
|
1587
|
+
/**
|
|
1588
|
+
* The arguments to pass to the code execution.
|
|
1589
|
+
*/
|
|
1590
|
+
declare interface CodeExecutionCallArguments {
|
|
1591
|
+
/**
|
|
1592
|
+
* The code to be executed.
|
|
1593
|
+
*/
|
|
1594
|
+
code?: string;
|
|
1595
|
+
/**
|
|
1596
|
+
* Programming language of the `code`.
|
|
1597
|
+
*/
|
|
1598
|
+
language?: 'python';
|
|
1599
|
+
}
|
|
1600
|
+
|
|
1601
|
+
/**
|
|
1602
|
+
* Code execution content.
|
|
1603
|
+
*/
|
|
1604
|
+
declare interface CodeExecutionCallContent {
|
|
1605
|
+
type: 'code_execution_call';
|
|
1606
|
+
/**
|
|
1607
|
+
* A unique ID for this specific tool call.
|
|
1608
|
+
*/
|
|
1609
|
+
id?: string;
|
|
1610
|
+
/**
|
|
1611
|
+
* The arguments to pass to the code execution.
|
|
1612
|
+
*/
|
|
1613
|
+
arguments?: CodeExecutionCallArguments;
|
|
1614
|
+
}
|
|
1615
|
+
|
|
1104
1616
|
/** Result of executing the [ExecutableCode]. Only generated when using the [CodeExecution] tool, and always follows a `part` containing the [ExecutableCode]. */
|
|
1105
1617
|
export declare interface CodeExecutionResult {
|
|
1106
1618
|
/** Required. Outcome of the code execution. */
|
|
@@ -1109,6 +1621,29 @@ export declare interface CodeExecutionResult {
|
|
|
1109
1621
|
output?: string;
|
|
1110
1622
|
}
|
|
1111
1623
|
|
|
1624
|
+
/**
|
|
1625
|
+
* Code execution result content.
|
|
1626
|
+
*/
|
|
1627
|
+
declare interface CodeExecutionResultContent {
|
|
1628
|
+
type: 'code_execution_result';
|
|
1629
|
+
/**
|
|
1630
|
+
* ID to match the ID from the code execution call block.
|
|
1631
|
+
*/
|
|
1632
|
+
call_id?: string;
|
|
1633
|
+
/**
|
|
1634
|
+
* Whether the code execution resulted in an error.
|
|
1635
|
+
*/
|
|
1636
|
+
is_error?: boolean;
|
|
1637
|
+
/**
|
|
1638
|
+
* The output of the code execution.
|
|
1639
|
+
*/
|
|
1640
|
+
result?: string;
|
|
1641
|
+
/**
|
|
1642
|
+
* A signature hash for backend validation.
|
|
1643
|
+
*/
|
|
1644
|
+
signature?: string;
|
|
1645
|
+
}
|
|
1646
|
+
|
|
1112
1647
|
/** Success and error statistics of processing multiple entities (for example, DataItems or structured data rows) in batch. This data type is not supported in Gemini API. */
|
|
1113
1648
|
export declare interface CompletionStats {
|
|
1114
1649
|
/** Output only. The number of entities for which any error was encountered. */
|
|
@@ -1166,6 +1701,13 @@ export declare class ComputeTokensResponse {
|
|
|
1166
1701
|
tokensInfo?: TokensInfo[];
|
|
1167
1702
|
}
|
|
1168
1703
|
|
|
1704
|
+
declare type _ConditionalNodeReadableStream<R = any> = typeof globalThis extends {
|
|
1705
|
+
ReadableStream: any;
|
|
1706
|
+
} ? never : _NodeReadableStream<R>;
|
|
1707
|
+
|
|
1708
|
+
declare class ConflictError extends APIError<409, Headers> {
|
|
1709
|
+
}
|
|
1710
|
+
|
|
1169
1711
|
/** Contains the multi-part content of a message. */
|
|
1170
1712
|
export declare interface Content {
|
|
1171
1713
|
/** List of parts that constitute a single message. Each part may have
|
|
@@ -1175,6 +1717,231 @@ export declare interface Content {
|
|
|
1175
1717
|
role?: string;
|
|
1176
1718
|
}
|
|
1177
1719
|
|
|
1720
|
+
declare interface ContentDelta {
|
|
1721
|
+
delta?: ContentDelta.TextDelta | ContentDelta.ImageDelta | ContentDelta.AudioDelta | ContentDelta.DocumentDelta | ContentDelta.VideoDelta | ContentDelta.ThoughtSummaryDelta | ContentDelta.ThoughtSignatureDelta | ContentDelta.FunctionCallDelta | ContentDelta.FunctionResultDelta | ContentDelta.CodeExecutionCallDelta | ContentDelta.CodeExecutionResultDelta | ContentDelta.URLContextCallDelta | ContentDelta.URLContextResultDelta | ContentDelta.GoogleSearchCallDelta | ContentDelta.GoogleSearchResultDelta | ContentDelta.MCPServerToolCallDelta | ContentDelta.MCPServerToolResultDelta | ContentDelta.FileSearchResultDelta;
|
|
1722
|
+
/**
|
|
1723
|
+
* The event_id token to be used to resume the interaction stream, from
|
|
1724
|
+
* this event.
|
|
1725
|
+
*/
|
|
1726
|
+
event_id?: string;
|
|
1727
|
+
event_type?: 'content.delta';
|
|
1728
|
+
index?: number;
|
|
1729
|
+
}
|
|
1730
|
+
|
|
1731
|
+
declare namespace ContentDelta {
|
|
1732
|
+
interface TextDelta {
|
|
1733
|
+
type: 'text';
|
|
1734
|
+
/**
|
|
1735
|
+
* Citation information for model-generated content.
|
|
1736
|
+
*/
|
|
1737
|
+
annotations?: Array<InteractionsAPI.Annotation>;
|
|
1738
|
+
text?: string;
|
|
1739
|
+
}
|
|
1740
|
+
interface ImageDelta {
|
|
1741
|
+
type: 'image';
|
|
1742
|
+
data?: string;
|
|
1743
|
+
/**
|
|
1744
|
+
* The mime type of the image.
|
|
1745
|
+
*/
|
|
1746
|
+
mime_type?: InteractionsAPI.ImageMimeType;
|
|
1747
|
+
/**
|
|
1748
|
+
* The resolution of the media.
|
|
1749
|
+
*/
|
|
1750
|
+
resolution?: 'low' | 'medium' | 'high' | 'ultra_high';
|
|
1751
|
+
uri?: string;
|
|
1752
|
+
}
|
|
1753
|
+
interface AudioDelta {
|
|
1754
|
+
type: 'audio';
|
|
1755
|
+
data?: string;
|
|
1756
|
+
/**
|
|
1757
|
+
* The mime type of the audio.
|
|
1758
|
+
*/
|
|
1759
|
+
mime_type?: InteractionsAPI.AudioMimeType;
|
|
1760
|
+
uri?: string;
|
|
1761
|
+
}
|
|
1762
|
+
interface DocumentDelta {
|
|
1763
|
+
type: 'document';
|
|
1764
|
+
data?: string;
|
|
1765
|
+
/**
|
|
1766
|
+
* The mime type of the document.
|
|
1767
|
+
*/
|
|
1768
|
+
mime_type?: InteractionsAPI.DocumentMimeType;
|
|
1769
|
+
uri?: string;
|
|
1770
|
+
}
|
|
1771
|
+
interface VideoDelta {
|
|
1772
|
+
type: 'video';
|
|
1773
|
+
data?: string;
|
|
1774
|
+
/**
|
|
1775
|
+
* The mime type of the video.
|
|
1776
|
+
*/
|
|
1777
|
+
mime_type?: InteractionsAPI.VideoMimeType;
|
|
1778
|
+
/**
|
|
1779
|
+
* The resolution of the media.
|
|
1780
|
+
*/
|
|
1781
|
+
resolution?: 'low' | 'medium' | 'high' | 'ultra_high';
|
|
1782
|
+
uri?: string;
|
|
1783
|
+
}
|
|
1784
|
+
interface ThoughtSummaryDelta {
|
|
1785
|
+
type: 'thought_summary';
|
|
1786
|
+
/**
|
|
1787
|
+
* A text content block.
|
|
1788
|
+
*/
|
|
1789
|
+
content?: InteractionsAPI.TextContent | InteractionsAPI.ImageContent;
|
|
1790
|
+
}
|
|
1791
|
+
interface ThoughtSignatureDelta {
|
|
1792
|
+
type: 'thought_signature';
|
|
1793
|
+
/**
|
|
1794
|
+
* Signature to match the backend source to be part of the generation.
|
|
1795
|
+
*/
|
|
1796
|
+
signature?: string;
|
|
1797
|
+
}
|
|
1798
|
+
interface FunctionCallDelta {
|
|
1799
|
+
type: 'function_call';
|
|
1800
|
+
/**
|
|
1801
|
+
* A unique ID for this specific tool call.
|
|
1802
|
+
*/
|
|
1803
|
+
id?: string;
|
|
1804
|
+
arguments?: {
|
|
1805
|
+
[key: string]: unknown;
|
|
1806
|
+
};
|
|
1807
|
+
name?: string;
|
|
1808
|
+
}
|
|
1809
|
+
interface FunctionResultDelta {
|
|
1810
|
+
type: 'function_result';
|
|
1811
|
+
/**
|
|
1812
|
+
* ID to match the ID from the function call block.
|
|
1813
|
+
*/
|
|
1814
|
+
call_id?: string;
|
|
1815
|
+
is_error?: boolean;
|
|
1816
|
+
name?: string;
|
|
1817
|
+
/**
|
|
1818
|
+
* Tool call result delta.
|
|
1819
|
+
*/
|
|
1820
|
+
result?: FunctionResultDelta.Items | string;
|
|
1821
|
+
}
|
|
1822
|
+
namespace FunctionResultDelta {
|
|
1823
|
+
interface Items {
|
|
1824
|
+
items?: Array<string | InteractionsAPI.ImageContent | unknown>;
|
|
1825
|
+
}
|
|
1826
|
+
}
|
|
1827
|
+
interface CodeExecutionCallDelta {
|
|
1828
|
+
type: 'code_execution_call';
|
|
1829
|
+
/**
|
|
1830
|
+
* A unique ID for this specific tool call.
|
|
1831
|
+
*/
|
|
1832
|
+
id?: string;
|
|
1833
|
+
/**
|
|
1834
|
+
* The arguments to pass to the code execution.
|
|
1835
|
+
*/
|
|
1836
|
+
arguments?: InteractionsAPI.CodeExecutionCallArguments;
|
|
1837
|
+
}
|
|
1838
|
+
interface CodeExecutionResultDelta {
|
|
1839
|
+
type: 'code_execution_result';
|
|
1840
|
+
/**
|
|
1841
|
+
* ID to match the ID from the function call block.
|
|
1842
|
+
*/
|
|
1843
|
+
call_id?: string;
|
|
1844
|
+
is_error?: boolean;
|
|
1845
|
+
result?: string;
|
|
1846
|
+
signature?: string;
|
|
1847
|
+
}
|
|
1848
|
+
interface URLContextCallDelta {
|
|
1849
|
+
type: 'url_context_call';
|
|
1850
|
+
/**
|
|
1851
|
+
* A unique ID for this specific tool call.
|
|
1852
|
+
*/
|
|
1853
|
+
id?: string;
|
|
1854
|
+
/**
|
|
1855
|
+
* The arguments to pass to the URL context.
|
|
1856
|
+
*/
|
|
1857
|
+
arguments?: InteractionsAPI.URLContextCallArguments;
|
|
1858
|
+
}
|
|
1859
|
+
interface URLContextResultDelta {
|
|
1860
|
+
type: 'url_context_result';
|
|
1861
|
+
/**
|
|
1862
|
+
* ID to match the ID from the function call block.
|
|
1863
|
+
*/
|
|
1864
|
+
call_id?: string;
|
|
1865
|
+
is_error?: boolean;
|
|
1866
|
+
result?: Array<InteractionsAPI.URLContextResult>;
|
|
1867
|
+
signature?: string;
|
|
1868
|
+
}
|
|
1869
|
+
interface GoogleSearchCallDelta {
|
|
1870
|
+
type: 'google_search_call';
|
|
1871
|
+
/**
|
|
1872
|
+
* A unique ID for this specific tool call.
|
|
1873
|
+
*/
|
|
1874
|
+
id?: string;
|
|
1875
|
+
/**
|
|
1876
|
+
* The arguments to pass to Google Search.
|
|
1877
|
+
*/
|
|
1878
|
+
arguments?: InteractionsAPI.GoogleSearchCallArguments;
|
|
1879
|
+
}
|
|
1880
|
+
interface GoogleSearchResultDelta {
|
|
1881
|
+
type: 'google_search_result';
|
|
1882
|
+
/**
|
|
1883
|
+
* ID to match the ID from the function call block.
|
|
1884
|
+
*/
|
|
1885
|
+
call_id?: string;
|
|
1886
|
+
is_error?: boolean;
|
|
1887
|
+
result?: Array<InteractionsAPI.GoogleSearchResult>;
|
|
1888
|
+
signature?: string;
|
|
1889
|
+
}
|
|
1890
|
+
interface MCPServerToolCallDelta {
|
|
1891
|
+
type: 'mcp_server_tool_call';
|
|
1892
|
+
/**
|
|
1893
|
+
* A unique ID for this specific tool call.
|
|
1894
|
+
*/
|
|
1895
|
+
id?: string;
|
|
1896
|
+
arguments?: {
|
|
1897
|
+
[key: string]: unknown;
|
|
1898
|
+
};
|
|
1899
|
+
name?: string;
|
|
1900
|
+
server_name?: string;
|
|
1901
|
+
}
|
|
1902
|
+
interface MCPServerToolResultDelta {
|
|
1903
|
+
type: 'mcp_server_tool_result';
|
|
1904
|
+
/**
|
|
1905
|
+
* ID to match the ID from the function call block.
|
|
1906
|
+
*/
|
|
1907
|
+
call_id?: string;
|
|
1908
|
+
name?: string;
|
|
1909
|
+
/**
|
|
1910
|
+
* Tool call result delta.
|
|
1911
|
+
*/
|
|
1912
|
+
result?: MCPServerToolResultDelta.Items | string;
|
|
1913
|
+
server_name?: string;
|
|
1914
|
+
}
|
|
1915
|
+
namespace MCPServerToolResultDelta {
|
|
1916
|
+
interface Items {
|
|
1917
|
+
items?: Array<string | InteractionsAPI.ImageContent | unknown>;
|
|
1918
|
+
}
|
|
1919
|
+
}
|
|
1920
|
+
interface FileSearchResultDelta {
|
|
1921
|
+
type: 'file_search_result';
|
|
1922
|
+
result?: Array<FileSearchResultDelta.Result>;
|
|
1923
|
+
}
|
|
1924
|
+
namespace FileSearchResultDelta {
|
|
1925
|
+
/**
|
|
1926
|
+
* The result of the File Search.
|
|
1927
|
+
*/
|
|
1928
|
+
interface Result {
|
|
1929
|
+
/**
|
|
1930
|
+
* The name of the file search store.
|
|
1931
|
+
*/
|
|
1932
|
+
file_search_store?: string;
|
|
1933
|
+
/**
|
|
1934
|
+
* The text of the search result.
|
|
1935
|
+
*/
|
|
1936
|
+
text?: string;
|
|
1937
|
+
/**
|
|
1938
|
+
* The title of the search result.
|
|
1939
|
+
*/
|
|
1940
|
+
title?: string;
|
|
1941
|
+
}
|
|
1942
|
+
}
|
|
1943
|
+
}
|
|
1944
|
+
|
|
1178
1945
|
/** The embedding generated from an input content. */
|
|
1179
1946
|
export declare interface ContentEmbedding {
|
|
1180
1947
|
/** A list of floats representing an embedding.
|
|
@@ -1215,6 +1982,30 @@ export declare class ContentReferenceImage {
|
|
|
1215
1982
|
toReferenceImageAPI(): ReferenceImageAPIInternal;
|
|
1216
1983
|
}
|
|
1217
1984
|
|
|
1985
|
+
declare interface ContentStart {
|
|
1986
|
+
/**
|
|
1987
|
+
* The content of the response.
|
|
1988
|
+
*/
|
|
1989
|
+
content?: TextContent | ImageContent | AudioContent | DocumentContent | VideoContent | ThoughtContent | FunctionCallContent | FunctionResultContent | CodeExecutionCallContent | CodeExecutionResultContent | URLContextCallContent | URLContextResultContent | GoogleSearchCallContent | GoogleSearchResultContent | MCPServerToolCallContent | MCPServerToolResultContent | FileSearchResultContent;
|
|
1990
|
+
/**
|
|
1991
|
+
* The event_id token to be used to resume the interaction stream, from
|
|
1992
|
+
* this event.
|
|
1993
|
+
*/
|
|
1994
|
+
event_id?: string;
|
|
1995
|
+
event_type?: 'content.start';
|
|
1996
|
+
index?: number;
|
|
1997
|
+
}
|
|
1998
|
+
|
|
1999
|
+
declare interface ContentStop {
|
|
2000
|
+
/**
|
|
2001
|
+
* The event_id token to be used to resume the interaction stream, from
|
|
2002
|
+
* this event.
|
|
2003
|
+
*/
|
|
2004
|
+
event_id?: string;
|
|
2005
|
+
event_type?: 'content.stop';
|
|
2006
|
+
index?: number;
|
|
2007
|
+
}
|
|
2008
|
+
|
|
1218
2009
|
export declare type ContentUnion = Content | PartUnion[] | PartUnion;
|
|
1219
2010
|
|
|
1220
2011
|
/** Enables context window compression -- mechanism managing model context window so it does not exceed given length. */
|
|
@@ -1310,6 +2101,20 @@ export declare class CountTokensResponse {
|
|
|
1310
2101
|
cachedContentTokenCount?: number;
|
|
1311
2102
|
}
|
|
1312
2103
|
|
|
2104
|
+
declare interface CreateAgentInteractionParamsNonStreaming extends BaseCreateAgentInteractionParams {
|
|
2105
|
+
/**
|
|
2106
|
+
* Body param: Input only. Whether the interaction will be streamed.
|
|
2107
|
+
*/
|
|
2108
|
+
stream?: false;
|
|
2109
|
+
}
|
|
2110
|
+
|
|
2111
|
+
declare interface CreateAgentInteractionParamsStreaming extends BaseCreateAgentInteractionParams {
|
|
2112
|
+
/**
|
|
2113
|
+
* Body param: Input only. Whether the interaction will be streamed.
|
|
2114
|
+
*/
|
|
2115
|
+
stream: true;
|
|
2116
|
+
}
|
|
2117
|
+
|
|
1313
2118
|
/** Optional parameters. */
|
|
1314
2119
|
export declare interface CreateAuthTokenConfig {
|
|
1315
2120
|
/** Used to override HTTP request options. */
|
|
@@ -1560,6 +2365,20 @@ export declare function createFunctionResponsePartFromUri(uri: string, mimeType:
|
|
|
1560
2365
|
*/
|
|
1561
2366
|
export declare function createModelContent(partOrString: PartListUnion | string): Content;
|
|
1562
2367
|
|
|
2368
|
+
declare interface CreateModelInteractionParamsNonStreaming extends BaseCreateModelInteractionParams {
|
|
2369
|
+
/**
|
|
2370
|
+
* Body param: Input only. Whether the interaction will be streamed.
|
|
2371
|
+
*/
|
|
2372
|
+
stream?: false;
|
|
2373
|
+
}
|
|
2374
|
+
|
|
2375
|
+
declare interface CreateModelInteractionParamsStreaming extends BaseCreateModelInteractionParams {
|
|
2376
|
+
/**
|
|
2377
|
+
* Body param: Input only. Whether the interaction will be streamed.
|
|
2378
|
+
*/
|
|
2379
|
+
stream: true;
|
|
2380
|
+
}
|
|
2381
|
+
|
|
1563
2382
|
/**
|
|
1564
2383
|
* Creates a `Part` object from a `base64` encoded `string`.
|
|
1565
2384
|
*/
|
|
@@ -1723,6 +2542,17 @@ export declare interface DatasetStats {
|
|
|
1723
2542
|
userOutputTokenDistribution?: DatasetDistribution;
|
|
1724
2543
|
}
|
|
1725
2544
|
|
|
2545
|
+
/**
|
|
2546
|
+
* Configuration for the Deep Research agent.
|
|
2547
|
+
*/
|
|
2548
|
+
declare interface DeepResearchAgentConfig {
|
|
2549
|
+
/**
|
|
2550
|
+
* Whether to include thought summaries in the response.
|
|
2551
|
+
*/
|
|
2552
|
+
thinking_summaries?: 'auto' | 'none';
|
|
2553
|
+
type?: 'deep-research';
|
|
2554
|
+
}
|
|
2555
|
+
|
|
1726
2556
|
/** Optional parameters for models.get method. */
|
|
1727
2557
|
export declare interface DeleteBatchJobConfig {
|
|
1728
2558
|
/** Used to override HTTP request options. */
|
|
@@ -1917,6 +2747,24 @@ declare interface Document_2 {
|
|
|
1917
2747
|
}
|
|
1918
2748
|
export { Document_2 as Document }
|
|
1919
2749
|
|
|
2750
|
+
/**
|
|
2751
|
+
* A document content block.
|
|
2752
|
+
*/
|
|
2753
|
+
declare interface DocumentContent {
|
|
2754
|
+
type: 'document';
|
|
2755
|
+
data?: string;
|
|
2756
|
+
/**
|
|
2757
|
+
* The mime type of the document.
|
|
2758
|
+
*/
|
|
2759
|
+
mime_type?: DocumentMimeType;
|
|
2760
|
+
uri?: string;
|
|
2761
|
+
}
|
|
2762
|
+
|
|
2763
|
+
/**
|
|
2764
|
+
* The mime type of the document.
|
|
2765
|
+
*/
|
|
2766
|
+
declare type DocumentMimeType = (string & {}) | 'application/pdf';
|
|
2767
|
+
|
|
1920
2768
|
declare class Documents extends BaseModule {
|
|
1921
2769
|
private readonly apiClient;
|
|
1922
2770
|
constructor(apiClient: ApiClient);
|
|
@@ -1959,6 +2807,9 @@ export declare enum DocumentState {
|
|
|
1959
2807
|
STATE_FAILED = "STATE_FAILED"
|
|
1960
2808
|
}
|
|
1961
2809
|
|
|
2810
|
+
/** @ts-ignore */
|
|
2811
|
+
declare type _DOMReadableStream<R = any> = globalThis.ReadableStream<R>;
|
|
2812
|
+
|
|
1962
2813
|
export declare type DownloadableFileUnion = string | File_2 | GeneratedVideo | Video;
|
|
1963
2814
|
|
|
1964
2815
|
declare interface Downloader {
|
|
@@ -1995,6 +2846,14 @@ export declare interface DownloadFileParameters {
|
|
|
1995
2846
|
config?: DownloadFileConfig;
|
|
1996
2847
|
}
|
|
1997
2848
|
|
|
2849
|
+
/**
|
|
2850
|
+
* Configuration for dynamic agents.
|
|
2851
|
+
*/
|
|
2852
|
+
declare interface DynamicAgentConfig {
|
|
2853
|
+
type?: 'dynamic';
|
|
2854
|
+
[k: string]: unknown;
|
|
2855
|
+
}
|
|
2856
|
+
|
|
1998
2857
|
/** Describes the options to customize dynamic retrieval. */
|
|
1999
2858
|
export declare interface DynamicRetrievalConfig {
|
|
2000
2859
|
/** The mode of the predictor to be used in dynamic retrieval. */
|
|
@@ -2248,6 +3107,53 @@ export declare enum Environment {
|
|
|
2248
3107
|
ENVIRONMENT_BROWSER = "ENVIRONMENT_BROWSER"
|
|
2249
3108
|
}
|
|
2250
3109
|
|
|
3110
|
+
declare interface ErrorEvent_2 {
|
|
3111
|
+
/**
|
|
3112
|
+
* Error message from an interaction.
|
|
3113
|
+
*/
|
|
3114
|
+
error?: ErrorEvent_2.Error;
|
|
3115
|
+
/**
|
|
3116
|
+
* The event_id token to be used to resume the interaction stream, from
|
|
3117
|
+
* this event.
|
|
3118
|
+
*/
|
|
3119
|
+
event_id?: string;
|
|
3120
|
+
event_type?: 'error';
|
|
3121
|
+
}
|
|
3122
|
+
|
|
3123
|
+
declare namespace ErrorEvent_2 {
|
|
3124
|
+
/**
|
|
3125
|
+
* Error message from an interaction.
|
|
3126
|
+
*/
|
|
3127
|
+
interface Error {
|
|
3128
|
+
/**
|
|
3129
|
+
* A URI that identifies the error type.
|
|
3130
|
+
*/
|
|
3131
|
+
code?: string;
|
|
3132
|
+
/**
|
|
3133
|
+
* A human-readable error message.
|
|
3134
|
+
*/
|
|
3135
|
+
message?: string;
|
|
3136
|
+
}
|
|
3137
|
+
}
|
|
3138
|
+
|
|
3139
|
+
declare namespace Errors {
|
|
3140
|
+
export {
|
|
3141
|
+
GeminiNextGenAPIClientError,
|
|
3142
|
+
APIError,
|
|
3143
|
+
APIUserAbortError,
|
|
3144
|
+
APIConnectionError,
|
|
3145
|
+
APIConnectionTimeoutError,
|
|
3146
|
+
BadRequestError,
|
|
3147
|
+
AuthenticationError,
|
|
3148
|
+
PermissionDeniedError,
|
|
3149
|
+
NotFoundError,
|
|
3150
|
+
ConflictError,
|
|
3151
|
+
UnprocessableEntityError,
|
|
3152
|
+
RateLimitError,
|
|
3153
|
+
InternalServerError
|
|
3154
|
+
}
|
|
3155
|
+
}
|
|
3156
|
+
|
|
2251
3157
|
/** Code generated by the model that is meant to be executed, and the result returned to the model. Generated when using the [CodeExecution] tool, in which the code will be automatically executed, and a corresponding [CodeExecutionResult] will also be generated. */
|
|
2252
3158
|
export declare interface ExecutableCode {
|
|
2253
3159
|
/** Required. The code to be executed. */
|
|
@@ -2294,6 +3200,13 @@ export declare enum FeatureSelectionPreference {
|
|
|
2294
3200
|
PRIORITIZE_COST = "PRIORITIZE_COST"
|
|
2295
3201
|
}
|
|
2296
3202
|
|
|
3203
|
+
/**
|
|
3204
|
+
* @license
|
|
3205
|
+
* Copyright 2025 Google LLC
|
|
3206
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
3207
|
+
*/
|
|
3208
|
+
declare type Fetch = (input: string | URL | Request, init?: RequestInit) => Promise<Response>;
|
|
3209
|
+
|
|
2297
3210
|
export declare interface FetchPredictOperationConfig {
|
|
2298
3211
|
/** Used to override HTTP request options. */
|
|
2299
3212
|
httpOptions?: HttpOptions;
|
|
@@ -2315,6 +3228,9 @@ export declare interface FetchPredictOperationParameters {
|
|
|
2315
3228
|
config?: FetchPredictOperationConfig;
|
|
2316
3229
|
}
|
|
2317
3230
|
|
|
3231
|
+
/** @ts-ignore For users who use Deno */
|
|
3232
|
+
declare type FetchRequestInit = NonNullable<OverloadedParameters<typeof fetch>[1]>;
|
|
3233
|
+
|
|
2318
3234
|
/** A file uploaded to the API. */
|
|
2319
3235
|
declare interface File_2 {
|
|
2320
3236
|
/** The `File` resource name. The ID (name excluding the "files/" prefix) can contain up to 40 characters that are lowercase alphanumeric or dashes (-). The ID cannot start or end with a dash. If the name is empty on create, a unique name will be generated. Example: `files/123-456` */
|
|
@@ -2482,6 +3398,37 @@ export declare interface FileSearch {
|
|
|
2482
3398
|
metadataFilter?: string;
|
|
2483
3399
|
}
|
|
2484
3400
|
|
|
3401
|
+
/**
|
|
3402
|
+
* File Search result content.
|
|
3403
|
+
*/
|
|
3404
|
+
declare interface FileSearchResultContent {
|
|
3405
|
+
type: 'file_search_result';
|
|
3406
|
+
/**
|
|
3407
|
+
* The results of the File Search.
|
|
3408
|
+
*/
|
|
3409
|
+
result?: Array<FileSearchResultContent.Result>;
|
|
3410
|
+
}
|
|
3411
|
+
|
|
3412
|
+
declare namespace FileSearchResultContent {
|
|
3413
|
+
/**
|
|
3414
|
+
* The result of the File Search.
|
|
3415
|
+
*/
|
|
3416
|
+
interface Result {
|
|
3417
|
+
/**
|
|
3418
|
+
* The name of the file search store.
|
|
3419
|
+
*/
|
|
3420
|
+
file_search_store?: string;
|
|
3421
|
+
/**
|
|
3422
|
+
* The text of the search result.
|
|
3423
|
+
*/
|
|
3424
|
+
text?: string;
|
|
3425
|
+
/**
|
|
3426
|
+
* The title of the search result.
|
|
3427
|
+
*/
|
|
3428
|
+
title?: string;
|
|
3429
|
+
}
|
|
3430
|
+
}
|
|
3431
|
+
|
|
2485
3432
|
/** A collection of Documents. */
|
|
2486
3433
|
export declare interface FileSearchStore {
|
|
2487
3434
|
/** The resource name of the FileSearchStore. Example: `fileSearchStores/my-file-search-store-123` */
|
|
@@ -2634,6 +3581,15 @@ export declare interface FileStatus {
|
|
|
2634
3581
|
code?: number;
|
|
2635
3582
|
}
|
|
2636
3583
|
|
|
3584
|
+
declare type FinalizedRequestInit = RequestInit & {
|
|
3585
|
+
headers: Headers;
|
|
3586
|
+
};
|
|
3587
|
+
|
|
3588
|
+
declare type FinalRequestOptions = RequestOptions & {
|
|
3589
|
+
method: HTTPMethod;
|
|
3590
|
+
path: string;
|
|
3591
|
+
};
|
|
3592
|
+
|
|
2637
3593
|
/** Output only. The reason why the model stopped generating tokens.
|
|
2638
3594
|
|
|
2639
3595
|
If empty, the model has not stopped generating the tokens. */
|
|
@@ -2697,7 +3653,34 @@ export declare enum FinishReason {
|
|
|
2697
3653
|
/**
|
|
2698
3654
|
* The model was expected to generate an image, but none was generated.
|
|
2699
3655
|
*/
|
|
2700
|
-
NO_IMAGE = "NO_IMAGE"
|
|
3656
|
+
NO_IMAGE = "NO_IMAGE",
|
|
3657
|
+
/**
|
|
3658
|
+
* Image generation stopped because the generated image may be a recitation from a source.
|
|
3659
|
+
*/
|
|
3660
|
+
IMAGE_RECITATION = "IMAGE_RECITATION",
|
|
3661
|
+
/**
|
|
3662
|
+
* Image generation stopped for a reason not otherwise specified.
|
|
3663
|
+
*/
|
|
3664
|
+
IMAGE_OTHER = "IMAGE_OTHER"
|
|
3665
|
+
}
|
|
3666
|
+
|
|
3667
|
+
/**
|
|
3668
|
+
* A tool that can be used by the model.
|
|
3669
|
+
*/
|
|
3670
|
+
declare interface Function_2 {
|
|
3671
|
+
type: 'function';
|
|
3672
|
+
/**
|
|
3673
|
+
* A description of the function.
|
|
3674
|
+
*/
|
|
3675
|
+
description?: string;
|
|
3676
|
+
/**
|
|
3677
|
+
* The name of the function.
|
|
3678
|
+
*/
|
|
3679
|
+
name?: string;
|
|
3680
|
+
/**
|
|
3681
|
+
* The JSON Schema for the function's parameters.
|
|
3682
|
+
*/
|
|
3683
|
+
parameters?: unknown;
|
|
2701
3684
|
}
|
|
2702
3685
|
|
|
2703
3686
|
/** A function call. */
|
|
@@ -2715,6 +3698,27 @@ export declare interface FunctionCall {
|
|
|
2715
3698
|
willContinue?: boolean;
|
|
2716
3699
|
}
|
|
2717
3700
|
|
|
3701
|
+
/**
|
|
3702
|
+
* A function tool call content block.
|
|
3703
|
+
*/
|
|
3704
|
+
declare interface FunctionCallContent {
|
|
3705
|
+
/**
|
|
3706
|
+
* A unique ID for this specific tool call.
|
|
3707
|
+
*/
|
|
3708
|
+
id: string;
|
|
3709
|
+
/**
|
|
3710
|
+
* The arguments to pass to the function.
|
|
3711
|
+
*/
|
|
3712
|
+
arguments: {
|
|
3713
|
+
[key: string]: unknown;
|
|
3714
|
+
};
|
|
3715
|
+
/**
|
|
3716
|
+
* The name of the tool to call.
|
|
3717
|
+
*/
|
|
3718
|
+
name: string;
|
|
3719
|
+
type: 'function_call';
|
|
3720
|
+
}
|
|
3721
|
+
|
|
2718
3722
|
/** Function calling config. */
|
|
2719
3723
|
export declare interface FunctionCallingConfig {
|
|
2720
3724
|
/** Optional. Function calling mode. */
|
|
@@ -2849,6 +3853,55 @@ export declare enum FunctionResponseScheduling {
|
|
|
2849
3853
|
INTERRUPT = "INTERRUPT"
|
|
2850
3854
|
}
|
|
2851
3855
|
|
|
3856
|
+
/**
|
|
3857
|
+
* A function tool result content block.
|
|
3858
|
+
*/
|
|
3859
|
+
declare interface FunctionResultContent {
|
|
3860
|
+
/**
|
|
3861
|
+
* ID to match the ID from the function call block.
|
|
3862
|
+
*/
|
|
3863
|
+
call_id: string;
|
|
3864
|
+
/**
|
|
3865
|
+
* The result of the tool call.
|
|
3866
|
+
*/
|
|
3867
|
+
result: FunctionResultContent.Items | unknown | string;
|
|
3868
|
+
type: 'function_result';
|
|
3869
|
+
/**
|
|
3870
|
+
* Whether the tool call resulted in an error.
|
|
3871
|
+
*/
|
|
3872
|
+
is_error?: boolean;
|
|
3873
|
+
/**
|
|
3874
|
+
* The name of the tool that was called.
|
|
3875
|
+
*/
|
|
3876
|
+
name?: string;
|
|
3877
|
+
}
|
|
3878
|
+
|
|
3879
|
+
declare namespace FunctionResultContent {
|
|
3880
|
+
interface Items {
|
|
3881
|
+
items?: Array<string | InteractionsAPI.ImageContent | unknown>;
|
|
3882
|
+
}
|
|
3883
|
+
}
|
|
3884
|
+
|
|
3885
|
+
/**
|
|
3886
|
+
* @license
|
|
3887
|
+
* Copyright 2025 Google LLC
|
|
3888
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
3889
|
+
*/
|
|
3890
|
+
declare interface GeminiNextGenAPIClientAdapter {
|
|
3891
|
+
isVertexAI: () => boolean;
|
|
3892
|
+
getProject: () => string | undefined;
|
|
3893
|
+
getLocation: () => string | undefined;
|
|
3894
|
+
getAuthHeaders: () => Headers | Promise<Headers>;
|
|
3895
|
+
}
|
|
3896
|
+
|
|
3897
|
+
/**
|
|
3898
|
+
* @license
|
|
3899
|
+
* Copyright 2025 Google LLC
|
|
3900
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
3901
|
+
*/
|
|
3902
|
+
declare class GeminiNextGenAPIClientError extends Error {
|
|
3903
|
+
}
|
|
3904
|
+
|
|
2852
3905
|
/** Input example for preference optimization. This data type is not supported in Gemini API. */
|
|
2853
3906
|
export declare interface GeminiPreferenceExample {
|
|
2854
3907
|
/** List of completions for a given prompt. */
|
|
@@ -3504,6 +4557,48 @@ export declare interface GenerationConfig {
|
|
|
3504
4557
|
enableEnhancedCivicAnswers?: boolean;
|
|
3505
4558
|
}
|
|
3506
4559
|
|
|
4560
|
+
/**
|
|
4561
|
+
* Configuration parameters for model interactions.
|
|
4562
|
+
*/
|
|
4563
|
+
declare interface GenerationConfig_2 {
|
|
4564
|
+
/**
|
|
4565
|
+
* The maximum number of tokens to include in the response.
|
|
4566
|
+
*/
|
|
4567
|
+
max_output_tokens?: number;
|
|
4568
|
+
/**
|
|
4569
|
+
* Seed used in decoding for reproducibility.
|
|
4570
|
+
*/
|
|
4571
|
+
seed?: number;
|
|
4572
|
+
/**
|
|
4573
|
+
* Configuration for speech interaction.
|
|
4574
|
+
*/
|
|
4575
|
+
speech_config?: Array<SpeechConfig_2>;
|
|
4576
|
+
/**
|
|
4577
|
+
* A list of character sequences that will stop output interaction.
|
|
4578
|
+
*/
|
|
4579
|
+
stop_sequences?: Array<string>;
|
|
4580
|
+
/**
|
|
4581
|
+
* Controls the randomness of the output.
|
|
4582
|
+
*/
|
|
4583
|
+
temperature?: number;
|
|
4584
|
+
/**
|
|
4585
|
+
* The level of thought tokens that the model should generate.
|
|
4586
|
+
*/
|
|
4587
|
+
thinking_level?: ThinkingLevel_2;
|
|
4588
|
+
/**
|
|
4589
|
+
* Whether to include thought summaries in the response.
|
|
4590
|
+
*/
|
|
4591
|
+
thinking_summaries?: 'auto' | 'none';
|
|
4592
|
+
/**
|
|
4593
|
+
* The tool choice for the interaction.
|
|
4594
|
+
*/
|
|
4595
|
+
tool_choice?: ToolChoice;
|
|
4596
|
+
/**
|
|
4597
|
+
* The maximum cumulative probability of tokens to consider when sampling.
|
|
4598
|
+
*/
|
|
4599
|
+
top_p?: number;
|
|
4600
|
+
}
|
|
4601
|
+
|
|
3507
4602
|
/** The configuration for routing the request to a specific model. This data type is not supported in Gemini API. */
|
|
3508
4603
|
export declare interface GenerationConfigRoutingConfig {
|
|
3509
4604
|
/** Automated routing. */
|
|
@@ -3754,6 +4849,8 @@ export declare class GoogleGenAI {
|
|
|
3754
4849
|
readonly authTokens: Tokens;
|
|
3755
4850
|
readonly tunings: Tunings;
|
|
3756
4851
|
readonly fileSearchStores: FileSearchStores;
|
|
4852
|
+
private _interactions;
|
|
4853
|
+
get interactions(): Interactions;
|
|
3757
4854
|
constructor(options: GoogleGenAIOptions);
|
|
3758
4855
|
}
|
|
3759
4856
|
|
|
@@ -3848,6 +4945,72 @@ export declare interface GoogleSearch {
|
|
|
3848
4945
|
timeRangeFilter?: Interval;
|
|
3849
4946
|
}
|
|
3850
4947
|
|
|
4948
|
+
/**
|
|
4949
|
+
* The arguments to pass to Google Search.
|
|
4950
|
+
*/
|
|
4951
|
+
declare interface GoogleSearchCallArguments {
|
|
4952
|
+
/**
|
|
4953
|
+
* Web search queries for the following-up web search.
|
|
4954
|
+
*/
|
|
4955
|
+
queries?: Array<string>;
|
|
4956
|
+
}
|
|
4957
|
+
|
|
4958
|
+
/**
|
|
4959
|
+
* Google Search content.
|
|
4960
|
+
*/
|
|
4961
|
+
declare interface GoogleSearchCallContent {
|
|
4962
|
+
type: 'google_search_call';
|
|
4963
|
+
/**
|
|
4964
|
+
* A unique ID for this specific tool call.
|
|
4965
|
+
*/
|
|
4966
|
+
id?: string;
|
|
4967
|
+
/**
|
|
4968
|
+
* The arguments to pass to Google Search.
|
|
4969
|
+
*/
|
|
4970
|
+
arguments?: GoogleSearchCallArguments;
|
|
4971
|
+
}
|
|
4972
|
+
|
|
4973
|
+
/**
|
|
4974
|
+
* The result of the Google Search.
|
|
4975
|
+
*/
|
|
4976
|
+
declare interface GoogleSearchResult {
|
|
4977
|
+
/**
|
|
4978
|
+
* Web content snippet that can be embedded in a web page or an app webview.
|
|
4979
|
+
*/
|
|
4980
|
+
rendered_content?: string;
|
|
4981
|
+
/**
|
|
4982
|
+
* Title of the search result.
|
|
4983
|
+
*/
|
|
4984
|
+
title?: string;
|
|
4985
|
+
/**
|
|
4986
|
+
* URI reference of the search result.
|
|
4987
|
+
*/
|
|
4988
|
+
url?: string;
|
|
4989
|
+
}
|
|
4990
|
+
|
|
4991
|
+
/**
|
|
4992
|
+
* Google Search result content.
|
|
4993
|
+
*/
|
|
4994
|
+
declare interface GoogleSearchResultContent {
|
|
4995
|
+
type: 'google_search_result';
|
|
4996
|
+
/**
|
|
4997
|
+
* ID to match the ID from the google search call block.
|
|
4998
|
+
*/
|
|
4999
|
+
call_id?: string;
|
|
5000
|
+
/**
|
|
5001
|
+
* Whether the Google Search resulted in an error.
|
|
5002
|
+
*/
|
|
5003
|
+
is_error?: boolean;
|
|
5004
|
+
/**
|
|
5005
|
+
* The results of the Google Search.
|
|
5006
|
+
*/
|
|
5007
|
+
result?: Array<GoogleSearchResult>;
|
|
5008
|
+
/**
|
|
5009
|
+
* The signature of the Google Search result.
|
|
5010
|
+
*/
|
|
5011
|
+
signature?: string;
|
|
5012
|
+
}
|
|
5013
|
+
|
|
3851
5014
|
/** Tool to retrieve public web data for grounding, powered by Google. */
|
|
3852
5015
|
export declare interface GoogleSearchRetrieval {
|
|
3853
5016
|
/** Specifies the dynamic retrieval configuration for the given source. */
|
|
@@ -4126,6 +5289,15 @@ export declare enum HarmSeverity {
|
|
|
4126
5289
|
HARM_SEVERITY_HIGH = "HARM_SEVERITY_HIGH"
|
|
4127
5290
|
}
|
|
4128
5291
|
|
|
5292
|
+
declare type HeadersLike = Headers | readonly HeaderValue[][] | Record<string, HeaderValue | readonly HeaderValue[]> | undefined | null | NullableHeaders;
|
|
5293
|
+
|
|
5294
|
+
/**
|
|
5295
|
+
* @license
|
|
5296
|
+
* Copyright 2025 Google LLC
|
|
5297
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5298
|
+
*/
|
|
5299
|
+
declare type HeaderValue = string | undefined | null;
|
|
5300
|
+
|
|
4129
5301
|
/** The location of the API key. This enum is not supported in Gemini API. */
|
|
4130
5302
|
export declare enum HttpElementLocation {
|
|
4131
5303
|
HTTP_IN_UNSPECIFIED = "HTTP_IN_UNSPECIFIED",
|
|
@@ -4151,6 +5323,8 @@ export declare enum HttpElementLocation {
|
|
|
4151
5323
|
HTTP_IN_COOKIE = "HTTP_IN_COOKIE"
|
|
4152
5324
|
}
|
|
4153
5325
|
|
|
5326
|
+
declare type HTTPMethod = 'get' | 'post' | 'put' | 'patch' | 'delete';
|
|
5327
|
+
|
|
4154
5328
|
/** HTTP options to be used in each of the requests. */
|
|
4155
5329
|
export declare interface HttpOptions {
|
|
4156
5330
|
/** The base URL for the AI platform service endpoint. */
|
|
@@ -4260,6 +5434,28 @@ export declare interface ImageConfig {
|
|
|
4260
5434
|
outputCompressionQuality?: number;
|
|
4261
5435
|
}
|
|
4262
5436
|
|
|
5437
|
+
/**
|
|
5438
|
+
* An image content block.
|
|
5439
|
+
*/
|
|
5440
|
+
declare interface ImageContent {
|
|
5441
|
+
type: 'image';
|
|
5442
|
+
data?: string;
|
|
5443
|
+
/**
|
|
5444
|
+
* The mime type of the image.
|
|
5445
|
+
*/
|
|
5446
|
+
mime_type?: ImageMimeType;
|
|
5447
|
+
/**
|
|
5448
|
+
* The resolution of the media.
|
|
5449
|
+
*/
|
|
5450
|
+
resolution?: 'low' | 'medium' | 'high' | 'ultra_high';
|
|
5451
|
+
uri?: string;
|
|
5452
|
+
}
|
|
5453
|
+
|
|
5454
|
+
/**
|
|
5455
|
+
* The mime type of the image.
|
|
5456
|
+
*/
|
|
5457
|
+
declare type ImageMimeType = 'image/png' | 'image/jpeg' | 'image/webp' | 'image/heic' | 'image/heif' | (string & {});
|
|
5458
|
+
|
|
4263
5459
|
/** Enum that specifies the language of the text in the prompt. */
|
|
4264
5460
|
export declare enum ImagePromptLanguage {
|
|
4265
5461
|
/**
|
|
@@ -4389,6 +5585,218 @@ export declare class InlinedResponse {
|
|
|
4389
5585
|
error?: JobError;
|
|
4390
5586
|
}
|
|
4391
5587
|
|
|
5588
|
+
/**
|
|
5589
|
+
* The Interaction resource.
|
|
5590
|
+
*/
|
|
5591
|
+
declare interface Interaction {
|
|
5592
|
+
/**
|
|
5593
|
+
* Output only. A unique identifier for the interaction completion.
|
|
5594
|
+
*/
|
|
5595
|
+
id: string;
|
|
5596
|
+
/**
|
|
5597
|
+
* Output only. The status of the interaction.
|
|
5598
|
+
*/
|
|
5599
|
+
status: 'in_progress' | 'requires_action' | 'completed' | 'failed' | 'cancelled';
|
|
5600
|
+
/**
|
|
5601
|
+
* The name of the `Agent` used for generating the interaction.
|
|
5602
|
+
*/
|
|
5603
|
+
agent?: (string & {}) | 'deep-research-pro-preview-12-2025';
|
|
5604
|
+
/**
|
|
5605
|
+
* Output only. The time at which the response was created in ISO 8601 format
|
|
5606
|
+
* (YYYY-MM-DDThh:mm:ssZ).
|
|
5607
|
+
*/
|
|
5608
|
+
created?: string;
|
|
5609
|
+
/**
|
|
5610
|
+
* The name of the `Model` used for generating the interaction.
|
|
5611
|
+
*/
|
|
5612
|
+
model?: Model_2;
|
|
5613
|
+
/**
|
|
5614
|
+
* Output only. The object type of the interaction. Always set to `interaction`.
|
|
5615
|
+
*/
|
|
5616
|
+
object?: 'interaction';
|
|
5617
|
+
/**
|
|
5618
|
+
* Output only. Responses from the model.
|
|
5619
|
+
*/
|
|
5620
|
+
outputs?: Array<TextContent | ImageContent | AudioContent | DocumentContent | VideoContent | ThoughtContent | FunctionCallContent | FunctionResultContent | CodeExecutionCallContent | CodeExecutionResultContent | URLContextCallContent | URLContextResultContent | GoogleSearchCallContent | GoogleSearchResultContent | MCPServerToolCallContent | MCPServerToolResultContent | FileSearchResultContent>;
|
|
5621
|
+
/**
|
|
5622
|
+
* The ID of the previous interaction, if any.
|
|
5623
|
+
*/
|
|
5624
|
+
previous_interaction_id?: string;
|
|
5625
|
+
/**
|
|
5626
|
+
* Output only. The role of the interaction.
|
|
5627
|
+
*/
|
|
5628
|
+
role?: string;
|
|
5629
|
+
/**
|
|
5630
|
+
* Output only. The time at which the response was last updated in ISO 8601 format
|
|
5631
|
+
* (YYYY-MM-DDThh:mm:ssZ).
|
|
5632
|
+
*/
|
|
5633
|
+
updated?: string;
|
|
5634
|
+
/**
|
|
5635
|
+
* Output only. Statistics on the interaction request's token usage.
|
|
5636
|
+
*/
|
|
5637
|
+
usage?: Usage;
|
|
5638
|
+
}
|
|
5639
|
+
|
|
5640
|
+
declare interface InteractionCancelParams {
|
|
5641
|
+
/**
|
|
5642
|
+
* Which version of the API to use.
|
|
5643
|
+
*/
|
|
5644
|
+
api_version?: string;
|
|
5645
|
+
}
|
|
5646
|
+
|
|
5647
|
+
declare type InteractionCreateParams = CreateModelInteractionParamsNonStreaming | CreateModelInteractionParamsStreaming | CreateAgentInteractionParamsNonStreaming | CreateAgentInteractionParamsStreaming;
|
|
5648
|
+
|
|
5649
|
+
declare interface InteractionDeleteParams {
|
|
5650
|
+
/**
|
|
5651
|
+
* Which version of the API to use.
|
|
5652
|
+
*/
|
|
5653
|
+
api_version?: string;
|
|
5654
|
+
}
|
|
5655
|
+
|
|
5656
|
+
declare type InteractionDeleteResponse = unknown;
|
|
5657
|
+
|
|
5658
|
+
declare interface InteractionEvent {
|
|
5659
|
+
/**
|
|
5660
|
+
* The event_id token to be used to resume the interaction stream, from
|
|
5661
|
+
* this event.
|
|
5662
|
+
*/
|
|
5663
|
+
event_id?: string;
|
|
5664
|
+
event_type?: 'interaction.start' | 'interaction.complete';
|
|
5665
|
+
/**
|
|
5666
|
+
* The Interaction resource.
|
|
5667
|
+
*/
|
|
5668
|
+
interaction?: Interaction;
|
|
5669
|
+
}
|
|
5670
|
+
|
|
5671
|
+
declare type InteractionGetParams = InteractionGetParamsNonStreaming | InteractionGetParamsStreaming;
|
|
5672
|
+
|
|
5673
|
+
declare namespace InteractionGetParams {
|
|
5674
|
+
type InteractionGetParamsNonStreaming = InteractionsAPI.InteractionGetParamsNonStreaming;
|
|
5675
|
+
type InteractionGetParamsStreaming = InteractionsAPI.InteractionGetParamsStreaming;
|
|
5676
|
+
}
|
|
5677
|
+
|
|
5678
|
+
declare interface InteractionGetParamsBase {
|
|
5679
|
+
/**
|
|
5680
|
+
* Path param: Which version of the API to use.
|
|
5681
|
+
*/
|
|
5682
|
+
api_version?: string;
|
|
5683
|
+
/**
|
|
5684
|
+
* Query param: Optional. If set, resumes the interaction stream from the next chunk after the event marked by the event id. Can only be used if `stream` is true.
|
|
5685
|
+
*/
|
|
5686
|
+
last_event_id?: string;
|
|
5687
|
+
/**
|
|
5688
|
+
* Query param: If set to true, the generated content will be streamed incrementally.
|
|
5689
|
+
*/
|
|
5690
|
+
stream?: boolean;
|
|
5691
|
+
}
|
|
5692
|
+
|
|
5693
|
+
declare interface InteractionGetParamsNonStreaming extends InteractionGetParamsBase {
|
|
5694
|
+
/**
|
|
5695
|
+
* Query param: If set to true, the generated content will be streamed incrementally.
|
|
5696
|
+
*/
|
|
5697
|
+
stream?: false;
|
|
5698
|
+
}
|
|
5699
|
+
|
|
5700
|
+
declare interface InteractionGetParamsStreaming extends InteractionGetParamsBase {
|
|
5701
|
+
/**
|
|
5702
|
+
* Query param: If set to true, the generated content will be streamed incrementally.
|
|
5703
|
+
*/
|
|
5704
|
+
stream: true;
|
|
5705
|
+
}
|
|
5706
|
+
|
|
5707
|
+
export declare class Interactions extends BaseInteractions {
|
|
5708
|
+
}
|
|
5709
|
+
|
|
5710
|
+
export declare namespace Interactions {
|
|
5711
|
+
export { type AllowedTools as AllowedTools, type Annotation as Annotation, type AudioContent as AudioContent, type AudioMimeType as AudioMimeType, type CodeExecutionCallArguments as CodeExecutionCallArguments, type CodeExecutionCallContent as CodeExecutionCallContent, type CodeExecutionResultContent as CodeExecutionResultContent, type ContentDelta as ContentDelta, type ContentStart as ContentStart, type ContentStop as ContentStop, type DeepResearchAgentConfig as DeepResearchAgentConfig, type DocumentContent as DocumentContent, type DocumentMimeType as DocumentMimeType, type DynamicAgentConfig as DynamicAgentConfig, type ErrorEvent_2 as ErrorEvent, type FileSearchResultContent as FileSearchResultContent, type Function_2 as Function, type FunctionCallContent as FunctionCallContent, type FunctionResultContent as FunctionResultContent, type GenerationConfig_2 as GenerationConfig, type GoogleSearchCallArguments as GoogleSearchCallArguments, type GoogleSearchCallContent as GoogleSearchCallContent, type GoogleSearchResult as GoogleSearchResult, type GoogleSearchResultContent as GoogleSearchResultContent, type ImageContent as ImageContent, type ImageMimeType as ImageMimeType, type Interaction as Interaction, type InteractionEvent as InteractionEvent, type InteractionSSEEvent as InteractionSSEEvent, type InteractionStatusUpdate as InteractionStatusUpdate, type MCPServerToolCallContent as MCPServerToolCallContent, type MCPServerToolResultContent as MCPServerToolResultContent, type Model_2 as Model, type SpeechConfig_2 as SpeechConfig, type TextContent as TextContent, type ThinkingLevel_2 as ThinkingLevel, type ThoughtContent as ThoughtContent, type Tool_2 as Tool, type ToolChoice as ToolChoice, type ToolChoiceConfig as ToolChoiceConfig, type ToolChoiceType as ToolChoiceType, type Turn as Turn, type URLContextCallArguments as URLContextCallArguments, type URLContextCallContent as URLContextCallContent, type URLContextResult as URLContextResult, type URLContextResultContent as URLContextResultContent, type Usage as Usage, type VideoContent as VideoContent, type VideoMimeType as VideoMimeType, type InteractionDeleteResponse as InteractionDeleteResponse, type InteractionCreateParams as InteractionCreateParams, type CreateModelInteractionParamsNonStreaming as CreateModelInteractionParamsNonStreaming, type CreateModelInteractionParamsStreaming as CreateModelInteractionParamsStreaming, type CreateAgentInteractionParamsNonStreaming as CreateAgentInteractionParamsNonStreaming, type CreateAgentInteractionParamsStreaming as CreateAgentInteractionParamsStreaming, type InteractionDeleteParams as InteractionDeleteParams, type InteractionCancelParams as InteractionCancelParams, type InteractionGetParams as InteractionGetParams, type InteractionGetParamsNonStreaming as InteractionGetParamsNonStreaming, type InteractionGetParamsStreaming as InteractionGetParamsStreaming, };
|
|
5712
|
+
}
|
|
5713
|
+
|
|
5714
|
+
declare namespace InteractionsAPI {
|
|
5715
|
+
export {
|
|
5716
|
+
BaseInteractions,
|
|
5717
|
+
Interactions,
|
|
5718
|
+
AllowedTools,
|
|
5719
|
+
Annotation,
|
|
5720
|
+
AudioContent,
|
|
5721
|
+
AudioMimeType,
|
|
5722
|
+
CodeExecutionCallArguments,
|
|
5723
|
+
CodeExecutionCallContent,
|
|
5724
|
+
CodeExecutionResultContent,
|
|
5725
|
+
ContentDelta,
|
|
5726
|
+
ContentStart,
|
|
5727
|
+
ContentStop,
|
|
5728
|
+
DeepResearchAgentConfig,
|
|
5729
|
+
DocumentContent,
|
|
5730
|
+
DocumentMimeType,
|
|
5731
|
+
DynamicAgentConfig,
|
|
5732
|
+
ErrorEvent_2 as ErrorEvent,
|
|
5733
|
+
FileSearchResultContent,
|
|
5734
|
+
Function_2 as Function,
|
|
5735
|
+
FunctionCallContent,
|
|
5736
|
+
FunctionResultContent,
|
|
5737
|
+
GenerationConfig_2 as GenerationConfig,
|
|
5738
|
+
GoogleSearchCallArguments,
|
|
5739
|
+
GoogleSearchCallContent,
|
|
5740
|
+
GoogleSearchResult,
|
|
5741
|
+
GoogleSearchResultContent,
|
|
5742
|
+
ImageContent,
|
|
5743
|
+
ImageMimeType,
|
|
5744
|
+
Interaction,
|
|
5745
|
+
InteractionEvent,
|
|
5746
|
+
InteractionSSEEvent,
|
|
5747
|
+
InteractionStatusUpdate,
|
|
5748
|
+
MCPServerToolCallContent,
|
|
5749
|
+
MCPServerToolResultContent,
|
|
5750
|
+
Model_2 as Model,
|
|
5751
|
+
SpeechConfig_2 as SpeechConfig,
|
|
5752
|
+
TextContent,
|
|
5753
|
+
ThinkingLevel_2 as ThinkingLevel,
|
|
5754
|
+
ThoughtContent,
|
|
5755
|
+
Tool_2 as Tool,
|
|
5756
|
+
ToolChoice,
|
|
5757
|
+
ToolChoiceConfig,
|
|
5758
|
+
ToolChoiceType,
|
|
5759
|
+
Turn,
|
|
5760
|
+
URLContextCallArguments,
|
|
5761
|
+
URLContextCallContent,
|
|
5762
|
+
URLContextResult,
|
|
5763
|
+
URLContextResultContent,
|
|
5764
|
+
Usage,
|
|
5765
|
+
VideoContent,
|
|
5766
|
+
VideoMimeType,
|
|
5767
|
+
InteractionDeleteResponse,
|
|
5768
|
+
InteractionCreateParams,
|
|
5769
|
+
BaseCreateModelInteractionParams,
|
|
5770
|
+
BaseCreateAgentInteractionParams,
|
|
5771
|
+
CreateModelInteractionParamsNonStreaming,
|
|
5772
|
+
CreateModelInteractionParamsStreaming,
|
|
5773
|
+
CreateAgentInteractionParamsNonStreaming,
|
|
5774
|
+
CreateAgentInteractionParamsStreaming,
|
|
5775
|
+
InteractionDeleteParams,
|
|
5776
|
+
InteractionCancelParams,
|
|
5777
|
+
InteractionGetParams,
|
|
5778
|
+
InteractionGetParamsBase,
|
|
5779
|
+
InteractionGetParamsNonStreaming,
|
|
5780
|
+
InteractionGetParamsStreaming
|
|
5781
|
+
}
|
|
5782
|
+
}
|
|
5783
|
+
|
|
5784
|
+
declare type InteractionSSEEvent = InteractionEvent | InteractionStatusUpdate | ContentStart | ContentDelta | ContentStop | ErrorEvent_2;
|
|
5785
|
+
|
|
5786
|
+
declare interface InteractionStatusUpdate {
|
|
5787
|
+
/**
|
|
5788
|
+
* The event_id token to be used to resume the interaction stream, from
|
|
5789
|
+
* this event.
|
|
5790
|
+
*/
|
|
5791
|
+
event_id?: string;
|
|
5792
|
+
event_type?: 'interaction.status_update';
|
|
5793
|
+
interaction_id?: string;
|
|
5794
|
+
status?: 'in_progress' | 'requires_action' | 'completed' | 'failed' | 'cancelled';
|
|
5795
|
+
}
|
|
5796
|
+
|
|
5797
|
+
declare class InternalServerError extends APIError<number, Headers> {
|
|
5798
|
+
}
|
|
5799
|
+
|
|
4392
5800
|
/** Represents a time interval, encoded as a Timestamp start (inclusive) and a Timestamp end (exclusive). The start must be less than or equal to the end. When the start equals the end, the interval is empty (matches no time). When both start and end are unspecified, the interval matches any time. */
|
|
4393
5801
|
export declare interface Interval {
|
|
4394
5802
|
/** Optional. Exclusive end of the interval. If specified, a Timestamp matching this interval will have to be before the end. */
|
|
@@ -4885,6 +6293,10 @@ export declare interface LiveClientSetup {
|
|
|
4885
6293
|
/** Configures the proactivity of the model. This allows the model to respond proactively to
|
|
4886
6294
|
the input and to ignore irrelevant input. */
|
|
4887
6295
|
proactivity?: ProactivityConfig;
|
|
6296
|
+
/** Configures the explicit VAD signal. If enabled, the client will send
|
|
6297
|
+
vad_signal to indicate the start and end of speech. This allows the server
|
|
6298
|
+
to process the audio more efficiently. */
|
|
6299
|
+
explicitVadSignal?: boolean;
|
|
4888
6300
|
}
|
|
4889
6301
|
|
|
4890
6302
|
/** Client generated response to a `ToolCall` received from the server.
|
|
@@ -4987,6 +6399,10 @@ export declare interface LiveConnectConfig {
|
|
|
4987
6399
|
/** Configures the proactivity of the model. This allows the model to respond proactively to
|
|
4988
6400
|
the input and to ignore irrelevant input. */
|
|
4989
6401
|
proactivity?: ProactivityConfig;
|
|
6402
|
+
/** Configures the explicit VAD signal. If enabled, the client will send
|
|
6403
|
+
vad_signal to indicate the start and end of speech. This allows the server
|
|
6404
|
+
to process the audio more efficiently. */
|
|
6405
|
+
explicitVadSignal?: boolean;
|
|
4990
6406
|
}
|
|
4991
6407
|
|
|
4992
6408
|
/** Config for LiveConnectConstraints for Auth Token creation. */
|
|
@@ -5397,6 +6813,8 @@ export declare class LiveServerMessage {
|
|
|
5397
6813
|
goAway?: LiveServerGoAway;
|
|
5398
6814
|
/** Update of the session resumption state. */
|
|
5399
6815
|
sessionResumptionUpdate?: LiveServerSessionResumptionUpdate;
|
|
6816
|
+
/** Voice activity detection signal. */
|
|
6817
|
+
voiceActivityDetectionSignal?: VoiceActivityDetectionSignal;
|
|
5400
6818
|
/**
|
|
5401
6819
|
* Returns the concatenation of all text parts from the server content if present.
|
|
5402
6820
|
*
|
|
@@ -5454,6 +6872,17 @@ export declare interface LiveServerToolCallCancellation {
|
|
|
5454
6872
|
ids?: string[];
|
|
5455
6873
|
}
|
|
5456
6874
|
|
|
6875
|
+
declare type LogFn = (message: string, ...rest: unknown[]) => void;
|
|
6876
|
+
|
|
6877
|
+
declare type Logger = {
|
|
6878
|
+
error: LogFn;
|
|
6879
|
+
warn: LogFn;
|
|
6880
|
+
info: LogFn;
|
|
6881
|
+
debug: LogFn;
|
|
6882
|
+
};
|
|
6883
|
+
|
|
6884
|
+
declare type LogLevel = 'off' | 'error' | 'warn' | 'info' | 'debug';
|
|
6885
|
+
|
|
5457
6886
|
/** Logprobs Result */
|
|
5458
6887
|
export declare interface LogprobsResult {
|
|
5459
6888
|
/** Length = total number of decoding steps. The chosen candidates may or may not be in top_candidates. */
|
|
@@ -5522,6 +6951,60 @@ export declare enum MaskReferenceMode {
|
|
|
5522
6951
|
MASK_MODE_SEMANTIC = "MASK_MODE_SEMANTIC"
|
|
5523
6952
|
}
|
|
5524
6953
|
|
|
6954
|
+
/**
|
|
6955
|
+
* MCPServer tool call content.
|
|
6956
|
+
*/
|
|
6957
|
+
declare interface MCPServerToolCallContent {
|
|
6958
|
+
/**
|
|
6959
|
+
* A unique ID for this specific tool call.
|
|
6960
|
+
*/
|
|
6961
|
+
id: string;
|
|
6962
|
+
/**
|
|
6963
|
+
* The JSON object of arguments for the function.
|
|
6964
|
+
*/
|
|
6965
|
+
arguments: {
|
|
6966
|
+
[key: string]: unknown;
|
|
6967
|
+
};
|
|
6968
|
+
/**
|
|
6969
|
+
* The name of the tool which was called.
|
|
6970
|
+
*/
|
|
6971
|
+
name: string;
|
|
6972
|
+
/**
|
|
6973
|
+
* The name of the used MCP server.
|
|
6974
|
+
*/
|
|
6975
|
+
server_name: string;
|
|
6976
|
+
type: 'mcp_server_tool_call';
|
|
6977
|
+
}
|
|
6978
|
+
|
|
6979
|
+
/**
|
|
6980
|
+
* MCPServer tool result content.
|
|
6981
|
+
*/
|
|
6982
|
+
declare interface MCPServerToolResultContent {
|
|
6983
|
+
/**
|
|
6984
|
+
* ID to match the ID from the MCP server tool call block.
|
|
6985
|
+
*/
|
|
6986
|
+
call_id: string;
|
|
6987
|
+
/**
|
|
6988
|
+
* The result of the tool call.
|
|
6989
|
+
*/
|
|
6990
|
+
result: MCPServerToolResultContent.Items | unknown | string;
|
|
6991
|
+
type: 'mcp_server_tool_result';
|
|
6992
|
+
/**
|
|
6993
|
+
* Name of the tool which is called for this specific tool call.
|
|
6994
|
+
*/
|
|
6995
|
+
name?: string;
|
|
6996
|
+
/**
|
|
6997
|
+
* The name of the used MCP server.
|
|
6998
|
+
*/
|
|
6999
|
+
server_name?: string;
|
|
7000
|
+
}
|
|
7001
|
+
|
|
7002
|
+
declare namespace MCPServerToolResultContent {
|
|
7003
|
+
interface Items {
|
|
7004
|
+
items?: Array<string | InteractionsAPI.ImageContent | unknown>;
|
|
7005
|
+
}
|
|
7006
|
+
}
|
|
7007
|
+
|
|
5525
7008
|
/**
|
|
5526
7009
|
* Creates a McpCallableTool from MCP clients and an optional config.
|
|
5527
7010
|
*
|
|
@@ -5582,6 +7065,14 @@ export declare enum MediaResolution {
|
|
|
5582
7065
|
MEDIA_RESOLUTION_HIGH = "MEDIA_RESOLUTION_HIGH"
|
|
5583
7066
|
}
|
|
5584
7067
|
|
|
7068
|
+
/**
|
|
7069
|
+
* This type contains `RequestInit` options that may be available on the current runtime,
|
|
7070
|
+
* including per-platform extensions like `dispatcher`, `agent`, `client`, etc.
|
|
7071
|
+
*/
|
|
7072
|
+
declare type MergedRequestInit = RequestInits &
|
|
7073
|
+
/** We don't include these in the types as they'll be overridden for every request. */
|
|
7074
|
+
Partial<Record<'body' | 'headers' | 'method' | 'signal', never>>;
|
|
7075
|
+
|
|
5585
7076
|
/** Server content modalities. */
|
|
5586
7077
|
export declare enum Modality {
|
|
5587
7078
|
/**
|
|
@@ -5677,6 +7168,11 @@ export declare interface Model {
|
|
|
5677
7168
|
thinking?: boolean;
|
|
5678
7169
|
}
|
|
5679
7170
|
|
|
7171
|
+
/**
|
|
7172
|
+
* The model that will complete your prompt.\n\nSee [models](https://ai.google.dev/gemini-api/docs/models) for additional details.
|
|
7173
|
+
*/
|
|
7174
|
+
declare type Model_2 = 'gemini-2.5-pro' | 'gemini-2.5-flash' | 'gemini-2.5-flash-preview-09-2025' | 'gemini-2.5-flash-lite' | 'gemini-2.5-flash-lite-preview-09-2025' | 'gemini-2.5-flash-preview-native-audio-dialog' | 'gemini-2.5-flash-image-preview' | 'gemini-2.5-pro-preview-tts' | 'gemini-3-pro-preview' | (string & {});
|
|
7175
|
+
|
|
5680
7176
|
export declare class Models extends BaseModule {
|
|
5681
7177
|
private readonly apiClient;
|
|
5682
7178
|
constructor(apiClient: ApiClient);
|
|
@@ -6051,9 +7547,9 @@ export declare interface ModelSelectionConfig {
|
|
|
6051
7547
|
featureSelectionPreference?: FeatureSelectionPreference;
|
|
6052
7548
|
}
|
|
6053
7549
|
|
|
6054
|
-
/**
|
|
7550
|
+
/** Configuration for a multi-speaker text-to-speech request. */
|
|
6055
7551
|
export declare interface MultiSpeakerVoiceConfig {
|
|
6056
|
-
/** Required.
|
|
7552
|
+
/** Required. A list of configurations for the voices of the speakers. Exactly two speaker voice configurations must be provided. */
|
|
6057
7553
|
speakerVoiceConfigs?: SpeakerVoiceConfig[];
|
|
6058
7554
|
}
|
|
6059
7555
|
|
|
@@ -6080,6 +7576,48 @@ export declare enum MusicGenerationMode {
|
|
|
6080
7576
|
VOCALIZATION = "VOCALIZATION"
|
|
6081
7577
|
}
|
|
6082
7578
|
|
|
7579
|
+
/**
|
|
7580
|
+
* @license
|
|
7581
|
+
* Copyright 2025 Google LLC
|
|
7582
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
7583
|
+
*/
|
|
7584
|
+
/// <reference types="node" />
|
|
7585
|
+
/**
|
|
7586
|
+
* Shims for types that we can't always rely on being available globally.
|
|
7587
|
+
*
|
|
7588
|
+
* Note: these only exist at the type-level, there is no corresponding runtime
|
|
7589
|
+
* version for any of these symbols.
|
|
7590
|
+
*/
|
|
7591
|
+
declare type NeverToAny<T> = T extends never ? any : T;
|
|
7592
|
+
|
|
7593
|
+
/** @ts-ignore For users with node-fetch@2 */
|
|
7594
|
+
declare type NodeFetch2RequestInit = NotAny<import('../node_modules/@types/node-fetch/index.d.ts').RequestInit> | NotAny<import('../../node_modules/@types/node-fetch/index.d.ts').RequestInit> | NotAny<import('../../../node_modules/@types/node-fetch/index.d.ts').RequestInit> | NotAny<import('../../../../node_modules/@types/node-fetch/index.d.ts').RequestInit> | NotAny<import('../../../../../node_modules/@types/node-fetch/index.d.ts').RequestInit> | NotAny<import('../../../../../../node_modules/@types/node-fetch/index.d.ts').RequestInit> | NotAny<import('../../../../../../../node_modules/@types/node-fetch/index.d.ts').RequestInit> | NotAny<import('../../../../../../../../node_modules/@types/node-fetch/index.d.ts').RequestInit> | NotAny<import('../../../../../../../../../node_modules/@types/node-fetch/index.d.ts').RequestInit> | NotAny<import('../../../../../../../../../../node_modules/@types/node-fetch/index.d.ts').RequestInit>;
|
|
7595
|
+
|
|
7596
|
+
/** @ts-ignore For users with node-fetch@3, doesn't need file extension because types are at ./@types/index.d.ts */
|
|
7597
|
+
declare type NodeFetch3RequestInit = NotAny<import('../node_modules/node-fetch').RequestInit> | NotAny<import('../../node_modules/node-fetch').RequestInit> | NotAny<import('../../../node_modules/node-fetch').RequestInit> | NotAny<import('../../../../node_modules/node-fetch').RequestInit> | NotAny<import('../../../../../node_modules/node-fetch').RequestInit> | NotAny<import('../../../../../../node_modules/node-fetch').RequestInit> | NotAny<import('../../../../../../../node_modules/node-fetch').RequestInit> | NotAny<import('../../../../../../../../node_modules/node-fetch').RequestInit> | NotAny<import('../../../../../../../../../node_modules/node-fetch').RequestInit> | NotAny<import('../../../../../../../../../../node_modules/node-fetch').RequestInit>;
|
|
7598
|
+
|
|
7599
|
+
/** @ts-ignore */
|
|
7600
|
+
declare type _NodeReadableStream<R = any> = ReadableStream_2<R>;
|
|
7601
|
+
|
|
7602
|
+
declare type NotAny<T> = [0] extends [1 & T] ? never : T;
|
|
7603
|
+
|
|
7604
|
+
declare class NotFoundError extends APIError<404, Headers> {
|
|
7605
|
+
}
|
|
7606
|
+
|
|
7607
|
+
/**
|
|
7608
|
+
* @internal
|
|
7609
|
+
* Users can pass explicit nulls to unset default headers. When we parse them
|
|
7610
|
+
* into a standard headers type we need to preserve that information.
|
|
7611
|
+
*/
|
|
7612
|
+
declare type NullableHeaders = {
|
|
7613
|
+
/** Brand check, prevent users from creating a NullableHeaders. */
|
|
7614
|
+
[brand_privateNullableHeaders]: true;
|
|
7615
|
+
/** Parsed headers. */
|
|
7616
|
+
values: Headers;
|
|
7617
|
+
/** Set of lowercase header names explicitly set to null. */
|
|
7618
|
+
nulls: Set<string>;
|
|
7619
|
+
};
|
|
7620
|
+
|
|
6083
7621
|
/** A long-running operation. */
|
|
6084
7622
|
export declare interface Operation<T> {
|
|
6085
7623
|
/** The server-assigned name, which is only unique within the same service that originally returns it. If you use the default HTTP mapping, the `name` should be a resource name ending with `operations/{unique_id}`. */
|
|
@@ -6156,6 +7694,23 @@ export declare enum Outcome {
|
|
|
6156
7694
|
OUTCOME_DEADLINE_EXCEEDED = "OUTCOME_DEADLINE_EXCEEDED"
|
|
6157
7695
|
}
|
|
6158
7696
|
|
|
7697
|
+
/**
|
|
7698
|
+
* Some environments overload the global fetch function, and Parameters<T> only gets the last signature.
|
|
7699
|
+
*/
|
|
7700
|
+
declare type OverloadedParameters<T> = T extends ({
|
|
7701
|
+
(...args: infer A): unknown;
|
|
7702
|
+
(...args: infer B): unknown;
|
|
7703
|
+
(...args: infer C): unknown;
|
|
7704
|
+
(...args: infer D): unknown;
|
|
7705
|
+
}) ? A | B | C | D : T extends ({
|
|
7706
|
+
(...args: infer A): unknown;
|
|
7707
|
+
(...args: infer B): unknown;
|
|
7708
|
+
(...args: infer C): unknown;
|
|
7709
|
+
}) ? A | B | C : T extends ({
|
|
7710
|
+
(...args: infer A): unknown;
|
|
7711
|
+
(...args: infer B): unknown;
|
|
7712
|
+
}) ? A | B : T extends (...args: infer A) => unknown ? A : never;
|
|
7713
|
+
|
|
6159
7714
|
export declare enum PagedItem {
|
|
6160
7715
|
PAGED_ITEM_BATCH_JOBS = "batchJobs",
|
|
6161
7716
|
PAGED_ITEM_MODELS = "models",
|
|
@@ -6363,7 +7918,11 @@ export declare enum PartMediaResolutionLevel {
|
|
|
6363
7918
|
/**
|
|
6364
7919
|
* Media resolution set to high.
|
|
6365
7920
|
*/
|
|
6366
|
-
MEDIA_RESOLUTION_HIGH = "MEDIA_RESOLUTION_HIGH"
|
|
7921
|
+
MEDIA_RESOLUTION_HIGH = "MEDIA_RESOLUTION_HIGH",
|
|
7922
|
+
/**
|
|
7923
|
+
* Media resolution set to ultra high.
|
|
7924
|
+
*/
|
|
7925
|
+
MEDIA_RESOLUTION_ULTRA_HIGH = "MEDIA_RESOLUTION_ULTRA_HIGH"
|
|
6367
7926
|
}
|
|
6368
7927
|
|
|
6369
7928
|
/** Tuning spec for Partner models. This data type is not supported in Gemini API. */
|
|
@@ -6378,6 +7937,9 @@ export declare interface PartnerModelTuningSpec {
|
|
|
6378
7937
|
|
|
6379
7938
|
export declare type PartUnion = Part | string;
|
|
6380
7939
|
|
|
7940
|
+
declare class PermissionDeniedError extends APIError<403, Headers> {
|
|
7941
|
+
}
|
|
7942
|
+
|
|
6381
7943
|
/** Enum that controls the generation of people. */
|
|
6382
7944
|
export declare enum PersonGeneration {
|
|
6383
7945
|
/**
|
|
@@ -6500,6 +8062,13 @@ export declare interface ProductImage {
|
|
|
6500
8062
|
productImage?: Image_2;
|
|
6501
8063
|
}
|
|
6502
8064
|
|
|
8065
|
+
/**
|
|
8066
|
+
* @license
|
|
8067
|
+
* Copyright 2025 Google LLC
|
|
8068
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
8069
|
+
*/
|
|
8070
|
+
declare type PromiseOrValue<T> = T | Promise<T>;
|
|
8071
|
+
|
|
6503
8072
|
/** A RagChunk includes the content of a chunk of a RagFile, and associated metadata. This data type is not supported in Gemini API. */
|
|
6504
8073
|
export declare interface RagChunk {
|
|
6505
8074
|
/** If populated, represents where the chunk starts and ends in the document. */
|
|
@@ -6564,6 +8133,9 @@ export declare interface RagRetrievalConfigRankingRankService {
|
|
|
6564
8133
|
modelName?: string;
|
|
6565
8134
|
}
|
|
6566
8135
|
|
|
8136
|
+
declare class RateLimitError extends APIError<429, Headers> {
|
|
8137
|
+
}
|
|
8138
|
+
|
|
6567
8139
|
/** A raw reference image.
|
|
6568
8140
|
|
|
6569
8141
|
A raw reference image represents the base image to edit, provided by the user.
|
|
@@ -6580,6 +8152,8 @@ export declare class RawReferenceImage {
|
|
|
6580
8152
|
toReferenceImageAPI(): ReferenceImageAPIInternal;
|
|
6581
8153
|
}
|
|
6582
8154
|
|
|
8155
|
+
declare type _ReadableStream_2<R = any> = NeverToAny<([0] extends [1 & _DOMReadableStream<R>] ? never : _DOMReadableStream<R>) | ([0] extends [1 & _ConditionalNodeReadableStream<R>] ? never : _ConditionalNodeReadableStream<R>)>;
|
|
8156
|
+
|
|
6583
8157
|
/** Marks the end of user activity.
|
|
6584
8158
|
|
|
6585
8159
|
This can only be sent if automatic (i.e. server-side) activity detection is
|
|
@@ -6719,6 +8293,82 @@ export declare interface ReplicatedVoiceConfig {
|
|
|
6719
8293
|
voiceSampleAudio?: string;
|
|
6720
8294
|
}
|
|
6721
8295
|
|
|
8296
|
+
/**
|
|
8297
|
+
* The type for the first argument to `fetch`.
|
|
8298
|
+
*
|
|
8299
|
+
* https://developer.mozilla.org/docs/Web/API/Window/fetch#resource
|
|
8300
|
+
*/
|
|
8301
|
+
declare type _RequestInfo = Request | URL | string;
|
|
8302
|
+
|
|
8303
|
+
/**
|
|
8304
|
+
* An alias to the builtin `RequestInit` type so we can
|
|
8305
|
+
* easily alias it in import statements if there are name clashes.
|
|
8306
|
+
*
|
|
8307
|
+
* https://developer.mozilla.org/docs/Web/API/RequestInit
|
|
8308
|
+
*/
|
|
8309
|
+
declare type _RequestInit = RequestInit;
|
|
8310
|
+
|
|
8311
|
+
declare type RequestInits = NotAny<UndiciTypesRequestInit> | NotAny<UndiciRequestInit> | NotAny<BunRequestInit> | NotAny<NodeFetch2RequestInit> | NotAny<NodeFetch3RequestInit> | NotAny<RequestInit> | NotAny<FetchRequestInit>;
|
|
8312
|
+
|
|
8313
|
+
declare type RequestOptions = {
|
|
8314
|
+
/**
|
|
8315
|
+
* The HTTP method for the request (e.g., 'get', 'post', 'put', 'delete').
|
|
8316
|
+
*/
|
|
8317
|
+
method?: HTTPMethod;
|
|
8318
|
+
/**
|
|
8319
|
+
* The URL path for the request.
|
|
8320
|
+
*
|
|
8321
|
+
* @example "/v1/foo"
|
|
8322
|
+
*/
|
|
8323
|
+
path?: string;
|
|
8324
|
+
/**
|
|
8325
|
+
* Query parameters to include in the request URL.
|
|
8326
|
+
*/
|
|
8327
|
+
query?: object | undefined | null;
|
|
8328
|
+
/**
|
|
8329
|
+
* The request body. Can be a string, JSON object, FormData, or other supported types.
|
|
8330
|
+
*/
|
|
8331
|
+
body?: unknown;
|
|
8332
|
+
/**
|
|
8333
|
+
* HTTP headers to include with the request. Can be a Headers object, plain object, or array of tuples.
|
|
8334
|
+
*/
|
|
8335
|
+
headers?: HeadersLike;
|
|
8336
|
+
/**
|
|
8337
|
+
* The maximum number of times that the client will retry a request in case of a
|
|
8338
|
+
* temporary failure, like a network error or a 5XX error from the server.
|
|
8339
|
+
*
|
|
8340
|
+
* @default 2
|
|
8341
|
+
*/
|
|
8342
|
+
maxRetries?: number;
|
|
8343
|
+
stream?: boolean | undefined;
|
|
8344
|
+
/**
|
|
8345
|
+
* The maximum amount of time (in milliseconds) that the client should wait for a response
|
|
8346
|
+
* from the server before timing out a single request.
|
|
8347
|
+
*
|
|
8348
|
+
* @unit milliseconds
|
|
8349
|
+
*/
|
|
8350
|
+
timeout?: number;
|
|
8351
|
+
/**
|
|
8352
|
+
* Additional `RequestInit` options to be passed to the underlying `fetch` call.
|
|
8353
|
+
* These options will be merged with the client's default fetch options.
|
|
8354
|
+
*/
|
|
8355
|
+
fetchOptions?: MergedRequestInit;
|
|
8356
|
+
/**
|
|
8357
|
+
* An AbortSignal that can be used to cancel the request.
|
|
8358
|
+
*/
|
|
8359
|
+
signal?: AbortSignal | undefined | null;
|
|
8360
|
+
/**
|
|
8361
|
+
* A unique key for this request to enable idempotency.
|
|
8362
|
+
*/
|
|
8363
|
+
idempotencyKey?: string;
|
|
8364
|
+
/**
|
|
8365
|
+
* Override the default base URL for this specific request.
|
|
8366
|
+
*/
|
|
8367
|
+
defaultBaseURL?: string | undefined;
|
|
8368
|
+
__binaryResponse?: boolean | undefined;
|
|
8369
|
+
__streamClass?: typeof Stream;
|
|
8370
|
+
};
|
|
8371
|
+
|
|
6722
8372
|
/** Defines a retrieval tool that model can call to access external knowledge. This data type is not supported in Gemini API. */
|
|
6723
8373
|
export declare interface Retrieval {
|
|
6724
8374
|
/** Optional. Deprecated. This option is no longer supported. */
|
|
@@ -7214,10 +8864,28 @@ export declare interface SpeechConfig {
|
|
|
7214
8864
|
voiceConfig?: VoiceConfig;
|
|
7215
8865
|
/** Optional. Language code (ISO 639. e.g. en-US) for the speech synthesization. */
|
|
7216
8866
|
languageCode?: string;
|
|
7217
|
-
/**
|
|
8867
|
+
/** The configuration for a multi-speaker text-to-speech request. This field is mutually exclusive with `voice_config`. */
|
|
7218
8868
|
multiSpeakerVoiceConfig?: MultiSpeakerVoiceConfig;
|
|
7219
8869
|
}
|
|
7220
8870
|
|
|
8871
|
+
/**
|
|
8872
|
+
* The configuration for speech interaction.
|
|
8873
|
+
*/
|
|
8874
|
+
declare interface SpeechConfig_2 {
|
|
8875
|
+
/**
|
|
8876
|
+
* The language of the speech.
|
|
8877
|
+
*/
|
|
8878
|
+
language?: string;
|
|
8879
|
+
/**
|
|
8880
|
+
* The speaker's name, it should match the speaker name given in the prompt.
|
|
8881
|
+
*/
|
|
8882
|
+
speaker?: string;
|
|
8883
|
+
/**
|
|
8884
|
+
* The voice of the speaker.
|
|
8885
|
+
*/
|
|
8886
|
+
voice?: string;
|
|
8887
|
+
}
|
|
8888
|
+
|
|
7221
8889
|
export declare type SpeechConfigUnion = SpeechConfig | string;
|
|
7222
8890
|
|
|
7223
8891
|
/** Start of speech sensitivity. */
|
|
@@ -7236,6 +8904,31 @@ export declare enum StartSensitivity {
|
|
|
7236
8904
|
START_SENSITIVITY_LOW = "START_SENSITIVITY_LOW"
|
|
7237
8905
|
}
|
|
7238
8906
|
|
|
8907
|
+
declare class Stream<Item> implements AsyncIterable<Item> {
|
|
8908
|
+
private iterator;
|
|
8909
|
+
controller: AbortController;
|
|
8910
|
+
private client;
|
|
8911
|
+
constructor(iterator: () => AsyncIterator<Item>, controller: AbortController, client?: BaseGeminiNextGenAPIClient);
|
|
8912
|
+
static fromSSEResponse<Item>(response: Response, controller: AbortController, client?: BaseGeminiNextGenAPIClient): Stream<Item>;
|
|
8913
|
+
/**
|
|
8914
|
+
* Generates a Stream from a newline-separated ReadableStream
|
|
8915
|
+
* where each item is a JSON value.
|
|
8916
|
+
*/
|
|
8917
|
+
static fromReadableStream<Item>(readableStream: _ReadableStream_2, controller: AbortController, client?: BaseGeminiNextGenAPIClient): Stream<Item>;
|
|
8918
|
+
[Symbol.asyncIterator](): AsyncIterator<Item>;
|
|
8919
|
+
/**
|
|
8920
|
+
* Splits the stream into two streams which can be
|
|
8921
|
+
* independently read from at different speeds.
|
|
8922
|
+
*/
|
|
8923
|
+
tee(): [Stream<Item>, Stream<Item>];
|
|
8924
|
+
/**
|
|
8925
|
+
* Converts this stream to a newline-separated ReadableStream of
|
|
8926
|
+
* JSON stringified values in the stream
|
|
8927
|
+
* which can be turned back into a Stream with `Stream.fromReadableStream()`.
|
|
8928
|
+
*/
|
|
8929
|
+
toReadableStream(): _ReadableStream_2;
|
|
8930
|
+
}
|
|
8931
|
+
|
|
7239
8932
|
/** User provided string values assigned to a single metadata key. This data type is not supported in Vertex AI. */
|
|
7240
8933
|
export declare interface StringList {
|
|
7241
8934
|
/** The string values of the metadata to store. */
|
|
@@ -7417,6 +9110,21 @@ export declare interface TestTableItem {
|
|
|
7417
9110
|
ignoreKeys?: string[];
|
|
7418
9111
|
}
|
|
7419
9112
|
|
|
9113
|
+
/**
|
|
9114
|
+
* A text content block.
|
|
9115
|
+
*/
|
|
9116
|
+
declare interface TextContent {
|
|
9117
|
+
type: 'text';
|
|
9118
|
+
/**
|
|
9119
|
+
* Citation information for model-generated content.
|
|
9120
|
+
*/
|
|
9121
|
+
annotations?: Array<Annotation>;
|
|
9122
|
+
/**
|
|
9123
|
+
* The text content.
|
|
9124
|
+
*/
|
|
9125
|
+
text?: string;
|
|
9126
|
+
}
|
|
9127
|
+
|
|
7420
9128
|
/** The thinking features configuration. */
|
|
7421
9129
|
export declare interface ThinkingConfig {
|
|
7422
9130
|
/** Indicates whether to include thoughts in the response. If true, thoughts are returned only if the model supports thought and thoughts are available.
|
|
@@ -7425,24 +9133,49 @@ export declare interface ThinkingConfig {
|
|
|
7425
9133
|
/** Indicates the thinking budget in tokens. 0 is DISABLED. -1 is AUTOMATIC. The default values and allowed ranges are model dependent.
|
|
7426
9134
|
*/
|
|
7427
9135
|
thinkingBudget?: number;
|
|
7428
|
-
/** Optional. The
|
|
9136
|
+
/** Optional. The number of thoughts tokens that the model should generate. */
|
|
7429
9137
|
thinkingLevel?: ThinkingLevel;
|
|
7430
9138
|
}
|
|
7431
9139
|
|
|
7432
|
-
/** The
|
|
9140
|
+
/** The number of thoughts tokens that the model should generate. */
|
|
7433
9141
|
export declare enum ThinkingLevel {
|
|
7434
9142
|
/**
|
|
7435
|
-
*
|
|
9143
|
+
* Unspecified thinking level.
|
|
7436
9144
|
*/
|
|
7437
9145
|
THINKING_LEVEL_UNSPECIFIED = "THINKING_LEVEL_UNSPECIFIED",
|
|
7438
9146
|
/**
|
|
7439
9147
|
* Low thinking level.
|
|
7440
9148
|
*/
|
|
7441
9149
|
LOW = "LOW",
|
|
9150
|
+
/**
|
|
9151
|
+
* Medium thinking level.
|
|
9152
|
+
*/
|
|
9153
|
+
MEDIUM = "MEDIUM",
|
|
7442
9154
|
/**
|
|
7443
9155
|
* High thinking level.
|
|
7444
9156
|
*/
|
|
7445
|
-
HIGH = "HIGH"
|
|
9157
|
+
HIGH = "HIGH",
|
|
9158
|
+
/**
|
|
9159
|
+
* MINIMAL thinking level.
|
|
9160
|
+
*/
|
|
9161
|
+
MINIMAL = "MINIMAL"
|
|
9162
|
+
}
|
|
9163
|
+
|
|
9164
|
+
declare type ThinkingLevel_2 = 'minimal' | 'low' | 'medium' | 'high';
|
|
9165
|
+
|
|
9166
|
+
/**
|
|
9167
|
+
* A thought content block.
|
|
9168
|
+
*/
|
|
9169
|
+
declare interface ThoughtContent {
|
|
9170
|
+
type: 'thought';
|
|
9171
|
+
/**
|
|
9172
|
+
* Signature to match the backend source to be part of the generation.
|
|
9173
|
+
*/
|
|
9174
|
+
signature?: string;
|
|
9175
|
+
/**
|
|
9176
|
+
* A summary of the thought.
|
|
9177
|
+
*/
|
|
9178
|
+
summary?: Array<TextContent | ImageContent>;
|
|
7446
9179
|
}
|
|
7447
9180
|
|
|
7448
9181
|
export declare class Tokens extends BaseModule {
|
|
@@ -7571,6 +9304,103 @@ export declare interface Tool {
|
|
|
7571
9304
|
urlContext?: UrlContext;
|
|
7572
9305
|
}
|
|
7573
9306
|
|
|
9307
|
+
/**
|
|
9308
|
+
* A tool that can be used by the model.
|
|
9309
|
+
*/
|
|
9310
|
+
declare type Tool_2 = Function_2 | Tool_2.GoogleSearch | Tool_2.CodeExecution | Tool_2.URLContext | Tool_2.ComputerUse | Tool_2.MCPServer | Tool_2.FileSearch;
|
|
9311
|
+
|
|
9312
|
+
declare namespace Tool_2 {
|
|
9313
|
+
/**
|
|
9314
|
+
* A tool that can be used by the model to search Google.
|
|
9315
|
+
*/
|
|
9316
|
+
interface GoogleSearch {
|
|
9317
|
+
type: 'google_search';
|
|
9318
|
+
}
|
|
9319
|
+
/**
|
|
9320
|
+
* A tool that can be used by the model to execute code.
|
|
9321
|
+
*/
|
|
9322
|
+
interface CodeExecution {
|
|
9323
|
+
type: 'code_execution';
|
|
9324
|
+
}
|
|
9325
|
+
/**
|
|
9326
|
+
* A tool that can be used by the model to fetch URL context.
|
|
9327
|
+
*/
|
|
9328
|
+
interface URLContext {
|
|
9329
|
+
type: 'url_context';
|
|
9330
|
+
}
|
|
9331
|
+
/**
|
|
9332
|
+
* A tool that can be used by the model to interact with the computer.
|
|
9333
|
+
*/
|
|
9334
|
+
interface ComputerUse {
|
|
9335
|
+
type: 'computer_use';
|
|
9336
|
+
/**
|
|
9337
|
+
* The environment being operated.
|
|
9338
|
+
*/
|
|
9339
|
+
environment?: 'browser';
|
|
9340
|
+
/**
|
|
9341
|
+
* The list of predefined functions that are excluded from the model call.
|
|
9342
|
+
*/
|
|
9343
|
+
excludedPredefinedFunctions?: Array<string>;
|
|
9344
|
+
}
|
|
9345
|
+
/**
|
|
9346
|
+
* A MCPServer is a server that can be called by the model to perform actions.
|
|
9347
|
+
*/
|
|
9348
|
+
interface MCPServer {
|
|
9349
|
+
type: 'mcp_server';
|
|
9350
|
+
/**
|
|
9351
|
+
* The allowed tools.
|
|
9352
|
+
*/
|
|
9353
|
+
allowed_tools?: Array<InteractionsAPI.AllowedTools>;
|
|
9354
|
+
/**
|
|
9355
|
+
* Optional: Fields for authentication headers, timeouts, etc., if needed.
|
|
9356
|
+
*/
|
|
9357
|
+
headers?: {
|
|
9358
|
+
[key: string]: string;
|
|
9359
|
+
};
|
|
9360
|
+
/**
|
|
9361
|
+
* The name of the MCPServer.
|
|
9362
|
+
*/
|
|
9363
|
+
name?: string;
|
|
9364
|
+
/**
|
|
9365
|
+
* The full URL for the MCPServer endpoint.
|
|
9366
|
+
* Example: "https://api.example.com/mcp"
|
|
9367
|
+
*/
|
|
9368
|
+
url?: string;
|
|
9369
|
+
}
|
|
9370
|
+
/**
|
|
9371
|
+
* A tool that can be used by the model to search files.
|
|
9372
|
+
*/
|
|
9373
|
+
interface FileSearch {
|
|
9374
|
+
type: 'file_search';
|
|
9375
|
+
/**
|
|
9376
|
+
* The file search store names to search.
|
|
9377
|
+
*/
|
|
9378
|
+
file_search_store_names?: Array<string>;
|
|
9379
|
+
/**
|
|
9380
|
+
* Metadata filter to apply to the semantic retrieval documents and chunks.
|
|
9381
|
+
*/
|
|
9382
|
+
metadata_filter?: string;
|
|
9383
|
+
/**
|
|
9384
|
+
* The number of semantic retrieval chunks to retrieve.
|
|
9385
|
+
*/
|
|
9386
|
+
top_k?: number;
|
|
9387
|
+
}
|
|
9388
|
+
}
|
|
9389
|
+
|
|
9390
|
+
/**
|
|
9391
|
+
* The configuration for tool choice.
|
|
9392
|
+
*/
|
|
9393
|
+
declare type ToolChoice = ToolChoiceType | ToolChoiceConfig;
|
|
9394
|
+
|
|
9395
|
+
declare interface ToolChoiceConfig {
|
|
9396
|
+
/**
|
|
9397
|
+
* The configuration for allowed tools.
|
|
9398
|
+
*/
|
|
9399
|
+
allowed_tools?: AllowedTools;
|
|
9400
|
+
}
|
|
9401
|
+
|
|
9402
|
+
declare type ToolChoiceType = 'auto' | 'any' | 'none' | 'validated';
|
|
9403
|
+
|
|
7574
9404
|
/** Tool that executes code generated by the model, and automatically returns the result to the model. See also [ExecutableCode]and [CodeExecutionResult] which are input and output to this tool. This data type is not supported in Gemini API. */
|
|
7575
9405
|
export declare interface ToolCodeExecution {
|
|
7576
9406
|
}
|
|
@@ -7868,6 +9698,18 @@ export declare interface TuningValidationDataset {
|
|
|
7868
9698
|
vertexDatasetResource?: string;
|
|
7869
9699
|
}
|
|
7870
9700
|
|
|
9701
|
+
declare interface Turn {
|
|
9702
|
+
/**
|
|
9703
|
+
* The content of the turn.
|
|
9704
|
+
*/
|
|
9705
|
+
content?: string | Array<TextContent | ImageContent | AudioContent | DocumentContent | VideoContent | ThoughtContent | FunctionCallContent | FunctionResultContent | CodeExecutionCallContent | CodeExecutionResultContent | URLContextCallContent | URLContextResultContent | GoogleSearchCallContent | GoogleSearchResultContent | MCPServerToolCallContent | MCPServerToolResultContent | FileSearchResultContent>;
|
|
9706
|
+
/**
|
|
9707
|
+
* The originator of this turn. Must be user for input or model for
|
|
9708
|
+
* model output.
|
|
9709
|
+
*/
|
|
9710
|
+
role?: string;
|
|
9711
|
+
}
|
|
9712
|
+
|
|
7871
9713
|
/** The reason why the turn is complete. */
|
|
7872
9714
|
export declare enum TurnCompleteReason {
|
|
7873
9715
|
/**
|
|
@@ -8001,6 +9843,7 @@ declare namespace types {
|
|
|
8001
9843
|
FileSource,
|
|
8002
9844
|
TurnCompleteReason,
|
|
8003
9845
|
MediaModality,
|
|
9846
|
+
VadSignalType,
|
|
8004
9847
|
StartSensitivity,
|
|
8005
9848
|
EndSensitivity,
|
|
8006
9849
|
ActivityHandling,
|
|
@@ -8322,6 +10165,7 @@ declare namespace types {
|
|
|
8322
10165
|
UsageMetadata,
|
|
8323
10166
|
LiveServerGoAway,
|
|
8324
10167
|
LiveServerSessionResumptionUpdate,
|
|
10168
|
+
VoiceActivityDetectionSignal,
|
|
8325
10169
|
LiveServerMessage,
|
|
8326
10170
|
OperationFromAPIResponseParameters,
|
|
8327
10171
|
GenerationConfigThinkingConfig,
|
|
@@ -8387,6 +10231,37 @@ declare namespace types {
|
|
|
8387
10231
|
}
|
|
8388
10232
|
}
|
|
8389
10233
|
|
|
10234
|
+
/** @ts-ignore For users with undici */
|
|
10235
|
+
declare type UndiciRequestInit = NotAny<import('../node_modules/undici/index.d.ts').RequestInit> | NotAny<import('../../node_modules/undici/index.d.ts').RequestInit> | NotAny<import('../../../node_modules/undici/index.d.ts').RequestInit> | NotAny<import('../../../../node_modules/undici/index.d.ts').RequestInit> | NotAny<import('../../../../../node_modules/undici/index.d.ts').RequestInit> | NotAny<import('../../../../../../node_modules/undici/index.d.ts').RequestInit> | NotAny<import('../../../../../../../node_modules/undici/index.d.ts').RequestInit> | NotAny<import('../../../../../../../../node_modules/undici/index.d.ts').RequestInit> | NotAny<import('../../../../../../../../../node_modules/undici/index.d.ts').RequestInit> | NotAny<import('../../../../../../../../../../node_modules/undici/index.d.ts').RequestInit>;
|
|
10236
|
+
|
|
10237
|
+
/**
|
|
10238
|
+
* These imports attempt to get types from a parent package's dependencies.
|
|
10239
|
+
* Unresolved bare specifiers can trigger [automatic type acquisition][1] in some projects, which
|
|
10240
|
+
* would cause typescript to show types not present at runtime. To avoid this, we import
|
|
10241
|
+
* directly from parent node_modules folders.
|
|
10242
|
+
*
|
|
10243
|
+
* We need to check multiple levels because we don't know what directory structure we'll be in.
|
|
10244
|
+
* For example, pnpm generates directories like this:
|
|
10245
|
+
* ```
|
|
10246
|
+
* node_modules
|
|
10247
|
+
* ├── .pnpm
|
|
10248
|
+
* │ └── pkg@1.0.0
|
|
10249
|
+
* │ └── node_modules
|
|
10250
|
+
* │ └── pkg
|
|
10251
|
+
* │ └── internal
|
|
10252
|
+
* │ └── types.d.ts
|
|
10253
|
+
* ├── pkg -> .pnpm/pkg@1.0.0/node_modules/pkg
|
|
10254
|
+
* └── undici
|
|
10255
|
+
* ```
|
|
10256
|
+
*
|
|
10257
|
+
* [1]: https://www.typescriptlang.org/tsconfig/#typeAcquisition
|
|
10258
|
+
*/
|
|
10259
|
+
/** @ts-ignore For users with \@types/node */
|
|
10260
|
+
declare type UndiciTypesRequestInit = NotAny<import('../node_modules/undici-types/index.d.ts').RequestInit> | NotAny<import('../../node_modules/undici-types/index.d.ts').RequestInit> | NotAny<import('../../../node_modules/undici-types/index.d.ts').RequestInit> | NotAny<import('../../../../node_modules/undici-types/index.d.ts').RequestInit> | NotAny<import('../../../../../node_modules/undici-types/index.d.ts').RequestInit> | NotAny<import('../../../../../../node_modules/undici-types/index.d.ts').RequestInit> | NotAny<import('../../../../../../../node_modules/undici-types/index.d.ts').RequestInit> | NotAny<import('../../../../../../../../node_modules/undici-types/index.d.ts').RequestInit> | NotAny<import('../../../../../../../../../node_modules/undici-types/index.d.ts').RequestInit> | NotAny<import('../../../../../../../../../../node_modules/undici-types/index.d.ts').RequestInit>;
|
|
10261
|
+
|
|
10262
|
+
declare class UnprocessableEntityError extends APIError<422, Headers> {
|
|
10263
|
+
}
|
|
10264
|
+
|
|
8390
10265
|
/** Optional parameters for caches.update method. */
|
|
8391
10266
|
export declare interface UpdateCachedContentConfig {
|
|
8392
10267
|
/** Used to override HTTP request options. */
|
|
@@ -8637,12 +10512,74 @@ export declare class UpscaleImageResponse {
|
|
|
8637
10512
|
export declare interface UrlContext {
|
|
8638
10513
|
}
|
|
8639
10514
|
|
|
10515
|
+
/**
|
|
10516
|
+
* The arguments to pass to the URL context.
|
|
10517
|
+
*/
|
|
10518
|
+
declare interface URLContextCallArguments {
|
|
10519
|
+
/**
|
|
10520
|
+
* The URLs to fetch.
|
|
10521
|
+
*/
|
|
10522
|
+
urls?: Array<string>;
|
|
10523
|
+
}
|
|
10524
|
+
|
|
10525
|
+
/**
|
|
10526
|
+
* URL context content.
|
|
10527
|
+
*/
|
|
10528
|
+
declare interface URLContextCallContent {
|
|
10529
|
+
type: 'url_context_call';
|
|
10530
|
+
/**
|
|
10531
|
+
* A unique ID for this specific tool call.
|
|
10532
|
+
*/
|
|
10533
|
+
id?: string;
|
|
10534
|
+
/**
|
|
10535
|
+
* The arguments to pass to the URL context.
|
|
10536
|
+
*/
|
|
10537
|
+
arguments?: URLContextCallArguments;
|
|
10538
|
+
}
|
|
10539
|
+
|
|
8640
10540
|
/** Metadata related to url context retrieval tool. */
|
|
8641
10541
|
export declare interface UrlContextMetadata {
|
|
8642
10542
|
/** Output only. List of url context. */
|
|
8643
10543
|
urlMetadata?: UrlMetadata[];
|
|
8644
10544
|
}
|
|
8645
10545
|
|
|
10546
|
+
/**
|
|
10547
|
+
* The result of the URL context.
|
|
10548
|
+
*/
|
|
10549
|
+
declare interface URLContextResult {
|
|
10550
|
+
/**
|
|
10551
|
+
* The status of the URL retrieval.
|
|
10552
|
+
*/
|
|
10553
|
+
status?: 'success' | 'error' | 'paywall' | 'unsafe';
|
|
10554
|
+
/**
|
|
10555
|
+
* The URL that was fetched.
|
|
10556
|
+
*/
|
|
10557
|
+
url?: string;
|
|
10558
|
+
}
|
|
10559
|
+
|
|
10560
|
+
/**
|
|
10561
|
+
* URL context result content.
|
|
10562
|
+
*/
|
|
10563
|
+
declare interface URLContextResultContent {
|
|
10564
|
+
type: 'url_context_result';
|
|
10565
|
+
/**
|
|
10566
|
+
* ID to match the ID from the url context call block.
|
|
10567
|
+
*/
|
|
10568
|
+
call_id?: string;
|
|
10569
|
+
/**
|
|
10570
|
+
* Whether the URL context resulted in an error.
|
|
10571
|
+
*/
|
|
10572
|
+
is_error?: boolean;
|
|
10573
|
+
/**
|
|
10574
|
+
* The results of the URL context.
|
|
10575
|
+
*/
|
|
10576
|
+
result?: Array<URLContextResult>;
|
|
10577
|
+
/**
|
|
10578
|
+
* The signature of the URL context result.
|
|
10579
|
+
*/
|
|
10580
|
+
signature?: string;
|
|
10581
|
+
}
|
|
10582
|
+
|
|
8646
10583
|
/** Context of the a single url retrieval. */
|
|
8647
10584
|
export declare interface UrlMetadata {
|
|
8648
10585
|
/** Retrieved url by the tool. */
|
|
@@ -8675,6 +10612,108 @@ export declare enum UrlRetrievalStatus {
|
|
|
8675
10612
|
URL_RETRIEVAL_STATUS_UNSAFE = "URL_RETRIEVAL_STATUS_UNSAFE"
|
|
8676
10613
|
}
|
|
8677
10614
|
|
|
10615
|
+
/**
|
|
10616
|
+
* Statistics on the interaction request's token usage.
|
|
10617
|
+
*/
|
|
10618
|
+
declare interface Usage {
|
|
10619
|
+
/**
|
|
10620
|
+
* A breakdown of cached token usage by modality.
|
|
10621
|
+
*/
|
|
10622
|
+
cached_tokens_by_modality?: Array<Usage.CachedTokensByModality>;
|
|
10623
|
+
/**
|
|
10624
|
+
* A breakdown of input token usage by modality.
|
|
10625
|
+
*/
|
|
10626
|
+
input_tokens_by_modality?: Array<Usage.InputTokensByModality>;
|
|
10627
|
+
/**
|
|
10628
|
+
* A breakdown of output token usage by modality.
|
|
10629
|
+
*/
|
|
10630
|
+
output_tokens_by_modality?: Array<Usage.OutputTokensByModality>;
|
|
10631
|
+
/**
|
|
10632
|
+
* A breakdown of tool-use token usage by modality.
|
|
10633
|
+
*/
|
|
10634
|
+
tool_use_tokens_by_modality?: Array<Usage.ToolUseTokensByModality>;
|
|
10635
|
+
/**
|
|
10636
|
+
* Number of tokens in the cached part of the prompt (the cached content).
|
|
10637
|
+
*/
|
|
10638
|
+
total_cached_tokens?: number;
|
|
10639
|
+
/**
|
|
10640
|
+
* Number of tokens in the prompt (context).
|
|
10641
|
+
*/
|
|
10642
|
+
total_input_tokens?: number;
|
|
10643
|
+
/**
|
|
10644
|
+
* Total number of tokens across all the generated responses.
|
|
10645
|
+
*/
|
|
10646
|
+
total_output_tokens?: number;
|
|
10647
|
+
/**
|
|
10648
|
+
* Number of tokens of thoughts for thinking models.
|
|
10649
|
+
*/
|
|
10650
|
+
total_reasoning_tokens?: number;
|
|
10651
|
+
/**
|
|
10652
|
+
* Total token count for the interaction request (prompt + responses + other
|
|
10653
|
+
* internal tokens).
|
|
10654
|
+
*/
|
|
10655
|
+
total_tokens?: number;
|
|
10656
|
+
/**
|
|
10657
|
+
* Number of tokens present in tool-use prompt(s).
|
|
10658
|
+
*/
|
|
10659
|
+
total_tool_use_tokens?: number;
|
|
10660
|
+
}
|
|
10661
|
+
|
|
10662
|
+
declare namespace Usage {
|
|
10663
|
+
/**
|
|
10664
|
+
* The token count for a single response modality.
|
|
10665
|
+
*/
|
|
10666
|
+
interface CachedTokensByModality {
|
|
10667
|
+
/**
|
|
10668
|
+
* The modality associated with the token count.
|
|
10669
|
+
*/
|
|
10670
|
+
modality?: 'text' | 'image' | 'audio';
|
|
10671
|
+
/**
|
|
10672
|
+
* Number of tokens for the modality.
|
|
10673
|
+
*/
|
|
10674
|
+
tokens?: number;
|
|
10675
|
+
}
|
|
10676
|
+
/**
|
|
10677
|
+
* The token count for a single response modality.
|
|
10678
|
+
*/
|
|
10679
|
+
interface InputTokensByModality {
|
|
10680
|
+
/**
|
|
10681
|
+
* The modality associated with the token count.
|
|
10682
|
+
*/
|
|
10683
|
+
modality?: 'text' | 'image' | 'audio';
|
|
10684
|
+
/**
|
|
10685
|
+
* Number of tokens for the modality.
|
|
10686
|
+
*/
|
|
10687
|
+
tokens?: number;
|
|
10688
|
+
}
|
|
10689
|
+
/**
|
|
10690
|
+
* The token count for a single response modality.
|
|
10691
|
+
*/
|
|
10692
|
+
interface OutputTokensByModality {
|
|
10693
|
+
/**
|
|
10694
|
+
* The modality associated with the token count.
|
|
10695
|
+
*/
|
|
10696
|
+
modality?: 'text' | 'image' | 'audio';
|
|
10697
|
+
/**
|
|
10698
|
+
* Number of tokens for the modality.
|
|
10699
|
+
*/
|
|
10700
|
+
tokens?: number;
|
|
10701
|
+
}
|
|
10702
|
+
/**
|
|
10703
|
+
* The token count for a single response modality.
|
|
10704
|
+
*/
|
|
10705
|
+
interface ToolUseTokensByModality {
|
|
10706
|
+
/**
|
|
10707
|
+
* The modality associated with the token count.
|
|
10708
|
+
*/
|
|
10709
|
+
modality?: 'text' | 'image' | 'audio';
|
|
10710
|
+
/**
|
|
10711
|
+
* Number of tokens for the modality.
|
|
10712
|
+
*/
|
|
10713
|
+
tokens?: number;
|
|
10714
|
+
}
|
|
10715
|
+
}
|
|
10716
|
+
|
|
8678
10717
|
/** Usage metadata about response(s). */
|
|
8679
10718
|
export declare interface UsageMetadata {
|
|
8680
10719
|
/** Number of tokens in the prompt. When `cached_content` is set, this is still the total effective prompt size meaning this includes the number of tokens in the cached content. */
|
|
@@ -8702,6 +10741,22 @@ export declare interface UsageMetadata {
|
|
|
8702
10741
|
trafficType?: TrafficType;
|
|
8703
10742
|
}
|
|
8704
10743
|
|
|
10744
|
+
/** The type of the VAD signal. */
|
|
10745
|
+
export declare enum VadSignalType {
|
|
10746
|
+
/**
|
|
10747
|
+
* The default is VAD_SIGNAL_TYPE_UNSPECIFIED.
|
|
10748
|
+
*/
|
|
10749
|
+
VAD_SIGNAL_TYPE_UNSPECIFIED = "VAD_SIGNAL_TYPE_UNSPECIFIED",
|
|
10750
|
+
/**
|
|
10751
|
+
* Start of sentence signal.
|
|
10752
|
+
*/
|
|
10753
|
+
VAD_SIGNAL_TYPE_SOS = "VAD_SIGNAL_TYPE_SOS",
|
|
10754
|
+
/**
|
|
10755
|
+
* End of sentence signal.
|
|
10756
|
+
*/
|
|
10757
|
+
VAD_SIGNAL_TYPE_EOS = "VAD_SIGNAL_TYPE_EOS"
|
|
10758
|
+
}
|
|
10759
|
+
|
|
8705
10760
|
/** Hyperparameters for Veo. This data type is not supported in Gemini API. */
|
|
8706
10761
|
export declare interface VeoHyperParameters {
|
|
8707
10762
|
/** Optional. Number of complete passes the model makes over the entire training dataset during training. */
|
|
@@ -8793,6 +10848,23 @@ export declare enum VideoCompressionQuality {
|
|
|
8793
10848
|
LOSSLESS = "LOSSLESS"
|
|
8794
10849
|
}
|
|
8795
10850
|
|
|
10851
|
+
/**
|
|
10852
|
+
* A video content block.
|
|
10853
|
+
*/
|
|
10854
|
+
declare interface VideoContent {
|
|
10855
|
+
type: 'video';
|
|
10856
|
+
data?: string;
|
|
10857
|
+
/**
|
|
10858
|
+
* The mime type of the video.
|
|
10859
|
+
*/
|
|
10860
|
+
mime_type?: VideoMimeType;
|
|
10861
|
+
/**
|
|
10862
|
+
* The resolution of the media.
|
|
10863
|
+
*/
|
|
10864
|
+
resolution?: 'low' | 'medium' | 'high' | 'ultra_high';
|
|
10865
|
+
uri?: string;
|
|
10866
|
+
}
|
|
10867
|
+
|
|
8796
10868
|
/** A mask for video generation. */
|
|
8797
10869
|
export declare interface VideoGenerationMask {
|
|
8798
10870
|
/** The image mask to use for generating videos. */
|
|
@@ -8864,6 +10936,16 @@ export declare interface VideoMetadata {
|
|
|
8864
10936
|
startOffset?: string;
|
|
8865
10937
|
}
|
|
8866
10938
|
|
|
10939
|
+
/**
|
|
10940
|
+
* The mime type of the video.
|
|
10941
|
+
*/
|
|
10942
|
+
declare type VideoMimeType = 'video/mp4' | 'video/mpeg' | 'video/mov' | 'video/avi' | 'video/x-flv' | 'video/mpg' | 'video/webm' | 'video/wmv' | 'video/3gpp' | (string & {});
|
|
10943
|
+
|
|
10944
|
+
export declare interface VoiceActivityDetectionSignal {
|
|
10945
|
+
/** The type of the VAD signal. */
|
|
10946
|
+
vadSignalType?: VadSignalType;
|
|
10947
|
+
}
|
|
10948
|
+
|
|
8867
10949
|
export declare interface VoiceConfig {
|
|
8868
10950
|
/** If true, the model will use a replicated voice for the response. */
|
|
8869
10951
|
replicatedVoiceConfig?: ReplicatedVoiceConfig;
|