// @ts-ignore import type { Client } from '@modelcontextprotocol/sdk/client/index.js'; import { GoogleAuthOptions } from 'google-auth-library'; /** Marks the end of user activity. This can only be sent if automatic (i.e. server-side) activity detection is disabled. */ export declare interface ActivityEnd { } /** The different ways of handling user activity. */ export declare enum ActivityHandling { /** * If unspecified, the default behavior is `START_OF_ACTIVITY_INTERRUPTS`. */ ACTIVITY_HANDLING_UNSPECIFIED = "ACTIVITY_HANDLING_UNSPECIFIED", /** * If true, start of activity will interrupt the model's response (also called "barge in"). The model's current response will be cut-off in the moment of the interruption. This is the default behavior. */ START_OF_ACTIVITY_INTERRUPTS = "START_OF_ACTIVITY_INTERRUPTS", /** * The model's response will not be interrupted. */ NO_INTERRUPTION = "NO_INTERRUPTION" } /** Marks the start of user activity. This can only be sent if automatic (i.e. server-side) activity detection is disabled. */ export declare interface ActivityStart { } /** Adapter size for tuning. This enum is not supported in Gemini API. */ export declare enum AdapterSize { /** * Adapter size is unspecified. */ ADAPTER_SIZE_UNSPECIFIED = "ADAPTER_SIZE_UNSPECIFIED", /** * Adapter size 1. */ ADAPTER_SIZE_ONE = "ADAPTER_SIZE_ONE", /** * Adapter size 2. */ ADAPTER_SIZE_TWO = "ADAPTER_SIZE_TWO", /** * Adapter size 4. */ ADAPTER_SIZE_FOUR = "ADAPTER_SIZE_FOUR", /** * Adapter size 8. */ ADAPTER_SIZE_EIGHT = "ADAPTER_SIZE_EIGHT", /** * Adapter size 16. */ ADAPTER_SIZE_SIXTEEN = "ADAPTER_SIZE_SIXTEEN", /** * Adapter size 32. */ ADAPTER_SIZE_THIRTY_TWO = "ADAPTER_SIZE_THIRTY_TWO" } declare type AfterErrorContext = HookContext & {}; declare interface AfterErrorHook { /** * A hook that is called after the SDK encounters an error, or a * non-successful response. The hook can introduce instrumentation code such * as logging, tracing and metrics or modify the response or error values. */ afterError: (hookCtx: AfterErrorContext, response: Response | null, error: unknown) => Awaitable_2<{ response: Response | null; error: unknown; }>; } declare type AfterSuccessContext = HookContext & {}; declare interface AfterSuccessHook { /** * A hook that is called after the SDK receives a response. The hook can * introduce instrumentation code such as logging, tracing and metrics or * modify the response before it is handled or throw an error to stop the * response from being handled. */ afterSuccess: (hookCtx: AfterSuccessContext, response: Response) => Awaitable_2; } declare type Agent$ = Agent; /** * An agent definition, used when creating an agent. * * @remarks * This message is the target for annotation-parser-based JSON parsing. * New format: * { * "id": "customer-sentinel", * "base_agent": "", * "system_instruction": "...", * "base_environment": { "type": "remote", "sources": [...] }, * "tools": [ {"type": "code_execution"} ] * } */ declare type Agent = { /** * Configuration parameters for the agent. */ agent_config?: AgentConfig | undefined; /** * The base agent to extend. */ base_agent?: string | undefined; /** * The environment configuration for the agent. */ base_environment?: BaseEnvironment | undefined; /** * Agent description for developers to quickly read and understand. */ description?: string | undefined; /** * The unique identifier for the agent. */ id?: string | undefined; /** * System instruction for the agent. */ system_instruction?: string | undefined; /** * Optional template version the agent is instantiated from * * @remarks * (e.g. "video-agent@v1" or "video-agent@latest"). */ template?: string | undefined; /** * The tools available to the agent. */ tools?: Array | undefined; }; declare type AgentConfig$ = AgentConfig; /** * Configuration parameters for the agent. */ declare type AgentConfig = interactions.AntigravityAgentConfig; declare type AgentCreateParams$ = CreateAgentParams; declare type AgentDeleteParams$ = DeleteAgentParams; declare type AgentDeleteResponse$ = Empty; declare type AgentGetParams$ = GetAgentParams; declare type AgentListParams$ = ListAgentsParams; declare type AgentListResponse$ = AgentListResponse; declare type AgentListResponse = { /** * The list of agents. */ agents?: Array | undefined; /** * A token to retrieve the next page of results. */ next_page_token?: string | undefined; }; /** * @license * Copyright 2026 Google LLC * SPDX-License-Identifier: Apache-2.0 * * g3-prettier-ignore-file */ /** * The agent to interact with. */ declare type AgentOption = "deep-research-preview-04-2026" | "deep-research-max-preview-04-2026" | "antigravity-preview-05-2026" | "antigravity-preview-09-2026" | (string & {}); export declare namespace Agents { export type Agent = Agent$; export type AgentConfig = AgentConfig$; export type AgentCreateParams = AgentCreateParams$; export type AgentDeleteParams = AgentDeleteParams$; export type AgentDeleteResponse = AgentDeleteResponse$; export type AgentGetParams = AgentGetParams$; export type AgentListParams = AgentListParams$; export type AgentListResponse = AgentListResponse$; export type AgentTemplate = AgentTemplate$; export type AgentTemplateCreateParams = AgentTemplateCreateParams$; export type AgentTemplateListResponse = AgentTemplateListResponse$; export type AgentTemplateUpdate = AgentTemplateUpdate$; export type AgentTool = AgentTool$; export type AgentUpdate = AgentUpdate$; export type AgentUpdateParams = AgentUpdateParams$; export type BaseEnvironment = BaseEnvironment$; export namespace Templates { export type AgentTemplate = AgentTemplate$2; export type AgentTemplateCreateParams = AgentTemplateCreateParams$2; export type AgentTemplateDeleteParams = AgentTemplateDeleteParams$; export type AgentTemplateDeleteResponse = AgentTemplateDeleteResponse$; export type AgentTemplateGetParams = AgentTemplateGetParams$; export type AgentTemplateListParams = AgentTemplateListParams$; export type AgentTemplateListResponse = AgentTemplateListResponse$2; export type AgentTemplateUpdate = AgentTemplateUpdate$2; export type AgentTemplateUpdateParams = AgentTemplateUpdateParams$; } } declare namespace agents { export { AgentConfig, AgentListResponse, AgentTemplateCreateParams, AgentTemplateListResponse, AgentTemplateUpdate, AgentTemplate, AgentTool, AgentUpdate, Agent, BaseEnvironment } } declare class Agents_2 extends ClientSDK { private _templates?; get templates(): Templates; /** * Lists all Agents. */ list(params?: ListAgentsParams, options?: Omit): APIPromise; /** * Creates a new Agent (Typed version for SDK). */ create(params: CreateAgentParams, options?: RequestOptions): APIPromise; /** * Deletes an Agent. */ delete(id: string, params?: DeleteAgentParams, options?: Omit): APIPromise; /** * Gets a specific Agent. */ get(id: string, params?: GetAgentParams, options?: Omit): APIPromise; /** * Updates an existing Agent. */ update(id: string, params: UpdateAgentParams, options?: RequestOptions): APIPromise; } declare type AgentTemplate$ = AgentTemplate; declare type AgentTemplate$2 = AgentTemplate; /** * Reusable, versioned definition of an agent. */ declare type AgentTemplate = { /** * Configuration parameters for the agent. */ agent_config?: AgentConfig | undefined; /** * The base agent to extend. */ base_agent?: string | undefined; /** * Output only. Timestamp when this template version was created. */ create_time?: string | undefined; /** * Template description for developers. */ description?: string | undefined; /** * Configuration for a custom environment. */ environment?: interactions.Environment | undefined; /** * User-provided ID on create (e.g. "video-agent"); returned with version * * @remarks * suffix (e.g. "video-agent@v1"). */ id?: string | undefined; /** * System instruction for the agent template. */ system_instruction?: string | undefined; /** * The tools available to agents created from this template. */ tools?: Array | undefined; }; declare type AgentTemplateCreateParams$ = AgentTemplateCreateParams; declare type AgentTemplateCreateParams$2 = AgentTemplateCreateParams; /** * Parameters for creating an agent template. */ declare type AgentTemplateCreateParams = { /** * Configuration parameters for the agent. */ agent_config?: AgentConfig | undefined; /** * The base agent to extend. */ base_agent?: string | undefined; /** * Template description for developers. */ description?: string | undefined; /** * Configuration for a custom environment. */ environment?: interactions.Environment | undefined; /** * Input only. ID of an existing agent to create the template from. The new * * @remarks * template version snapshots the agent's configuration (`base_agent`, * `agent_config`, `system_instruction`, `tools`) and its `.agents/` * directory, but not `/workspace` or credentials. Only valid on create; * returns NOT_FOUND if the agent does not exist. */ from_agent?: string | undefined; /** * User-provided ID on create (e.g. "video-agent"); returned with version * * @remarks * suffix (e.g. "video-agent@v1"). */ id?: string | undefined; /** * System instruction for the agent template. */ system_instruction?: string | undefined; /** * The tools available to agents created from this template. */ tools?: Array | undefined; }; declare type AgentTemplateDeleteParams$ = DeleteAgentTemplateParams; declare type AgentTemplateDeleteResponse$ = Empty; declare type AgentTemplateGetParams$ = GetAgentTemplateParams; declare type AgentTemplateListParams$ = ListAgentTemplatesParams; declare type AgentTemplateListResponse$ = AgentTemplateListResponse; declare type AgentTemplateListResponse$2 = AgentTemplateListResponse; declare type AgentTemplateListResponse = { /** * The list of agent templates (each populated with its latest version). */ agent_templates?: Array | undefined; /** * A token to retrieve the next page of results. */ next_page_token?: string | undefined; }; declare type AgentTemplateUpdate$ = AgentTemplateUpdate; declare type AgentTemplateUpdate$2 = AgentTemplateUpdate; /** * Represents the fields of an AgentTemplate that can be updated. */ declare type AgentTemplateUpdate = { /** * Configuration parameters for the agent. */ agent_config?: AgentConfig | undefined; /** * The base agent to extend. */ base_agent?: string | undefined; /** * Template description for developers. */ description?: string | undefined; /** * Configuration for a custom environment. */ environment?: interactions.Environment | undefined; /** * System instruction for the agent template. */ system_instruction?: string | undefined; /** * The tools available to agents created from this template. */ tools?: Array | undefined; }; declare type AgentTemplateUpdateParams$ = UpdateAgentTemplateParams; declare type AgentTool$ = AgentTool; /** * A tool that the agent can use. */ declare type AgentTool = interactions.CodeExecution | interactions.FunctionT | interactions.GoogleSearch | interactions.MCPServer | interactions.URLContext; declare type AgentUpdate$ = AgentUpdate; /** * Represents the fields of an Agent that can be updated. */ declare type AgentUpdate = { /** * Configuration parameters for the agent. */ agent_config?: AgentConfig | undefined; /** * The base agent to extend. */ base_agent?: string | undefined; /** * The environment configuration for the agent. */ base_environment?: BaseEnvironment | undefined; /** * Agent description for developers to quickly read and understand. */ description?: string | undefined; /** * System instruction for the agent. */ system_instruction?: string | undefined; /** * Optional template version the agent is instantiated from * * @remarks * (e.g. "video-agent@v1" or "video-agent@latest"). */ template?: string | undefined; /** * The tools available to the agent. */ tools?: Array | undefined; }; declare type AgentUpdateParams$ = UpdateAgentParams; /** Aggregation metric. This enum is not supported in Gemini API. */ export declare enum AggregationMetric { /** * Unspecified aggregation metric. */ AGGREGATION_METRIC_UNSPECIFIED = "AGGREGATION_METRIC_UNSPECIFIED", /** * Average aggregation metric. Not supported for Pairwise metric. */ AVERAGE = "AVERAGE", /** * Mode aggregation metric. */ MODE = "MODE", /** * Standard deviation aggregation metric. Not supported for pairwise metric. */ STANDARD_DEVIATION = "STANDARD_DEVIATION", /** * Variance aggregation metric. Not supported for pairwise metric. */ VARIANCE = "VARIANCE", /** * Minimum aggregation metric. Not supported for pairwise metric. */ MINIMUM = "MINIMUM", /** * Maximum aggregation metric. Not supported for pairwise metric. */ MAXIMUM = "MAXIMUM", /** * Median aggregation metric. Not supported for pairwise metric. */ MEDIAN = "MEDIAN", /** * 90th percentile aggregation metric. Not supported for pairwise metric. */ PERCENTILE_P90 = "PERCENTILE_P90", /** * 95th percentile aggregation metric. Not supported for pairwise metric. */ PERCENTILE_P95 = "PERCENTILE_P95", /** * 99th percentile aggregation metric. Not supported for pairwise metric. */ PERCENTILE_P99 = "PERCENTILE_P99" } /** The aggregation result for the entire dataset and all metrics. This data type is not supported in Gemini API. */ export declare interface AggregationOutput { /** One AggregationResult per metric. */ aggregationResults?: AggregationResult[]; /** The dataset used for evaluation & aggregation. */ dataset?: EvaluationDataset; } /** The aggregation result for a single metric. This data type is not supported in Gemini API. */ export declare interface AggregationResult { /** Aggregation metric. */ aggregationMetric?: AggregationMetric; /** Results for bleu metric. */ bleuMetricValue?: BleuMetricValue; /** Result for code execution metric. */ customCodeExecutionResult?: CustomCodeExecutionResult; /** Results for exact match metric. */ exactMatchMetricValue?: ExactMatchMetricValue; /** Result for pairwise metric. */ pairwiseMetricResult?: PairwiseMetricResult; /** Result for pointwise metric. */ pointwiseMetricResult?: PointwiseMetricResult; /** Results for rouge metric. */ rougeMetricValue?: RougeMetricValue; } declare type AllowedTools$ = AllowedTools; /** * The configuration for allowed tools. */ declare type AllowedTools = { mode?: ToolChoiceType | undefined; /** * The names of the allowed tools. */ tools?: Array | undefined; }; /** * List of allowed domains and their configurations. Set to `"disabled"` * * @remarks * to block all network egress. */ declare type Allowlist = Array | Disabled; declare type AllowlistEntry$ = AllowlistEntry; /** * A single domain allowlist rule with optional header injection. */ declare type AllowlistEntry = { /** * Optional. Reference to a server-managed Credential resource by ID. */ credential?: string | undefined; /** * Domain to allow outbound requests to. Supports wildcards (e.g. * * @remarks * '*.googleapis.com'). Use '*' to allow all domains. */ domain: string; /** * Headers to inject on all outbound requests matching this domain. Accepts a single dict or a list of dicts. The egress proxy injects these automatically. */ transform?: Array<{ [k: string]: string; }> | { [k: string]: string; } | undefined; }; declare type Annotation$ = Annotation; /** * Citation information for model-generated content. */ declare type Annotation = FileCitation | PlaceCitation | SpeechAnnotation | URLCitation | WordInfo_2; declare type Answer$ = Answer; /** * Decision answer for a single `CreateDecisionRequest.Question`. */ declare type Answer = ChoiceAnswer | NoulAnswer | ScoreAnswer; declare type AntigravityAgentConfig$ = AntigravityAgentConfig; /** * @license * Copyright 2026 Google LLC * SPDX-License-Identifier: Apache-2.0 * * g3-prettier-ignore-file */ /** * Configuration for the Antigravity agent runtime. * * @remarks * Provides server-side control over the agent's execution environment * and tool configuration. */ declare type AntigravityAgentConfig = { /** * Max total tokens for the agent run. */ max_total_tokens?: string | undefined; /** * The model to use for agent reasoning. */ model?: string | undefined; type: "antigravity"; }; /** 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. */ export declare interface ApiAuth { /** The API secret. */ apiKeyConfig?: ApiAuthApiKeyConfig; } /** The API secret. This data type is not supported in Gemini API. */ export declare interface ApiAuthApiKeyConfig { /** Required. The SecretManager secret version resource name storing API key. e.g. projects/{project}/secrets/{secret}/versions/{version} */ apiKeySecretVersion?: string; /** The API key string. Either this or `api_key_secret_version` must be set. */ apiKeyString?: string; } declare type APICall = { status: "complete"; request: Request; response: Response; } | { status: "request-error"; request: Request; response?: undefined; } | { status: "invalid"; request?: undefined; response?: undefined; }; /** * The ApiClient class is used to send requests to the Gemini API or Vertex AI * endpoints. * * WARNING: This is an internal API and may change without notice. Direct usage * is not supported and may break your application. */ declare class ApiClient { readonly clientOptions: ApiClientInitOptions; private readonly customBaseUrl?; constructor(opts: ApiClientInitOptions); isVertexAI(): boolean; getProject(): string | undefined; getLocation(): string | undefined; getCustomBaseUrl(): string | undefined; getAuthHeaders(): Promise; getApiVersion(): string; getBaseUrl(): string; getRequestUrl(): string; getHeaders(): Record; getFetch(): types.Fetch | undefined; /** * Returns the configured HTTP timeout in milliseconds, if any. */ getTimeout(): number | undefined; private getRequestUrlInternal; getBaseResourcePath(): string; getApiKey(): string | undefined; getWebsocketBaseUrl(): string; setBaseUrl(url: string): void; private resolveApiVersionInPath; private constructUrl; private shouldPrependVertexProjectPath; request(request: HttpRequest): Promise; private patchHttpOptions; requestStream(request: HttpRequest): Promise>; private includeExtraHttpOptionsToRequestInit; private unaryApiCall; private streamApiCall; processStreamResponse(response: Response): AsyncGenerator; private apiCall; getDefaultHeaders(): Record; private getHeadersInternal; private getFileName; /** * Uploads a file asynchronously using Gemini API only, this is not supported * in Vertex AI. * * @param file The string path to the file to be uploaded or a Blob object. * @param config Optional parameters specified in the `UploadFileConfig` * interface. @see {@link types.UploadFileConfig} * @return A promise that resolves to a `File` object. * @throws An error if called on a Vertex AI client. * @throws An error if the `mimeType` is not provided and can not be inferred, */ uploadFile(file: string | Blob, config?: types.UploadFileConfig): Promise; /** * Uploads a file to a given file search store asynchronously using Gemini API only, this is not supported * in Vertex AI. * * @param fileSearchStoreName The name of the file search store to upload the file to. * @param file The string path to the file to be uploaded or a Blob object. * @param config Optional parameters specified in the `UploadFileConfig` * interface. @see {@link UploadFileConfig} * @return A promise that resolves to a `File` object. * @throws An error if called on a Vertex AI client. * @throws An error if the `mimeType` is not provided and can not be inferred, */ uploadFileToFileSearchStore(fileSearchStoreName: string, file: string | Blob, config?: types.UploadToFileSearchStoreConfig): Promise; /** * Downloads a file asynchronously to the specified path. * * @params params - The parameters for the download request, see {@link * types.DownloadFileParameters} */ downloadFile(params: types.DownloadFileParameters): Promise; private fetchUploadUrl; } /** * Options for initializing the ApiClient. The ApiClient uses the parameters * for authentication purposes as well as to infer if SDK should send the * request to Vertex AI or Gemini API. */ declare interface ApiClientInitOptions { /** * The object used for adding authentication headers to API requests. */ auth: Auth; /** * The uploader to use for uploading files. This field is required for * creating a client, will be set through the Node_client or Web_client. */ uploader: Uploader; /** * Optional. The downloader to use for downloading files. This field is * required for creating a client, will be set through the Node_client or * Web_client. */ downloader: Downloader; /** * Optional. The Google Cloud project ID for Vertex AI users. * It is not the numeric project name. * If not provided, SDK will try to resolve it from runtime environment. */ project?: string; /** * Optional. The Google Cloud project location for Vertex AI users. * If not provided, SDK will try to resolve it from runtime environment. */ location?: string; /** * The API Key. This is required for Gemini API users. */ apiKey?: string; /** * Optional. Set to true if you intend to call Vertex AI endpoints. * If unset, default SDK behavior is to call Gemini API. */ vertexai?: boolean; /** * Optional. The API version for the endpoint. * If unset, SDK will choose a default api version. */ apiVersion?: string; /** * Optional. A set of customizable configuration for HTTP requests. */ httpOptions?: types.HttpOptions; /** * Optional. An extra string to append at the end of the User-Agent header. * * This can be used to e.g specify the runtime and its version. */ userAgentExtra?: string; } /** Raised when an Interactions API network or transport connection fails. */ declare class APIConnectionError extends APIError { constructor({ message, cause, }: { message?: string | undefined; cause?: Error | unknown | undefined; }); } /** General errors raised by the GenAI Interactions API. */ declare class APIError extends GeminiNextGenAPIClientError { /** HTTP status for the response that caused the error */ readonly status: TStatus; /** HTTP headers for the response that caused the error */ readonly headers: THeaders; /** JSON body of the response that caused the error */ readonly error: TError; /** HTTP status code */ readonly statusCode: TStatus; /** HTTP body */ readonly body: string; /** HTTP content type */ readonly contentType: string; /** Raw response */ readonly rawResponse: Response | undefined; cause: unknown; constructor(status: TStatus, error: TError, message: string | undefined, headers: THeaders); private static makeMessage; static generate(status: number | undefined, errorResponse: object | undefined, message: string | undefined, headers: Headers | undefined): APIError; } /** * API errors raised by the GenAI API. */ export declare class ApiError extends Error { /** HTTP status code */ status: number; constructor(options: ApiErrorInfo); } /** * @license * Copyright 2025 Google LLC * SPDX-License-Identifier: Apache-2.0 */ /** * Details for errors from calling the API. */ export declare interface ApiErrorInfo { /** The error message. */ message: string; /** The HTTP status code. */ status: number; } /** Config for authentication with API key. This data type is not supported in Gemini API. */ export declare interface ApiKeyConfig { /** Optional. The name of the SecretManager secret version resource storing the API key. Format: `projects/{project}/secrets/{secrete}/versions/{version}` - If both `api_key_secret` and `api_key_string` are specified, this field takes precedence over `api_key_string`. - If specified, the `secretmanager.versions.access` permission should be granted to Vertex AI Extension Service Agent (https://cloud.google.com/vertex-ai/docs/general/access-control#service-agents) on the specified resource. */ apiKeySecret?: string; /** Optional. The API key to be used in the request directly. */ apiKeyString?: string; /** Optional. The location of the API key. */ httpElementLocation?: HttpElementLocation; /** Optional. The parameter name of the API key. E.g. If the API request is "https://example.com/act?api_key=", "api_key" would be the parameter name. */ name?: string; } declare class APIPromise implements Promise { readonly _promise: Promise<[T, APICall]>; _unwrapped: Promise | null; _callSource: Promise | null; readonly [Symbol.toStringTag] = "APIPromise"; constructor(p: [T, APICall] | Promise<[T, APICall]>, callSource?: Promise); _getUnwrapped(): Promise; then(onfulfilled?: ((value: T) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined): Promise; catch(onrejected?: ((reason: any) => TResult | PromiseLike) | null | undefined): Promise; finally(onfinally?: (() => void) | null | undefined): Promise; $inspect(): Promise<[T, APICall]>; asResponse(): Promise; withResponse(): Promise<{ data: T; response: Response; }>; _thenUnwrap(transform: (value: T) => U): APIPromise; } /** The API spec that the external API implements. This enum is not supported in Gemini API. */ export declare enum ApiSpec { /** * Unspecified API spec. This value should not be used. */ API_SPEC_UNSPECIFIED = "API_SPEC_UNSPECIFIED", /** * Simple search API spec. */ SIMPLE_SEARCH = "SIMPLE_SEARCH", /** * Elastic search API spec. */ ELASTIC_SEARCH = "ELASTIC_SEARCH" } /** * Raised when a live interaction WebRTC connection or channel fails. * * @experimental */ export declare class APIWebRTCError extends APIConnectionError { /** Data-channel or peer-connection close code, when applicable. */ readonly closeCode?: number | undefined; /** HTTP status code when `:webrtc` SDP signaling failed. */ readonly httpStatus?: number | undefined; /** Sanitized upstream server error code, when reported. */ readonly serverCode?: string | undefined; constructor(options?: { message?: string | undefined; closeCode?: number | undefined; httpStatus?: number | undefined; serverCode?: string | undefined; }); } /** * Raised when a live interaction WebSocket connection or frame fails. * * @experimental */ export declare class APIWebSocketError extends APIConnectionError { /** WebSocket close code, when the connection closed with a frame or abnormal closure. */ readonly closeCode?: number | undefined; /** HTTP status code when the WebSocket upgrade handshake was rejected. */ readonly httpStatus?: number | undefined; /** Sanitized upstream server error code, when reported. */ readonly serverCode?: string | undefined; constructor(options?: { message?: string | undefined; closeCode?: number | undefined; httpStatus?: number | undefined; serverCode?: string | undefined; }); } declare type Arguments$ = CodeExecutionCallArguments; declare type Arguments$2 = GoogleMapsCallArguments; declare type Arguments$3 = GoogleSearchCallArguments; declare type Arguments$4 = RetrievalCallArguments; declare type Arguments$5 = RetrievalCallArguments; declare type Arguments$6 = URLContextCallArguments; declare type ArgumentsDelta$ = ArgumentsDelta; /** * @license * Copyright 2026 Google LLC * SPDX-License-Identifier: Apache-2.0 * * g3-prettier-ignore-file */ declare type ArgumentsDelta = { arguments?: string | undefined; type: "arguments_delta"; }; /** The aspect ratio for the image output. */ export declare enum AspectRatio { /** * Default value. This value is unused. */ ASPECT_RATIO_UNSPECIFIED = "ASPECT_RATIO_UNSPECIFIED", /** * 1:1 aspect ratio. */ ASPECT_RATIO_ONE_BY_ONE = "ASPECT_RATIO_ONE_BY_ONE", /** * 2:3 aspect ratio. */ ASPECT_RATIO_TWO_BY_THREE = "ASPECT_RATIO_TWO_BY_THREE", /** * 3:2 aspect ratio. */ ASPECT_RATIO_THREE_BY_TWO = "ASPECT_RATIO_THREE_BY_TWO", /** * 3:4 aspect ratio. */ ASPECT_RATIO_THREE_BY_FOUR = "ASPECT_RATIO_THREE_BY_FOUR", /** * 4:3 aspect ratio. */ ASPECT_RATIO_FOUR_BY_THREE = "ASPECT_RATIO_FOUR_BY_THREE", /** * 4:5 aspect ratio. */ ASPECT_RATIO_FOUR_BY_FIVE = "ASPECT_RATIO_FOUR_BY_FIVE", /** * 5:4 aspect ratio. */ ASPECT_RATIO_FIVE_BY_FOUR = "ASPECT_RATIO_FIVE_BY_FOUR", /** * 9:16 aspect ratio. */ ASPECT_RATIO_NINE_BY_SIXTEEN = "ASPECT_RATIO_NINE_BY_SIXTEEN", /** * 16:9 aspect ratio. */ ASPECT_RATIO_SIXTEEN_BY_NINE = "ASPECT_RATIO_SIXTEEN_BY_NINE", /** * 21:9 aspect ratio. */ ASPECT_RATIO_TWENTY_ONE_BY_NINE = "ASPECT_RATIO_TWENTY_ONE_BY_NINE", /** * 1:8 aspect ratio. */ ASPECT_RATIO_ONE_BY_EIGHT = "ASPECT_RATIO_ONE_BY_EIGHT", /** * 8:1 aspect ratio. */ ASPECT_RATIO_EIGHT_BY_ONE = "ASPECT_RATIO_EIGHT_BY_ONE", /** * 1:4 aspect ratio. */ ASPECT_RATIO_ONE_BY_FOUR = "ASPECT_RATIO_ONE_BY_FOUR", /** * 4:1 aspect ratio. */ ASPECT_RATIO_FOUR_BY_ONE = "ASPECT_RATIO_FOUR_BY_ONE" } declare type Audio$ = AudioDelta; /** Representation of an audio chunk. */ export declare interface AudioChunk { /** Raw bytes of audio data. * @remarks Encoded as base64 string. */ data?: string; /** MIME type of the audio chunk. */ mimeType?: string; /** Prompts and config used for generating this audio chunk. */ sourceMetadata?: LiveMusicSourceMetadata; } declare type AudioContent$ = AudioContent; /** * An audio content block. */ declare type AudioContent = { /** * The number of audio channels. */ channels?: number | undefined; /** * The audio content. */ data?: string | undefined; /** * The mime type of the audio. */ mime_type?: AudioContentMimeType | undefined; /** * How the model processes this audio for understanding. */ processing?: AudioMediaProcessing | AudioProcessingEnum | undefined; /** * The sample rate of the audio. */ sample_rate?: number | undefined; type: "audio"; /** * The URI of the audio. */ uri?: string | undefined; }; /** * The mime type of the audio. */ declare type AudioContentMimeType = "audio/wav" | "audio/mp3" | "audio/aiff" | "audio/aac" | "audio/ogg" | "audio/flac" | "audio/mpeg" | "audio/m4a" | "audio/l16" | "audio/opus" | "audio/alaw" | "audio/mulaw" | "audio/webm" | (string & {}); declare type AudioData$ = AudioData_2; /** * @license * Copyright 2026 Google LLC * SPDX-License-Identifier: Apache-2.0 * * g3-prettier-ignore-file */ /** * Audio payload used for voice creation. */ declare type AudioData_2 = { /** * Required. The raw audio bytes. */ data: string; /** * Required. The IANA MIME type of the audio data (for example, `audio/wav` or * * @remarks * `audio/mpeg`). */ mime_type: string; }; declare type AudioDelta = { /** * The number of audio channels. */ channels?: number | undefined; data?: string | undefined; mime_type?: AudioDeltaMimeType | undefined; /** * Deprecated. Use sample_rate instead. The value is ignored. * * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. */ rate?: number | undefined; /** * The sample rate of the audio. */ sample_rate?: number | undefined; type: "audio"; uri?: string | undefined; }; /** * @license * Copyright 2026 Google LLC * SPDX-License-Identifier: Apache-2.0 * * g3-prettier-ignore-file */ declare type AudioDeltaMimeType = "audio/wav" | "audio/mp3" | "audio/aiff" | "audio/aac" | "audio/ogg" | "audio/flac" | "audio/mpeg" | "audio/m4a" | "audio/l16" | "audio/opus" | "audio/alaw" | "audio/mulaw" | "audio/webm" | (string & {}); declare type AudioMediaProcessing = AudioStaticMediaProcessing; /** Metadata describes the input audio content. Set this in `Part.audio_metadata` or `FunctionResponsePart.audio_metadata` when `inline_data` or `file_data` contains audio to configure static audio preprocessing. */ export declare interface AudioMetadata { /** Optional. The start offset of the audio, relative to the start of the audio stream. */ startOffset?: string; /** Optional. The end offset of the audio, relative to the start of the audio stream. */ endOffset?: string; } /** * How the model processes this audio for understanding. */ declare type AudioProcessing = AudioMediaProcessing | AudioProcessingEnum; declare type AudioProcessingEnum = "static" | (string & {}); declare type AudioResponseFormat$ = AudioResponseFormat_2; /** Configuration for audio-specific output formatting. */ export declare class AudioResponseFormat { /** Optional. Bit rate in bits per second (bps). Only applicable for compressed formats (MP3, Opus). */ bitRate?: number; /** Optional. Delivery mode for the generated content. */ delivery?: Delivery; /** Optional. The MIME type of the audio output. */ mimeType?: string; /** Optional. Sample rate for the generated audio in Hertz. */ sampleRate?: number; } /** * Configuration for audio output format. */ declare type AudioResponseFormat_2 = { /** * Bit rate in bits per second (bps). Only applicable for compressed formats * * @remarks * (MP3, Opus). */ bit_rate?: number | undefined; /** * The delivery mode for the audio output. */ delivery?: AudioResponseFormatDelivery | undefined; /** * The MIME type of the audio output. */ mime_type?: AudioResponseFormatMimeType | undefined; /** * Sample rate in Hz. */ sample_rate?: number | undefined; type: "audio"; }; /** * @license * Copyright 2026 Google LLC * SPDX-License-Identifier: Apache-2.0 * * g3-prettier-ignore-file */ /** * The delivery mode for the audio output. */ declare type AudioResponseFormatDelivery = "inline" | "uri" | (string & {}); /** * The MIME type of the audio output. */ declare type AudioResponseFormatMimeType = "audio/mp3" | "audio/ogg_opus" | "audio/l16" | "audio/wav" | "audio/alaw" | "audio/mulaw" | (string & {}); declare type AudioStaticMediaProcessing$ = AudioStaticMediaProcessing; /** * @license * Copyright 2026 Google LLC * SPDX-License-Identifier: Apache-2.0 * * g3-prettier-ignore-file */ declare type AudioStaticMediaProcessing = { /** * Optional. Segment end time, relative to the start of the audio stream. Specified * * @remarks * as a decimal number of seconds followed by an 's' suffix, e.g., "30s". * Must be positive and greater than `start_offset` if `start_offset` is * set. */ end_offset?: string | undefined; /** * Optional. Segment start time, relative to the start of the audio stream. Specified * * @remarks * as a decimal number of seconds followed by an 's' suffix, e.g., "10.5s". * Must be non-negative. */ start_offset?: string | undefined; type: "static"; }; /** The audio transcription configuration in Setup. */ export declare interface AudioTranscriptionConfig { /** Optional. BCP-47 language codes providing hints about the languages present in the audio. If omitted or empty, defaults to automatic language detection. */ languageCodes?: string[]; /** Deprecated: Auto-detection is now the default when language_codes is omitted. This field will be removed in a future version. */ languageAuto?: LanguageAuto; /** Deprecated: Use top-level language_codes instead. This field will be removed in a future version. */ languageHints?: LanguageHints; /** A list of custom vocabulary phrases, which biases the ASR model to improve recognition of these specific terms. */ customVocabulary?: string[]; /** Deprecated. A list of phrases used for speech adaptation, which biases the ASR model to improve recognition of these specific terms. */ adaptationPhrases?: string[]; /** Configures word-level timestamp generation. */ wordTimestamp?: boolean; /** Configures speaker diarization. */ diarization?: boolean; /** Optional. Configures transcription mode. Supported values: `VERBATIM`, `SMART`. If unspecified, defaults to `VERBATIM` transcription. In `SMART` mode, the model performs disfluency removal (eliminating filler words, repetitions, and false starts), light grammatical cleanup, automatic formatting (paragraphs, bullet points, numbered lists), and minor user edits (inline self-corrections). Timestamps and diarization are incompatible with mode `SMART`. */ mode?: AudioTranscriptionConfigMode; /** Optional. The source text to be edited or rewritten via voice instructions. When provided in `SMART` mode, the model evaluates the audio input against this text and emits the complete replacement text in the candidate response rather than appending to it. */ sourceText?: string; } /** Transcription mode. */ export declare enum AudioTranscriptionConfigMode { /** * Unspecified transcription mode. */ MODE_UNSPECIFIED = "MODE_UNSPECIFIED", /** * Verbatim transcription mode. */ VERBATIM = "VERBATIM", /** * Smart transcription mode. */ SMART = "SMART" } /** * @license * Copyright 2025 Google LLC * SPDX-License-Identifier: Apache-2.0 */ /** * The Auth interface is used to authenticate with the API service. */ declare interface Auth { /** * Sets the headers needed to authenticate with the API service. * * @param headers - The Headers object that will be updated with the authentication headers. * @param url - The URL of the request. */ addAuthHeaders(headers: Headers, url?: string): Promise; } /** The authentication config to access the API. */ export declare interface AuthConfig { /** The authentication config to access the API. Only API key is supported. This field is not supported in Gemini API. */ apiKey?: string; /** Config for API key auth. */ apiKeyConfig?: ApiKeyConfig; /** Type of auth scheme. */ authType?: AuthType; /** Config for Google Service Account auth. */ googleServiceAccountConfig?: AuthConfigGoogleServiceAccountConfig; /** Config for HTTP Basic auth. */ httpBasicAuthConfig?: AuthConfigHttpBasicAuthConfig; /** Config for user oauth. */ oauthConfig?: AuthConfigOauthConfig; /** Config for user OIDC auth. */ oidcConfig?: AuthConfigOidcConfig; } /** Config for Google Service Account Authentication. This data type is not supported in Gemini API. */ export declare interface AuthConfigGoogleServiceAccountConfig { /** Optional. The service account that the extension execution service runs as. - If the service account is specified, the `iam.serviceAccounts.getAccessToken` permission should be granted to Vertex AI Extension Service Agent (https://cloud.google.com/vertex-ai/docs/general/access-control#service-agents) on the specified service account. - If not specified, the Vertex AI Extension Service Agent will be used to execute the Extension. */ serviceAccount?: string; } /** Config for HTTP Basic Authentication. This data type is not supported in Gemini API. */ export declare interface AuthConfigHttpBasicAuthConfig { /** Required. The name of the SecretManager secret version resource storing the base64 encoded credentials. Format: `projects/{project}/secrets/{secrete}/versions/{version}` - If specified, the `secretmanager.versions.access` permission should be granted to Vertex AI Extension Service Agent (https://cloud.google.com/vertex-ai/docs/general/access-control#service-agents) on the specified resource. */ credentialSecret?: string; } /** Config for user oauth. This data type is not supported in Gemini API. */ export declare interface AuthConfigOauthConfig { /** Access token for extension endpoint. Only used to propagate token from [[ExecuteExtensionRequest.runtime_auth_config]] at request time. */ accessToken?: string; /** The service account used to generate access tokens for executing the Extension. - If the service account is specified, the `iam.serviceAccounts.getAccessToken` permission should be granted to Vertex AI Extension Service Agent (https://cloud.google.com/vertex-ai/docs/general/access-control#service-agents) on the provided service account. */ serviceAccount?: string; } /** Config for user OIDC auth. This data type is not supported in Gemini API. */ export declare interface AuthConfigOidcConfig { /** OpenID Connect formatted ID token for extension endpoint. Only used to propagate token from [[ExecuteExtensionRequest.runtime_auth_config]] at request time. */ idToken?: string; /** The service account used to generate an OpenID Connect (OIDC)-compatible JWT token signed by the Google OIDC Provider (accounts.google.com) for extension endpoint (https://cloud.google.com/iam/docs/create-short-lived-credentials-direct#sa-credentials-oidc). - The audience for the token will be set to the URL in the server url defined in the OpenApi spec. - If the service account is provided, the service account should grant `iam.serviceAccounts.getOpenIdToken` permission to Vertex AI Extension Service Agent (https://cloud.google.com/vertex-ai/docs/general/access-control#service-agents). */ serviceAccount?: string; } /** Config for auth_tokens.create parameters. */ export declare interface AuthToken { /** The name of the auth token. */ name?: string; /** Optional. Input only. Immutable. An optional time after which, when using the resulting token, messages in BidiGenerateContent sessions will be rejected. (Gemini may preemptively close the session after this time.) If not set then this defaults to 30 minutes in the future. If set, this value must be less than 20 hours in the future. */ expireTime?: string; /** Optional. Input only. Immutable. The time after which new Live API sessions using the token resulting from this request will be rejected. If not set this defaults to 60 seconds in the future. If set, this value must be less than 20 hours in the future. */ newSessionExpireTime?: string; /** Optional. Input only. Immutable. The number of times the token can be used. If this value is zero then no limit is applied. Resuming a Live API session does not count as a use. If unspecified, the default is 1. */ uses?: number; } declare class AuthTokens extends ClientSDK { /** * Creates a short-lived auth token for client-side authentication (HTTP). */ create(interaction_id: string, params: CreateInteractionAuthTokenParams, options?: RequestOptions): APIPromise; /** * Deletes (revokes) an interaction auth token (HTTP). */ delete(interaction_id: string, auth_token: string, params?: DeleteInteractionAuthTokenParams, options?: Omit): APIPromise; } /** Type of auth scheme. This enum is not supported in Gemini API. */ export declare enum AuthType { AUTH_TYPE_UNSPECIFIED = "AUTH_TYPE_UNSPECIFIED", /** * No Auth. */ NO_AUTH = "NO_AUTH", /** * API Key Auth. */ API_KEY_AUTH = "API_KEY_AUTH", /** * HTTP Basic Auth. */ HTTP_BASIC_AUTH = "HTTP_BASIC_AUTH", /** * Google Service Account Auth. */ GOOGLE_SERVICE_ACCOUNT_AUTH = "GOOGLE_SERVICE_ACCOUNT_AUTH", /** * OAuth auth. */ OAUTH = "OAUTH", /** * OpenID Connect (OIDC) Auth. */ OIDC_AUTH = "OIDC_AUTH" } /** Configures automatic detection of activity. */ export declare interface AutomaticActivityDetection { /** If enabled, detected voice and text input count as activity. If disabled, the client must send activity signals. */ disabled?: boolean; /** Determines how likely speech is to be detected. */ startOfSpeechSensitivity?: StartSensitivity; /** Determines how likely detected speech is ended. */ endOfSpeechSensitivity?: EndSensitivity; /** The required duration of detected speech before start-of-speech is committed. The lower this value the more sensitive the start-of-speech detection is and the shorter speech can be recognized. However, this also increases the probability of false positives. */ prefixPaddingMs?: number; /** The required duration of detected non-speech (e.g. silence) before end-of-speech is committed. The larger this value, the longer speech gaps can be without interrupting the user's activity but this will increase the model's latency. */ silenceDurationMs?: number; } /** * SDK-only option of `interactions.create()` controlling automatic * continuation of long decodes. */ export declare type AutomaticContinuationOption = { /** * Defaults to `true`. When `true`, the SDK automatically resumes decoding * across multiple continuation hops whenever a response or stream stops at * the per-request decode token limit (`status: 'requires_continuation'` * with a `continuation_token`) until the interaction completes, reaches * `incomplete` (e.g. `max_output_tokens`), requires action, or fails. Pass * `automatic_continuation: false` to disable: the single server response is * then returned untouched (so callers can drive continuation themselves), * with a one-time console warning when it stops at `requires_continuation`. * * - For `stream: true`, the events of all continuation hops are yielded * verbatim and in order on the returned `Stream`, including each hop's * `interaction.created` and intermediate `interaction.completed` (with * `status: 'requires_continuation'`); check `status` on * `interaction.completed` events rather than treating the first one as the * end of the output. A hop that drops before any output was yielded since * its latest checkpoint is resumed from that checkpoint (up to 3 * consecutive reconnects without progress). * - For unary calls, each continuation hop is a separate interaction on the * server that only contains that hop's output. The SDK merges the hops * into one `Interaction`: `steps` are concatenated in hop order, `usage` * token counts are summed across hops (with `usage.initial_input_tokens` * set to the first hop's input tokens), and all other fields (`id`, * `status`, ...) come from the final hop; the final hop's `id` can be * passed as `previous_interaction_id` to continue the conversation. * `continuation_ids` lists the ids of every hop in order (the last one is * `id`); note that `interactions.get(id)` and `interactions.delete(id)` * act on the final hop only. `previous_interaction_id`, `created` and * `input` come from the first hop. * - With `store` enabled (the default), each continuation hop sends the hop * that issued the `continuation_token` as `previous_interaction_id` and * omits `input` (the server already has it). With `store: false`, the * original `input` is resent with the token. * - Client-side continuation is skipped for `background: true` and agent * interactions (`agent` / `agent_config`), whose loops are managed by the * server. `background: true` with an explicit * `automatic_continuation: false` is rejected. * - Timeouts: a numeric per-request `timeout_ms` (or `timeout`) in the * request options is a wall-clock budget for the whole `create()` call. * Each hop is sent with the time left, and once it runs out the call stops * with a `ContinuationInterruptedError` (see below) so the work so far can * be resumed. The client-level `httpOptions.timeout` and the retry options * apply to each hop separately: transient errors on a continuation hop * retry that hop using the latest `continuation_token` without restarting * from the initial request. * - Billing note: with `background: false`, each continuation hop * re-prefills the conversation and generated prefix, so input tokens are * billed on every hop (and summed in `usage.total_input_tokens`). If an * unrecoverable error occurs after one or more hops have completed, those * completed hops are still billed. For server-managed continuation without * client-side hop loops, use `background: true` (with `store: true`). * - Errors: a failure on the first request is thrown as usual. A failure * after progress (a later hop, or a stream after a resumable checkpoint) * is thrown as `ContinuationInterruptedError` (with the failure as * `cause`) carrying `continuationToken`, `interactionId` and * `continuationIds`, plus `partialInteraction` (the completed hops merged, * for unary calls), so the output already produced is not lost and the * call can be resumed manually. Running out of the per-request timeout * after progress is reported the same way. */ automatic_continuation?: boolean | undefined; }; /** The configuration for automatic function calling. */ export declare interface AutomaticFunctionCallingConfig { /** Whether to disable automatic function calling. If not set or set to False, will enable automatic function calling. If set to True, will disable automatic function calling. */ disable?: boolean; /** If automatic function calling is enabled, maximum number of remote calls for automatic function calling. This number should be a positive integer. If not set, SDK will set maximum number of remote calls to 10. */ maximumRemoteCalls?: number; /** If automatic function calling is enabled, whether to ignore call history to the response. If not set, SDK will set ignore_call_history to false, and will append the call history to GenerateContentResponse.automatic_function_calling_history. */ ignoreCallHistory?: boolean; } /** Autorater config used for evaluation. */ export declare interface AutoraterConfig { /** Number of samples for each instance in the dataset. If not specified, the default is 4. Minimum value is 1, maximum value is 32. */ samplingCount?: number; /** Optional. Default is true. Whether to flip the candidate and baseline responses. This is only applicable to the pairwise metric. If enabled, also provide PairwiseMetricSpec.candidate_response_field_name and PairwiseMetricSpec.baseline_response_field_name. When rendering PairwiseMetricSpec.metric_prompt_template, the candidate and baseline fields will be flipped for half of the samples to reduce bias. */ flipEnabled?: boolean; /** The fully qualified name of the publisher model or tuned autorater endpoint to use. Publisher model format: `projects/{project}/locations/{location}/publishers/{publisher}/models/{model}` Tuned model endpoint format: `projects/{project}/locations/{location}/endpoints/{endpoint}` */ autoraterModel?: string; /** Configuration options for model generation and outputs. */ generationConfig?: GenerationConfig; } /** Configures the avatar to be used in the session. */ export declare interface AvatarConfig { /** Pre-built avatar id. */ avatarName?: string; /** Customized avatar appearance with a reference image. */ customizedAvatar?: CustomizedAvatar; /** The bitrate of compressed audio. */ audioBitrateBps?: number; /** The bitrate of compressed video output. */ videoBitrateBps?: number; } declare type Awaitable = T | Promise; declare type Awaitable_2 = T | Promise; /** * @license * Copyright 2026 Google LLC * SPDX-License-Identifier: Apache-2.0 * * g3-prettier-ignore-file */ export declare type BackoffStrategy = { initialInterval: number; maxInterval: number; exponent: number; maxElapsedTime: number; }; declare type BaseEnvironment$ = BaseEnvironment; /** * The environment configuration for the agent. */ declare type BaseEnvironment = interactions.Environment | string; /** * @license * Copyright 2025 Google LLC * SPDX-License-Identifier: Apache-2.0 */ declare class BaseModule { } /** * Parameters for setting the base URLs for the Gemini API and Vertex AI API. */ export declare interface BaseUrlParameters { geminiUrl?: string; vertexUrl?: string; } export declare class Batches extends BaseModule { private readonly apiClient; constructor(apiClient: ApiClient); /** * Lists batch jobs. * * @param params - The parameters for the list request. * @return - A pager of batch jobs. * * @example * ```ts * const batchJobs = await ai.batches.list({config: {'pageSize': 2}}); * for await (const batchJob of batchJobs) { * console.log(batchJob); * } * ``` */ list: (params?: types.ListBatchJobsParameters) => Promise>; /** * Create batch job. * * @param params - The parameters for create batch job request. * @return The created batch job. * * @example * ```ts * const response = await ai.batches.create({ * model: 'gemini-3.8-flash', * src: {gcsUri: 'gs://bucket/path/to/file.jsonl', format: 'jsonl'}, * config: { * dest: {gcsUri: 'gs://bucket/path/output/directory', format: 'jsonl'}, * } * }); * console.log(response); * ``` */ create: (params: types.CreateBatchJobParameters) => Promise; /** * **Experimental** Creates an embedding batch job. * * @param params - The parameters for create embedding batch job request. * @return The created batch job. * * @example * ```ts * const response = await ai.batches.createEmbeddings({ * model: 'text-embedding-004', * src: {fileName: 'files/my_embedding_input'}, * }); * console.log(response); * ``` */ createEmbeddings: (params: types.CreateEmbeddingsBatchJobParameters) => Promise; private createInlinedGenerateContentRequest; private getGcsUri; private getBigqueryUri; private formatDestination; /** * Internal method to create batch job. * * @param params - The parameters for create batch job request. * @return The created batch job. * */ private createInternal; /** * Internal method to create batch job. * * @param params - The parameters for create batch job request. * @return The created batch job. * */ private createEmbeddingsInternal; /** * Gets batch job configurations. * * @param params - The parameters for the get request. * @return The batch job. * * @example * ```ts * await ai.batches.get({name: '...'}); // The server-generated resource name. * ``` */ get(params: types.GetBatchJobParameters): Promise; /** * Cancels a batch job. * * @param params - The parameters for the cancel request. * @return The empty response returned by the API. * * @example * ```ts * await ai.batches.cancel({name: '...'}); // The server-generated resource name. * ``` */ cancel(params: types.CancelBatchJobParameters): Promise; private listInternal; /** * Deletes a batch job. * * @param params - The parameters for the delete request. * @return The empty response returned by the API. * * @example * ```ts * await ai.batches.delete({name: '...'}); // The server-generated resource name. * ``` */ delete(params: types.DeleteBatchJobParameters): Promise; } /** Config for batches.create return value. */ export declare interface BatchJob { /** The resource name of the BatchJob. Output only.". */ name?: string; /** The display name of the BatchJob. */ displayName?: string; /** The state of the BatchJob. */ state?: JobState; /** Output only. Only populated when the job's state is JOB_STATE_FAILED or JOB_STATE_CANCELLED. */ error?: JobError; /** The time when the BatchJob was created. */ createTime?: string; /** Output only. Time when the Job for the first time entered the `JOB_STATE_RUNNING` state. */ startTime?: string; /** The time when the BatchJob was completed. This field is for Gemini platform only. */ endTime?: string; /** The time when the BatchJob was last updated. */ updateTime?: string; /** The name of the model that produces the predictions via the BatchJob. */ model?: string; /** Configuration for the input data. This field is for Gemini platform only. */ src?: BatchJobSource; /** Configuration for the output data. */ dest?: BatchJobDestination; /** Information further describing the output of this job. Output only. */ outputInfo?: BatchJobOutputInfo; /** Statistics on completed and failed prediction instances. This field is for Gemini platform only. */ completionStats?: CompletionStats; } /** Config for `dest` parameter. */ export declare interface BatchJobDestination { /** Storage format of the output files. Must be one of: 'jsonl', 'bigquery', 'vertex-dataset'. */ format?: string; /** The Google Cloud Storage URI to the output file. */ gcsUri?: string; /** The BigQuery URI to the output table. */ bigqueryUri?: string; /** This field is experimental and may change in future versions. The Vertex AI dataset destination. */ vertexDataset?: VertexMultimodalDatasetDestination; /** The Gemini Developer API's file resource name of the output data (e.g. "files/12345"). The file will be a JSONL file with a single response per line. The responses will be GenerateContentResponse messages formatted as JSON. The responses will be written in the same order as the input requests. */ fileName?: string; /** The responses to the requests in the batch. Returned when the batch was built using inlined requests. The responses will be in the same order as the input requests. */ inlinedResponses?: InlinedResponse[]; /** The responses to the requests in the batch. Returned when the batch was built using inlined requests. The responses will be in the same order as the input requests. */ inlinedEmbedContentResponses?: InlinedEmbedContentResponse[]; } export declare type BatchJobDestinationUnion = BatchJobDestination | string; /** Represents the `output_info` field in batch jobs. */ export declare interface BatchJobOutputInfo { /** The full path of the Cloud Storage directory created, into which the prediction output is written. */ gcsOutputDirectory?: string; /** The name of the BigQuery table created, in `predictions_TIMESTAMP` format, into which the prediction output is written. */ bigqueryOutputTable?: string; /** This field is experimental and may change in future versions. The Vertex AI dataset name containing the output data. */ vertexMultimodalDatasetName?: string; } /** Config for `src` parameter. */ export declare interface BatchJobSource { /** Storage format of the input files. Must be one of: 'jsonl', 'bigquery', 'vertex-dataset'. */ format?: string; /** The Google Cloud Storage URIs to input files. */ gcsUri?: string[]; /** The BigQuery URI to input table. */ bigqueryUri?: string; /** This field is experimental and may change in future versions. The Vertex AI dataset resource name to use as input. Must be of type multimodal. */ vertexDatasetName?: string; /** The Gemini Developer API's file resource name of the input data (e.g. "files/12345"). */ fileName?: string; /** The Gemini Developer API's inlined input data to run batch job. */ inlinedRequests?: InlinedRequest[]; } export declare type BatchJobSourceUnion = BatchJobSource | InlinedRequest[] | string; declare type BeforeCreateRequestContext = HookContext & {}; declare interface BeforeCreateRequestHook { /** * A hook that is called before the SDK creates a `Request` object. The hook * can modify how a request is constructed since certain modifications, like * changing the request URL, cannot be done on a request object directly. */ beforeCreateRequest: (hookCtx: BeforeCreateRequestContext, input: RequestInput) => RequestInput; } declare type BeforeRequestContext = HookContext & {}; declare type BeforeRequestHook = (req: Request) => Awaitable; declare interface BeforeRequestHook_2 { /** * A hook that is called before the SDK sends a request. The hook can * introduce instrumentation code such as logging, tracing and metrics or * replace the request before it is sent or throw an error to stop the * request from being sent. */ beforeRequest: (hookCtx: BeforeRequestContext, request: Request) => Awaitable_2; } /** Specifies the function Behavior. If not specified, the system keeps the current function call behavior. This field is currently only supported by the BidiGenerateContent method. */ export declare enum Behavior { /** * This value is unspecified. */ UNSPECIFIED = "UNSPECIFIED", /** * If set, the system will wait to receive the function response before continuing the conversation. */ BLOCKING = "BLOCKING", /** * If set, the system will not wait to receive the function response. Instead, it will attempt to handle function responses as they become available while maintaining the conversation between the user and the model. */ NON_BLOCKING = "NON_BLOCKING" } /** The BigQuery location for the input content. This data type is not supported in Gemini API. */ export declare interface BigQuerySource { /** Required. BigQuery URI to a table, up to 2000 characters long. Accepted forms: * BigQuery path. For example: `bq://projectId.bqDatasetId.bqTableId`. */ inputUri?: string; } /** Bleu metric value for an instance. This data type is not supported in Gemini API. */ export declare interface BleuMetricValue { /** Output only. Bleu score. */ score?: number; } /** A content blob. A Blob contains data of a specific media type. It is used to represent images, audio, and video. */ declare interface Blob_2 { /** Required. The raw bytes of the data. * @remarks Encoded as base64 string. */ data?: string; /** Optional. The display name of the blob. Used to provide a label or filename to distinguish blobs. This field is only returned in `PromptMessage` for prompt management. It is used in the Gemini calls only when server-side tools (`code_execution`, `google_search`, and `url_context`) are enabled. */ displayName?: string; /** Required. The IANA standard MIME type of the source data. */ mimeType?: string; } export { Blob_2 as Blob } export declare type BlobImageUnion = Blob_2; /** Output only. The reason why the prompt was blocked. */ export declare enum BlockedReason { /** * The blocked reason is unspecified. */ BLOCKED_REASON_UNSPECIFIED = "BLOCKED_REASON_UNSPECIFIED", /** * The prompt was blocked for safety reasons. */ SAFETY = "SAFETY", /** * The prompt was blocked for other reasons. For example, it may be due to the prompt's language, or because it contains other harmful content. */ OTHER = "OTHER", /** * The prompt was blocked because it contains a term from the terminology blocklist. */ BLOCKLIST = "BLOCKLIST", /** * The prompt was blocked because it contains prohibited content. */ PROHIBITED_CONTENT = "PROHIBITED_CONTENT", /** * The prompt was blocked because it contains content that is unsafe for image generation. */ IMAGE_SAFETY = "IMAGE_SAFETY", /** * The prompt was blocked by Model Armor. This enum value is not supported in Gemini API. */ MODEL_ARMOR = "MODEL_ARMOR", /** * The prompt was blocked as a jailbreak attempt. This enum value is not supported in Gemini API. */ JAILBREAK = "JAILBREAK" } /** * @license * Copyright 2026 Google LLC * SPDX-License-Identifier: Apache-2.0 * * g3-prettier-ignore-file */ /** * Optional. If set, the input was blocked and no answers are returned. */ declare type BlockReason = "safety" | "other" | "blocklist" | "prohibited_content" | "image_safety" | (string & {}); /** A resource used in LLM queries for users to explicitly specify what to cache. */ export declare interface CachedContent { /** The server-generated resource name of the cached content. */ name?: string; /** The user-generated meaningful display name of the cached content. */ displayName?: string; /** The name of the publisher model to use for cached content. */ model?: string; /** Creation time of the cache entry. */ createTime?: string; /** When the cache entry was last updated in UTC time. */ updateTime?: string; /** Expiration time of the cached content. */ expireTime?: string; /** Metadata on the usage of the cached content. */ usageMetadata?: CachedContentUsageMetadata; } /** Metadata on the usage of the cached content. */ export declare interface CachedContentUsageMetadata { /** Duration of audio in seconds. This field is not supported in Gemini API. */ audioDurationSeconds?: number; /** Number of images. This field is not supported in Gemini API. */ imageCount?: number; /** Number of text characters. This field is not supported in Gemini API. */ textCount?: number; /** Total number of tokens that the cached content consumes. */ totalTokenCount?: number; /** Duration of video in seconds. This field is not supported in Gemini API. */ videoDurationSeconds?: number; } declare type CachedTokensByModality$ = ModalityTokens; export declare class Caches extends BaseModule { private readonly apiClient; constructor(apiClient: ApiClient); /** * Lists cached contents. * * @param params - The parameters for the list request. * @return - A pager of cached contents. * * @example * ```ts * const cachedContents = await ai.caches.list({config: {'pageSize': 2}}); * for await (const cachedContent of cachedContents) { * console.log(cachedContent); * } * ``` */ list: (params?: types.ListCachedContentsParameters) => Promise>; /** * Creates a cached contents resource. * * @remarks * Context caching is only supported for specific models. See [Gemini * Developer API reference](https://aistudio.google.com/docs/caching) * and [Gemini platform reference](https://cloud.google.com/vertex-ai/generative-ai/docs/context-cache/context-cache-overview#supported_models) * for more information. * * @param params - The parameters for the create request. * @return The created cached content. * * @example * ```ts * const contents = ...; // Initialize the content to cache. * const response = await ai.caches.create({ * model: 'gemini-3.8-flash', * config: { * 'contents': contents, * 'displayName': 'test cache', * 'systemInstruction': 'What is the sum of the two pdfs?', * 'ttl': '86400s', * } * }); * ``` */ create(params: types.CreateCachedContentParameters): Promise; /** * Gets cached content configurations. * * @param params - The parameters for the get request. * @return The cached content. * * @example * ```ts * await ai.caches.get({name: '...'}); // The server-generated resource name. * ``` */ get(params: types.GetCachedContentParameters): Promise; /** * Deletes cached content. * * @param params - The parameters for the delete request. * @return The empty response returned by the API. * * @example * ```ts * await ai.caches.delete({name: '...'}); // The server-generated resource name. * ``` */ delete(params: types.DeleteCachedContentParameters): Promise; /** * Updates cached content configurations. * * @param params - The parameters for the update request. * @return The updated cached content. * * @example * ```ts * const response = await ai.caches.update({ * name: '...', // The server-generated resource name. * config: {'ttl': '7600s'} * }); * ``` */ update(params: types.UpdateCachedContentParameters): Promise; private listInternal; } /** * CallableTool is an invokable tool that can be executed with external * application (e.g., via Model Context Protocol) or local functions with * function calling. */ export declare interface CallableTool { /** * Returns tool that can be called by Gemini. */ tool(): Promise; /** * Executes the callable tool with the given function call arguments and * returns the response parts from the tool execution. */ callTool(functionCalls: FunctionCall[]): Promise; } /** * CallableToolConfig is the configuration for a callable tool. */ export declare interface CallableToolConfig { /** * Specifies the model's behavior after invoking this tool. */ behavior?: Behavior; /** * Timeout for remote calls in milliseconds. Note this timeout applies only to * tool remote calls, and not making HTTP requests to the API. */ timeout?: number; } /** Optional parameters. */ export declare interface CancelBatchJobConfig { /** Used to override HTTP request options. */ httpOptions?: HttpOptions; /** Abort signal which can be used to cancel the request. NOTE: AbortSignal is a client-only operation. Using it to cancel an operation will not cancel the request in the service. You will still be charged usage for any applicable operations. */ abortSignal?: AbortSignal; } /** Config for batches.cancel parameters. */ export declare interface CancelBatchJobParameters { /** A fully-qualified BatchJob resource name or ID. Example: "projects/.../locations/.../batchPredictionJobs/456" or "456" when project and location are initialized in the client. */ name: string; /** Optional parameters for the request. */ config?: CancelBatchJobConfig; } /** * @license * Copyright 2026 Google LLC * SPDX-License-Identifier: Apache-2.0 * * g3-prettier-ignore-file */ declare type CancelInteractionByIdGlobals = { /** * API version for request routing. */ api_version?: string | undefined; }; declare type CancelInteractionByIdParams = Omit; declare type CancelInteractionByIdRequest = { /** * API version for request routing. */ api_version?: string | undefined; /** * Required. The name of the interaction to cancel. */ id: string; }; declare type CancelInteractionEvent$ = CancelInteractionEvent; /** * @license * Copyright 2026 Google LLC * SPDX-License-Identifier: Apache-2.0 * * g3-prettier-ignore-file */ /** * Permanently ends the interaction, aborting any work in flight. * * @remarks * Reconnecting afterwards is supported to read the final status, * but no further inputs or messages may be sent. */ declare type CancelInteractionEvent = { event_type: "interaction.cancel"; }; /** Optional parameters for tunings.cancel method. */ export declare interface CancelTuningJobConfig { /** Used to override HTTP request options. */ httpOptions?: HttpOptions; /** Abort signal which can be used to cancel the request. NOTE: AbortSignal is a client-only operation. Using it to cancel an operation will not cancel the request in the service. You will still be charged usage for any applicable operations. */ abortSignal?: AbortSignal; } /** Parameters for the cancel method. */ export declare interface CancelTuningJobParameters { /** The resource name of the tuning job. */ name: string; /** Optional parameters for the request. */ config?: CancelTuningJobConfig; } /** Empty response for tunings.cancel method. */ export declare class CancelTuningJobResponse { /** Used to retain the full HTTP response. */ sdkHttpResponse?: HttpResponse; } /** A response candidate generated from the model. */ export declare interface Candidate { /** Contains the multi-part content of the response. */ content?: Content; /** Source attribution of the generated content. */ citationMetadata?: CitationMetadata; /** Describes the reason the model stopped generating tokens. */ finishMessage?: string; /** Number of tokens for this candidate. */ tokenCount?: number; /** The reason why the model stopped generating tokens. If empty, the model has not stopped generating the tokens. */ finishReason?: FinishReason; /** Output only. Metadata returned when grounding is enabled. It contains the sources used to ground the generated content. */ groundingMetadata?: GroundingMetadata; /** Output only. The average log probability of the tokens in this candidate. This is a length-normalized score that can be used to compare the quality of candidates of different lengths. A higher average log probability suggests a more confident and coherent response. */ avgLogprobs?: number; /** Output only. The 0-based index of this candidate in the list of generated responses. This is useful for distinguishing between multiple candidates when `candidate_count` > 1. */ index?: number; /** Output only. The detailed log probability information for the tokens in this candidate. This is useful for debugging, understanding model uncertainty, and identifying potential "hallucinations". */ logprobsResult?: LogprobsResult; /** Output only. A list of ratings for the safety of a response candidate. There is at most one rating per category. */ safetyRatings?: SafetyRating[]; /** Output only. Metadata returned when the model uses the `url_context` tool to get information from a user-provided URL. */ urlContextMetadata?: UrlContextMetadata; /** Output only. An optional opaque continuation token returned when `finish_reason` is `CONTINUATION`. Clients can pass this token in a subsequent `GenerateContentRequest` to continue generation. * @remarks Encoded as base64 string. */ continuationToken?: string; } /** * Chat session that enables sending messages to the model with previous * conversation context. * * @remarks * The session maintains all the turns between user and model. */ export declare class Chat { private readonly apiClient; private readonly modelsModule; private readonly model; private readonly config; private history; private sendPromise; constructor(apiClient: ApiClient, modelsModule: Models, model: string, config?: types.GenerateContentConfig, history?: types.Content[]); /** * Sends a message to the model and returns the response. * * @remarks * This method will wait for the previous message to be processed before * sending the next message. Automatic continuation * (`config.automaticContinuation`) is enabled by default (`true`); set * `config.automaticContinuation = false` to disable it. * * @see {@link Chat#sendMessageStream} for streaming method. * @param params - parameters for sending messages within a chat session. * @returns The model's response. * * @example * ```ts * const chat = ai.chats.create({model: 'gemini-2.0-flash'}); * const response = await chat.sendMessage({ * message: 'Why is the sky blue?' * }); * console.log(response.text); * ``` */ sendMessage(params: types.SendMessageParameters): Promise; /** * Sends a message to the model and returns the response in chunks. * * @remarks * This method will wait for the previous message to be processed before * sending the next message. Automatic continuation * (`config.automaticContinuation`) is enabled by default (`true`); set * `config.automaticContinuation = false` to disable it. * * @see {@link Chat#sendMessage} for non-streaming method. * @param params - parameters for sending the message. * @return The model's response. * * @example * ```ts * const chat = ai.chats.create({model: 'gemini-2.0-flash'}); * const response = await chat.sendMessageStream({ * message: 'Why is the sky blue?' * }); * for await (const chunk of response) { * console.log(chunk.text); * } * ``` */ sendMessageStream(params: types.SendMessageParameters): Promise>; /** * Returns the chat history. * * @remarks * The history is a list of contents alternating between user and model. * * There are two types of history: * - The `curated history` contains only the valid turns between user and * model, which will be included in the subsequent requests sent to the model. * - The `comprehensive history` contains all turns, including invalid or * empty model outputs, providing a complete record of the history. * * The history is updated after receiving the response from the model, * for streaming response, it means receiving the last chunk of the response. * * The `comprehensive history` is returned by default. To get the `curated * history`, set the `curated` parameter to `true`. * * @param curated - whether to return the curated history or the comprehensive * history. * @return History contents alternating between user and model for the entire * chat session. */ getHistory(curated?: boolean): types.Content[]; private processStreamResponse; private recordHistory; } /** * A utility class to create a chat session. */ export declare class Chats { private readonly modelsModule; private readonly apiClient; constructor(modelsModule: Models, apiClient: ApiClient); /** * Creates a new chat session. * * @remarks * The config in the params will be used for all requests within the chat * session unless overridden by a per-request `config` in * @see {@link types.SendMessageParameters#config}. * Automatic continuation (`config.automaticContinuation`) is enabled by * default in chat sessions (`true`). Set `config.automaticContinuation = * false` to disable it. * * @param params - Parameters for creating a chat session. * @returns A new chat session. * * @example * ```ts * const chat = ai.chats.create({ * model: 'gemini-2.0-flash' * config: { * temperature: 0.5, * maxOutputTokens: 1024, * } * }); * ``` */ create(params: types.CreateChatParameters): Chat; } /** Describes the machine learning model version checkpoint. */ export declare interface Checkpoint { /** The ID of the checkpoint. */ checkpointId?: string; /** The epoch of the checkpoint. */ epoch?: string; /** The step of the checkpoint. */ step?: string; } declare type ChoiceAnswer$ = ChoiceAnswer; /** * @license * Copyright 2026 Google LLC * SPDX-License-Identifier: Apache-2.0 * * g3-prettier-ignore-file */ /** * Calibrated result for a `ChoiceQuestion`. */ declare type ChoiceAnswer = { /** * Required. Output only. The option ID with the highest probability. */ choice: string; /** * Required. Output only. Closed-world confidence score in `[0, 1]`, equal to the calibrated * * @remarks * probability of the winning outcome: * - `NoulAnswer`: `max(noul, 1 - noul)` * - `ChoiceAnswer`: `p_max` (the probability of `choice`) * - `ScoreAnswer`: `p_max` (the highest probability in `probabilities`). */ confidence: number; /** * Required. Output only. Closed-world normalized probability in `[0, 1]` for each option ID. */ probabilities: { [k: string]: number; }; type: "choice"; }; declare type ChoiceQuestion$ = ChoiceQuestion; /** * A single-select categorical decision question over mutually exclusive * * @remarks * options. */ declare type ChoiceQuestion = { /** * Required. Mutually exclusive options to choose from (between 2 and 255 options), * * @remarks * mapping option ID to optional description or rubric criteria. Option IDs * must be non-empty with no control characters or leading/trailing * whitespace. */ criteria: { [k: string]: string; }; /** * Required. Human-readable decision guidelines, rubrics, or criteria evaluated * * @remarks * against the shared `input`. At least one content block is required. */ instructions: DecisionInstructionContent | Array | string; type: "choice"; }; /** * Required. Human-readable decision guidelines, rubrics, or criteria evaluated * * @remarks * against the shared `input`. At least one content block is required. */ declare type ChoiceQuestionInstructions = DecisionInstructionContent | Array | string; /** Config for telling the service how to chunk the file. */ export declare interface ChunkingConfig { /** White space chunking configuration. */ whiteSpaceConfig?: WhiteSpaceConfig; } /** A citation for a piece of generatedcontent. This data type is not supported in Gemini API. */ export declare interface Citation { /** Output only. The end index of the citation in the content. */ endIndex?: number; /** Output only. The license of the source of the citation. */ license?: string; /** Output only. The publication date of the source of the citation. */ publicationDate?: GoogleTypeDate; /** Output only. The start index of the citation in the content. */ startIndex?: number; /** Output only. The title of the source of the citation. */ title?: string; /** Output only. The URI of the source of the citation. */ uri?: string; } /** Citation information when the model quotes another source. */ export declare interface CitationMetadata { /** Contains citation information when the model directly quotes, at length, from another source. Can include traditional websites and code repositories. */ citations?: Citation[]; } /** A file that can be referenced by ID from subsequent Claude model requests. The JSON representation of this message matches the Claude Files API File object field-for-field, so that code written against that API parses these responses unchanged. This data type is not supported in Gemini API. */ export declare interface ClaudeFile { /** Output only. The time at which the file was created. */ createdAt?: string; /** Output only. Whether the contents of this file can be retrieved with `DownloadFile`. False for user-uploaded files, true for tool-generated ones. */ downloadable?: boolean; /** Output only. The time at which the file expires and is deleted, set from the `expires_in_seconds` upload form field. Unset for files that do not expire, which is serialised as `null`. */ expiresAt?: string; /** Output only. The original name of the uploaded file, taken from the `Content-Disposition` header on upload. Between 1 and 255 characters. Control characters and the characters `<>:"|?*\/` are not accepted. */ filename?: string; /** Output only. The server-assigned identifier of the file, for example `file_abc123`. This is the ID to pass in subsequent model requests. */ id?: string; /** Output only. The media type of the file, taken from the `Content-Type` header of the file part on upload. */ mimeType?: string; /** Output only. The size of the file in bytes. */ sizeBytes?: number; /** Output only. The object type. Always `file`. */ type?: string; } declare type ClientEvent$ = ClientEvent; /** * Wrapper for client events to support flexible JSON payload formats. */ export declare type ClientEvent = (CancelInteractionEvent & { event_type: "interaction.cancel"; }) | (CompleteInteractionEvent & { event_type: "interaction.complete"; }) | (CreateInteractionEvent & { event_type: "interaction.create"; }) | (DisconnectEvent & { event_type: "interaction.disconnect"; }) | (InputEvent_2 & { event_type: "input"; }) | (ConnectInteractionEvent & { event_type: "interaction.connect"; }) | (UserActionInput & { event_type: "user_action"; }) | (WorldSetupEvent & { event_type: "world_setup"; }); /** * Top-level client->server wire message. Carries either a single event or a * * @remarks * batch of events. */ declare type ClientEventBatch = ClientEventList | ClientEvent; /** * Wrapper for a list of client events. */ declare type ClientEventList = { /** * The list of client events. */ events: Array; }; declare class ClientSDK { readonly _httpClient: HTTPClient; readonly _hooks: SDKHooks; readonly _logger?: Logger | undefined; readonly _baseURL: URL | null; readonly _options: SDKOptions & { hooks?: SDKHooks; }; constructor(options?: SDKOptions); _createRequest(context: HookContext, conf: RequestConfig, options?: RequestOptions): Result; _do(request: Request, options: { context: HookContext; isErrorStatusCode: (statusCode: number) => boolean; retryConfig: RetryConfig; retryCodes: string[]; }): Promise>; } declare type CodeExecution$ = CodeExecution; declare type CodeExecution$2 = CodeExecution; /** * @license * Copyright 2026 Google LLC * SPDX-License-Identifier: Apache-2.0 * * g3-prettier-ignore-file */ /** * A tool that can be used by the model to execute code. */ declare type CodeExecution = { type: "code_execution"; }; declare type CodeExecutionCall$ = CodeExecutionCallDelta; declare type CodeExecutionCallArguments$ = CodeExecutionCallArguments; /** * The arguments to pass to the code execution. */ declare type CodeExecutionCallArguments = { /** * The code to be executed. */ code?: string | undefined; /** * Programming language of the `code`. */ language?: Language_2 | undefined; }; declare type CodeExecutionCallDelta = { /** * The arguments to pass to the code execution. */ arguments: CodeExecutionCallArguments; /** * A signature hash for backend validation. */ signature?: string | undefined; type: "code_execution_call"; }; declare type CodeExecutionCallStep$ = CodeExecutionCallStep; /** * Code execution call step. */ declare type CodeExecutionCallStep = { /** * The arguments to pass to the code execution. */ arguments: CodeExecutionCallArguments; /** * Required. A unique ID for this specific tool call. */ id: string; /** * A signature hash for backend validation. */ signature?: string | undefined; type: "code_execution_call"; }; declare type CodeExecutionResult$ = CodeExecutionResultDelta; /** Result of executing the ExecutableCode. Generated only when the `CodeExecution` tool is used. */ export declare interface CodeExecutionResult { /** Required. Outcome of the code execution. */ outcome?: Outcome; /** Optional. Contains stdout when code execution is successful, stderr or other description otherwise. */ output?: string; /** Optional. The identifier of the `ExecutableCode` part this result is for. Only populated if the corresponding `ExecutableCode` has an id. */ id?: string; } /** * @license * Copyright 2026 Google LLC * SPDX-License-Identifier: Apache-2.0 * * g3-prettier-ignore-file */ declare type CodeExecutionResultDelta = { is_error?: boolean | undefined; result: string; /** * A signature hash for backend validation. */ signature?: string | undefined; type: "code_execution_result"; }; declare type CodeExecutionResultStep$ = CodeExecutionResultStep; /** * Code execution result step. */ declare type CodeExecutionResultStep = { /** * Required. ID to match the ID from the function call block. */ call_id: string; /** * Whether the code execution resulted in an error. */ is_error?: boolean | undefined; /** * The output of the code execution. */ result: Array | string; /** * A signature hash for backend validation. */ signature?: string | undefined; type: "code_execution_result"; }; /** * The output of the code execution. */ declare type CodeExecutionResultStepResult = Array | string; declare type CodeMenderAgentConfig$ = CodeMenderAgentConfig; /** * Configuration for the CodeMender agent. */ declare type CodeMenderAgentConfig = { /** * Request parameters specific to FIND sessions, used for discovering * * @remarks * vulnerabilities in a codebase. */ find_request?: FindRequest | undefined; /** * Request parameters specific to FIX sessions, used for generating and * * @remarks * validating security patches. */ fix_request?: FixRequest | undefined; /** * The name of the model to use for the CodeMender agent. One * * @remarks * CodeMender session will only use one model. */ model?: string | undefined; /** * The configuration of CodeMender sessions. */ session_config?: SessionConfig | undefined; /** * Parameter for grouping multiple interactions that belong to * * @remarks * the same CodeMender session. */ session_id?: string | undefined; type: "code-mender"; }; declare type CompleteInteractionEvent$ = CompleteInteractionEvent; /** * @license * Copyright 2026 Google LLC * SPDX-License-Identifier: Apache-2.0 * * g3-prettier-ignore-file */ /** * Client signal to end the Interaction. Acts like a half-close, the Client will * * @remarks * not send new input, but will wait for output to finish and may reconnect. */ declare type CompleteInteractionEvent = { event_type: "interaction.complete"; }; /** 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. */ export declare interface CompletionStats { /** Output only. The number of entities for which any error was encountered. */ failedCount?: string; /** Output only. In cases when enough errors are encountered a job, pipeline, or operation may be failed as a whole. Below is the number of entities for which the processing had not been finished (either in successful or failed state). Set to -1 if the number is unknown (for example, the operation failed before the total entity number could be collected). */ incompleteCount?: string; /** Output only. The number of entities that had been processed successfully. */ successfulCount?: string; /** Output only. The number of the successful forecast points that are generated by the forecasting model. This is ONLY used by the forecasting batch prediction. */ successfulForecastPointCount?: string; } /** Composite reward function configuration for reinforcement tuning. This data type is not supported in Gemini API. */ export declare interface CompositeReinforcementTuningRewardConfig { /** List of reward function configurations with weights. */ weightedRewardConfigs?: CompositeReinforcementTuningRewardConfigWeightedRewardConfig[]; } /** Reward function configuration with a weight. The weight is used to combine the reward with other rewards. This data type is not supported in Gemini API. */ export declare interface CompositeReinforcementTuningRewardConfigWeightedRewardConfig { /** Single reward configuration. */ rewardConfig?: SingleReinforcementTuningRewardConfig; /** How much this single reward contributes to the total overall reward. Total reward is a linear combination of single rewards with their corresponding weights, i.e., ``` total_reward = ( weight_a * reward_a + weight_b * reward_b + ... ) / (weight_a + weight_b + ...) ``` */ weight?: number; } declare type ComputerUse$ = ComputerUse_2; declare type ComputerUse$2 = ComputerUse_2; /** A tool that enables the model to interact directly with a computer environment. */ export declare interface ComputerUse { /** Optional. Whether to enable the prompt injection detection check on the computer use request. */ enablePromptInjectionDetection?: boolean; /** Required. The target environment where the computer use tool operates. */ environment?: Environment; /** Optional. A list of predefined functions to explicitly exclude from the model call. By default, [predefined functions](https://cloud.google.com/vertex-ai/generative-ai/docs/computer-use#supported-actions) are included. Excluding functions allows for a more restricted action space or custom definitions for predefined functions. */ excludedPredefinedFunctions?: string[]; /** Optional. A list of safety policies to disable for the computer use tool. */ disabledSafetyPolicies?: SafetyPolicy[]; } /** * A tool that can be used by the model to interact with the computer. */ declare type ComputerUse_2 = { /** * Optional. Disabled safety policies for computer use. */ disabled_safety_policies?: Array | undefined; /** * Whether enable the prompt injection detection check on computer-use * * @remarks * request. */ enable_prompt_injection_detection?: boolean | undefined; /** * The environment being operated. */ environment?: EnvironmentEnum | undefined; /** * The list of predefined functions that are excluded from the model call. */ excluded_predefined_functions?: Array | undefined; type: "computer_use"; }; /** Optional parameters for computing tokens. */ export declare interface ComputeTokensConfig { /** Used to override HTTP request options. */ httpOptions?: HttpOptions; /** Abort signal which can be used to cancel the request. NOTE: AbortSignal is a client-only operation. Using it to cancel an operation will not cancel the request in the service. You will still be charged usage for any applicable operations. */ abortSignal?: AbortSignal; } /** Parameters for computing tokens. */ export declare interface ComputeTokensParameters { /** ID of the model to use. For a list of models, see `Google models `_. */ model: string; /** Input content. */ contents: ContentListUnion; /** Optional parameters for the request. */ config?: ComputeTokensConfig; } /** Response for computing tokens. */ export declare class ComputeTokensResponse { /** Used to retain the full HTTP response. */ sdkHttpResponse?: HttpResponse; /** Lists of tokens info from the input. A ComputeTokensRequest could have multiple instances with a prompt in each instance. We also need to return lists of tokens info for the request with multiple instances. */ tokensInfo?: TokensInfo[]; } /** Local tokenizer compute tokens result. */ export declare interface ComputeTokensResult { /** Lists of tokens info from the input. */ tokensInfo?: TokensInfo[]; } declare type ConnectInteractionEvent$ = ConnectInteractionEvent; /** * @license * Copyright 2026 Google LLC * SPDX-License-Identifier: Apache-2.0 * * g3-prettier-ignore-file */ /** * Reconnects to an existing live Interaction. * * @remarks * * The client sets `next_output_seq_num` to tell the server the first output * event it still needs (i.e. resume output from here). Additionally, * `ack_output_seq_num` on the enclosing `ClientEventBatch` confirms * cumulative receipt through that seq_num. * * The server responds with `InteractionReconnectedEvent` containing * `next_input_seq_num`, telling the client where to resume sending input. * If the interaction is already complete, the server will replay events * starting from `next_output_seq_num` through completion. */ declare type ConnectInteractionEvent = { /** * When true, signals that the client intends to disconnect after sending * * @remarks * this message. The server continues running in the background. The client * is expected to close the stream after sending this message, and can * reconnect again later to retrieve further output. */ background?: boolean | undefined; event_type: "interaction.connect"; id?: string | undefined; }; /** * An error that is raised when a HTTP client is unable to make a request to * a server. */ declare class ConnectionError extends HTTPClientError { readonly name = "ConnectionError"; } declare type Content$ = Content_2; /** Contains the multi-part content of a message. */ export declare interface Content { /** List of parts that constitute a single message. Each part may have a different IANA MIME type. */ parts?: Part[]; /** Optional. The producer of the content. Must be either 'user' or 'model'. If not set, the service will default to 'user'. */ role?: string; } /** * The content of the response. */ declare type Content_2 = AudioContent | DocumentContent | ImageContent | TextContent | VideoContent; /** The embedding generated from an input content. */ export declare interface ContentEmbedding { /** A list of floats representing an embedding. */ values?: number[]; /** Gemini platform only. Statistics of the input text associated with this embedding. */ statistics?: ContentEmbeddingStatistics; } /** Statistics of the input text associated with the result of content embedding. */ export declare interface ContentEmbeddingStatistics { /** Gemini platform only. If the input text was truncated due to having a length longer than the allowed maximum input. */ truncated?: boolean; /** Gemini platform only. Number of tokens of the input text. */ tokenCount?: number; /** Gemini platform only. List of modalities and their token count for the input content. */ tokensDetails?: ModalityTokenCount[]; } export declare type ContentListUnion = Content | Content[] | PartUnion | PartUnion[]; /** A content reference image. A content reference image represents a subject to reference (ex. person, product, animal) provided by the user. It can optionally be provided in addition to a style reference image (ex. background, style reference). */ export declare class ContentReferenceImage { /** The reference image for the editing operation. */ referenceImage?: Image_2; /** The id of the reference image. */ referenceId?: number; /** The type of the reference image. Only set by the SDK. */ referenceType?: string; /** Internal method to convert to ReferenceImageAPIInternal. */ toReferenceImageAPI(): ReferenceImageAPIInternal; } export declare type ContentUnion = Content | PartUnion[] | PartUnion; /** Enables context window compression -- mechanism managing model context window so it does not exceed given length. */ export declare interface ContextWindowCompressionConfig { /** Number of tokens (before running turn) that triggers context window compression mechanism. */ triggerTokens?: string; /** Sliding window compression mechanism. */ slidingWindow?: SlidingWindow; } /** * Thrown when Interactions automatic continuation fails after progress. * * `interactions.create()` with `automatic_continuation` enabled (the default) * may make several requests ("hops"), each one resuming the decode from the * previous hop's `continuation_token`. If a hop fails after the server already * produced (and billed) output in an earlier hop, or after a resumable * checkpoint was reached, this error is thrown instead of the underlying * error so the work is not lost. The underlying error is `cause`. * * To resume, pass `continuationToken` as `continuation_token` to * `interactions.create()`: with `store` enabled (the default), also pass * `interactionId` as `previous_interaction_id` and no `input`; with * `store: false`, resend the original `input`. */ export declare class ContinuationInterruptedError extends Error { /** The underlying error (the failed hop's API or transport error). */ readonly cause: unknown; /** * For unary calls, the interaction merged from the hops that completed * (status `requires_continuation`, with the resumable `continuation_token`), * or undefined if no hop completed. Always undefined for streams, whose * events were already yielded. */ readonly partialInteraction: unknown; /** * The latest resumable continuation token. For streams this may be a mid-hop * checkpoint: resuming from it re-generates any output yielded after the * checkpoint. */ readonly continuationToken: string | undefined; /** * The id of the interaction that issued `continuationToken` (the value to * send as `previous_interaction_id`), or undefined if unknown or unstored * (`store: false`). */ readonly interactionId: string | undefined; /** The ids of every hop created during the call, in order. */ readonly continuationIds: string[]; constructor(options: ContinuationInterruptedErrorInfo); } /** * Details for a `ContinuationInterruptedError`. */ export declare interface ContinuationInterruptedErrorInfo { /** The error message. */ message: string; /** The underlying error (the failed hop's API or transport error). */ cause?: unknown; /** * For unary calls, the interaction merged from the hops that completed; * undefined for streams. */ partialInteraction?: unknown; /** The latest resumable continuation token. */ continuationToken?: string; /** The id of the interaction that issued `continuationToken`. */ interactionId?: string; /** The ids of every hop created during the call, in order. */ continuationIds?: string[]; } /** Configuration for a Control reference image. */ export declare interface ControlReferenceConfig { /** The type of control reference image to use. */ controlType?: ControlReferenceType; /** Defaults to False. When set to True, the control image will be computed by the model based on the control type. When set to False, the control image must be provided by the user. */ enableControlImageComputation?: boolean; } /** A control reference image. The image of the control reference image is either a control image provided by the user, or a regular image which the backend will use to generate a control image of. In the case of the latter, the enable_control_image_computation field in the config should be set to True. A control image is an image that represents a sketch image of areas for the model to fill in based on the prompt. */ export declare class ControlReferenceImage { /** The reference image for the editing operation. */ referenceImage?: Image_2; /** The id of the reference image. */ referenceId?: number; /** The type of the reference image. Only set by the SDK. */ referenceType?: string; /** Configuration for the control reference image. */ config?: ControlReferenceConfig; /** Internal method to convert to ReferenceImageAPIInternal. */ toReferenceImageAPI(): ReferenceImageAPIInternal; } /** Enum representing the control type of a control reference image. */ export declare enum ControlReferenceType { CONTROL_TYPE_DEFAULT = "CONTROL_TYPE_DEFAULT", CONTROL_TYPE_CANNY = "CONTROL_TYPE_CANNY", CONTROL_TYPE_SCRIBBLE = "CONTROL_TYPE_SCRIBBLE", CONTROL_TYPE_FACE_MESH = "CONTROL_TYPE_FACE_MESH" } /** Config for the count_tokens method. */ export declare interface CountTokensConfig { /** Used to override HTTP request options. */ httpOptions?: HttpOptions; /** Abort signal which can be used to cancel the request. NOTE: AbortSignal is a client-only operation. Using it to cancel an operation will not cancel the request in the service. You will still be charged usage for any applicable operations. */ abortSignal?: AbortSignal; /** Instructions for the model to steer it toward better performance. */ systemInstruction?: ContentUnion; /** Code that enables the system to interact with external systems to perform an action outside of the knowledge and scope of the model. */ tools?: Tool[]; /** Configuration that the model uses to generate the response. Not supported by the Gemini Developer API. */ generationConfig?: GenerationConfig; } /** Parameters for counting tokens. */ export declare interface CountTokensParameters { /** ID of the model to use. For a list of models, see `Google models `_. */ model: string; /** Input content. */ contents: ContentListUnion; /** Configuration for counting tokens. */ config?: CountTokensConfig; } /** Response for counting tokens. */ export declare class CountTokensResponse { /** Used to retain the full HTTP response. */ sdkHttpResponse?: HttpResponse; /** Total number of tokens. */ totalTokens?: number; /** Number of tokens in the cached part of the prompt (the cached content). */ cachedContentTokenCount?: number; } /** Local tokenizer count tokens result. */ export declare interface CountTokensResult { /** The total number of tokens. */ totalTokens?: number; } declare type CreateAgentGlobals = { /** * API version for request routing. */ api_version?: string | undefined; }; /** * Interaction for generating the completion using agents. */ declare type CreateAgentInteraction = { /** * The agent to interact with. */ agent: AgentOption; /** * Configuration parameters for the agent interaction. */ agent_config?: AntigravityAgentConfig | CodeMenderAgentConfig | DeepResearchAgentConfig | DynamicAgentConfig | undefined; /** * Input only. Whether to run the model interaction in the background. */ background?: boolean | undefined; /** * Opaque token to resume a long decode. Output: set when status is * * @remarks * REQUIRES_CONTINUATION and decoding can be resumed. Input: pass the latest * token back unchanged when creating the next interaction to continue * decoding. */ continuation_token?: string | undefined; /** * The environment configuration for the interaction. Can be an object * * @remarks * specifying remote environment sources or a string referencing an existing * environment ID. */ environment?: Environment_2 | string | undefined; /** * The input for the interaction. */ input?: InteractionsInput | undefined; /** * The labels with user-defined metadata for the request. * * @remarks * * Label keys and values can be no longer than 63 characters * (Unicode codepoints) and can only contain lowercase letters, numeric * characters, underscores, and dashes. International characters are allowed. * Label values are optional. Label keys must start with a letter. */ labels?: { [k: string]: string; } | undefined; /** * The ID of the previous interaction, if any. */ previous_interaction_id?: string | undefined; /** * Enforces that the generated response is a JSON object that complies with * * @remarks * the JSON schema specified in this field. */ response_format?: ResponseFormat_2 | Array | undefined; /** * The mime type of the response. This is required if response_format is set. * * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. */ response_mime_type?: string | undefined; /** * The requested modalities of the response (TEXT, IMAGE, AUDIO). * * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. */ response_modalities?: Array | undefined; /** * Safety settings for the interaction. */ safety_settings?: Array | undefined; service_tier?: ServiceTier_2 | undefined; /** * Input only. Whether to store the response and request for later retrieval. */ store?: boolean | undefined; /** * Input only. Whether the interaction will be streamed. */ stream?: boolean | undefined; /** * System instruction for the interaction. */ system_instruction?: string | undefined; /** * A list of tool declarations the model may call during interaction. */ tools?: Array | undefined; /** * Message for configuring webhook events for a request. */ webhook_config?: WebhookConfig_2 | undefined; }; /** * Configuration parameters for the agent interaction. */ declare type CreateAgentInteractionAgentConfig = AntigravityAgentConfig | CodeMenderAgentConfig | DeepResearchAgentConfig | DynamicAgentConfig; /** * The environment configuration for the interaction. Can be an object * * @remarks * specifying remote environment sources or a string referencing an existing * environment ID. */ declare type CreateAgentInteractionEnvironment = Environment_2 | string; declare type CreateAgentInteractionParams$ = CreateAgentInteractionParams; declare type CreateAgentInteractionParams = Omit & CreateAgentInteraction; declare type CreateAgentInteractionParamsNonStreaming$ = CreateAgentInteraction; declare type CreateAgentInteractionParamsNonStreaming$2 = CreateAgentInteractionParamsNonStreaming; declare type CreateAgentInteractionParamsNonStreaming = CreateAgentInteractionParams & { stream?: false | undefined; }; declare type CreateAgentInteractionParamsStreaming$ = CreateAgentInteraction; declare type CreateAgentInteractionParamsStreaming$2 = CreateAgentInteractionParamsStreaming; declare type CreateAgentInteractionParamsStreaming = CreateAgentInteractionParams & { stream: true; }; /** * Enforces that the generated response is a JSON object that complies with * * @remarks * the JSON schema specified in this field. */ declare type CreateAgentInteractionResponseFormat = ResponseFormat_2 | Array; declare type CreateAgentParams = Omit & CreateAgentRequest["body"]; declare type CreateAgentRequest = { /** * API version for request routing. */ api_version?: string | undefined; /** * Required. The request body. */ body: agents.Agent; }; declare type CreateAgentTemplateGlobals = { /** * API version for request routing. */ api_version?: string | undefined; }; declare type CreateAgentTemplateParams = Omit & CreateAgentTemplateRequest["body"]; declare type CreateAgentTemplateRequest = { /** * API version for request routing. */ api_version?: string | undefined; /** * Required. The request body. */ body: agents.AgentTemplateCreateParams; }; /** Optional parameters. */ export declare interface CreateAuthTokenConfig { /** Used to override HTTP request options. */ httpOptions?: HttpOptions; /** Abort signal which can be used to cancel the request. NOTE: AbortSignal is a client-only operation. Using it to cancel an operation will not cancel the request in the service. You will still be charged usage for any applicable operations. */ abortSignal?: AbortSignal; /** An optional time after which, when using the resulting token, messages in Live API sessions will be rejected. (Gemini may preemptively close the session after this time.) If not set then this defaults to 30 minutes in the future. If set, this value must be less than 20 hours in the future. */ expireTime?: string; /** The time after which new Live API sessions using the token resulting from this request will be rejected. If not set this defaults to 60 seconds in the future. If set, this value must be less than 20 hours in the future. */ newSessionExpireTime?: string; /** The number of times the token can be used. If this value is zero then no limit is applied. Default is 1. Resuming a Live API session does not count as a use. */ uses?: number; /** Configuration specific to Live API connections created using this token. */ liveConnectConstraints?: LiveConnectConstraints; /** Additional fields to lock in the effective LiveConnectParameters. */ lockAdditionalFields?: string[]; } /** Config for auth_tokens.create parameters. */ export declare interface CreateAuthTokenParameters { /** Optional parameters for the request. */ config?: CreateAuthTokenConfig; } /** Config for optional parameters. */ export declare interface CreateBatchJobConfig { /** Used to override HTTP request options. */ httpOptions?: HttpOptions; /** Abort signal which can be used to cancel the request. NOTE: AbortSignal is a client-only operation. Using it to cancel an operation will not cancel the request in the service. You will still be charged usage for any applicable operations. */ abortSignal?: AbortSignal; /** The user-defined name of this BatchJob. */ displayName?: string; /** GCS or BigQuery URI prefix for the output predictions. Example: "gs://path/to/output/data" or "bq://projectId.bqDatasetId.bqTableId". */ dest?: BatchJobDestinationUnion; /** Webhook configuration for receiving notifications when the batch operation completes. */ webhookConfig?: WebhookConfig; } /** Config for batches.create parameters. */ export declare interface CreateBatchJobParameters { /** The name of the model to produces the predictions via the BatchJob. */ model?: string; /** GCS URI(-s) or BigQuery URI to your input data to run batch job. Example: "gs://path/to/input/data" or "bq://projectId.bqDatasetId.bqTableId". */ src: BatchJobSourceUnion; /** Optional parameters for creating a BatchJob. */ config?: CreateBatchJobConfig; } /** Optional configuration for cached content creation. */ export declare interface CreateCachedContentConfig { /** Used to override HTTP request options. */ httpOptions?: HttpOptions; /** Abort signal which can be used to cancel the request. NOTE: AbortSignal is a client-only operation. Using it to cancel an operation will not cancel the request in the service. You will still be charged usage for any applicable operations. */ abortSignal?: AbortSignal; /** The TTL for this resource. The expiration time is computed: now + TTL. It is a duration string, with up to nine fractional digits, terminated by 's'. Example: "3.5s". */ ttl?: string; /** Timestamp of when this resource is considered expired. Uses RFC 3339 format, Example: 2014-10-02T15:01:23Z. */ expireTime?: string; /** The user-generated meaningful display name of the cached content. */ displayName?: string; /** The content to cache. */ contents?: ContentListUnion; /** Developer set system instruction. */ systemInstruction?: ContentUnion; /** A list of `Tools` the model may use to generate the next response. */ tools?: Tool[]; /** Configuration for the tools to use. This config is shared for all tools. */ toolConfig?: ToolConfig; /** The Cloud KMS resource identifier of the customer managed encryption key used to protect a resource. The key needs to be in the same region as where the compute resource is created. See https://cloud.google.com/vertex-ai/docs/general/cmek for more details. If this is set, then all created CachedContent objects will be encrypted with the provided encryption key. Allowed formats: projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key} */ kmsKeyName?: string; } /** Parameters for caches.create method. */ export declare interface CreateCachedContentParameters { /** ID of the model to use. Example: gemini-3.8-flash */ model: string; /** Configuration that contains optional parameters. */ config?: CreateCachedContentConfig; } /** Parameters for initializing a new chat session. These parameters are used when creating a chat session with the `chats.create()` method. */ export declare interface CreateChatParameters { /** The name of the model to use for the chat session. For example: 'gemini-3.8-flash', 'gemini-flash-lite-latest', etc. See Gemini API docs to find the available models. */ model: string; /** The initial conversation history for the chat session. This allows you to start the chat with a pre-existing history. The history must be a list of `Content` alternating between 'user' and 'model' roles. It should start with a 'user' message. */ history?: Content[]; /** Config for the entire chat session. This config applies to all requests within the session unless overridden by a per-request `config` in `SendMessageParameters`. */ config?: GenerateContentConfig; } declare type CreateCredentialGlobals = { /** * API version for request routing. */ api_version?: string | undefined; }; declare type CreateCredentialParams = Omit & CreateCredentialRequest["body"]; declare type CreateCredentialRequest = { /** * API version for request routing. */ api_version?: string | undefined; /** * Required. The request body. */ body: credentials.CredentialCreateParams; }; declare type CreateDecisionGlobals = { /** * API version for request routing. */ api_version?: string | undefined; }; declare type CreateDecisionRequest$ = CreateDecisionRequest; /** * Request message for `CreateDecision`. * * @remarks * * Evaluates one or more structured decision questions (Noul, Choice, or Score) * against a shared `input`. */ declare type CreateDecisionRequest = { /** * Required. Shared input prefix evaluated once across all decision questions. */ input: DecisionInputContent | Array | string; /** * Required. The name of the `Model` to use for evaluating the decisions. * * @remarks * * Format: `models/{model}`. */ model: string; /** * Required. The decision questions to evaluate, keyed by caller-defined unique question * * @remarks * identifiers (at least 1 question). */ questions: { [k: string]: Question; }; }; declare type CreateDecisionRequest_2 = { /** * API version for request routing. */ api_version?: string | undefined; /** * Required. The HTTP body of the request payload. */ body: decisions.CreateDecisionRequest; }; declare type CreateDecisionResponse$ = CreateDecisionResponse; /** * Response message for `CreateDecision`. */ declare type CreateDecisionResponse = { /** * Output only. Decision answers keyed by the question identifiers from * * @remarks * `CreateDecisionRequest.questions`. */ answers?: { [k: string]: Answer; } | undefined; /** * Feedback from input content filters. */ prompt_feedback?: PromptFeedback | undefined; /** * Statistics on the interaction request's token usage. */ usage?: interactions.Usage | undefined; }; /** Config for optional parameters. */ export declare interface CreateEmbeddingsBatchJobConfig { /** Used to override HTTP request options. */ httpOptions?: HttpOptions; /** Abort signal which can be used to cancel the request. NOTE: AbortSignal is a client-only operation. Using it to cancel an operation will not cancel the request in the service. You will still be charged usage for any applicable operations. */ abortSignal?: AbortSignal; /** The user-defined name of this BatchJob. */ displayName?: string; } /** Config for batches.create parameters. */ export declare interface CreateEmbeddingsBatchJobParameters { /** The name of the model to produces the predictions via the BatchJob. */ model?: string; /** input data to run batch job". */ src: EmbeddingsBatchJobSource; /** Optional parameters for creating a BatchJob. */ config?: CreateEmbeddingsBatchJobConfig; } declare type CreateEnvironmentGlobals = { /** * API version for request routing. */ api_version?: string | undefined; }; declare type CreateEnvironmentRequest$ = CreateEnvironmentRequest; /** * Request for creating an environment. */ declare type CreateEnvironmentRequest = { /** * Optional. Arbitrary customer-defined JSON configuration passed through * * @remarks * to the self-hosted environment poller. Only supported when `mode` is * `SELF_HOSTED`. */ custom_config?: { [k: string]: any; } | undefined; /** * Environment variables to set in the sandbox environment. */ env?: { [k: string]: interactions.EnvVar | string; } | undefined; /** * Optional. The source environment to copy/fork from. * * @remarks * Format: `environments/{environment_id}` or `{environment_id}`. * When specified, `sources` and `env` must be empty. */ from_environment?: string | undefined; /** * The compute lifecycle mode for an environment. */ mode?: interactions.EnvironmentMode | undefined; /** * Network configuration for the environment. */ network?: interactions.EnvironmentNetworkEgressAllowlist | CreateEnvironmentRequestNetworkEnum | undefined; /** * Sources to be mounted into the environment. */ sources?: Array | undefined; /** * Optional. System instruction applied to interactions running in this * * @remarks * environment. Only supported for `SELF_HOSTED` environments, where it is * recommended. */ system_instruction?: string | undefined; }; declare type CreateEnvironmentRequest_2 = { /** * API version for request routing. */ api_version?: string | undefined; /** * Required. The request body. */ body: environments.CreateEnvironmentRequest; }; declare type CreateEnvironmentRequestNetworkEnum = "disabled"; /** * Network configuration for the environment. */ declare type CreateEnvironmentRequestNetworkUnion = interactions.EnvironmentNetworkEgressAllowlist | CreateEnvironmentRequestNetworkEnum; /** Used to override the default configuration. */ export declare interface CreateFileConfig { /** Used to override HTTP request options. */ httpOptions?: HttpOptions; /** Abort signal which can be used to cancel the request. NOTE: AbortSignal is a client-only operation. Using it to cancel an operation will not cancel the request in the service. You will still be charged usage for any applicable operations. */ abortSignal?: AbortSignal; } /** Generates the parameters for the private _create method. */ export declare interface CreateFileParameters { /** The file to be uploaded. mime_type: (Required) The MIME type of the file. Must be provided. name: (Optional) The name of the file in the destination (e.g. 'files/sample-image'). display_name: (Optional) The display name of the file. */ file: File_2; /** Used to override the default configuration. */ config?: CreateFileConfig; } /** Response for the create file method. */ export declare class CreateFileResponse { /** Used to retain the full HTTP response. */ sdkHttpResponse?: HttpResponse; } /** Optional parameters for creating a file search store. */ export declare interface CreateFileSearchStoreConfig { /** Used to override HTTP request options. */ httpOptions?: HttpOptions; /** Abort signal which can be used to cancel the request. NOTE: AbortSignal is a client-only operation. Using it to cancel an operation will not cancel the request in the service. You will still be charged usage for any applicable operations. */ abortSignal?: AbortSignal; /** The human-readable display name for the file search store. */ displayName?: string; /** The embedding model to use for the FileSearchStore. Format: `models/{model}`. If not specified, the default embedding model will be used. */ embeddingModel?: string; } /** Config for file_search_stores.create parameters. */ export declare interface CreateFileSearchStoreParameters { /** Optional parameters for creating a file search store. */ config?: CreateFileSearchStoreConfig; } /** * Creates a `FunctionResponsePart` object from a `base64` encoded `string`. */ export declare function createFunctionResponsePartFromBase64(data: string, mimeType: string): FunctionResponsePart; /** * Creates a `FunctionResponsePart` object from a `URI` string. */ export declare function createFunctionResponsePartFromUri(uri: string, mimeType: string): FunctionResponsePart; declare type CreateInteractionAuthTokenGlobals = { /** * API version for request routing. */ api_version?: string | undefined; }; export declare type CreateInteractionAuthTokenParams = Omit & CreateInteractionAuthTokenRequest["body"]; declare type CreateInteractionAuthTokenRequest = { /** * API version for request routing. */ api_version?: string | undefined; /** * Required. interaction_id */ interaction_id: string; body: interactions.InteractionAuthTokenCreateParams; }; declare type CreateInteractionEvent$ = CreateInteractionEvent; /** * Starts a new Interaction. */ declare type CreateInteractionEvent = { event_type: "interaction.create"; /** * The name of the `Model` used for generating the completion. */ model?: string | undefined; /** * The ID of a previous interaction. If set, the output from that interaction * * @remarks * will be prepended to the input. That interaction must have been run with * store=true and must be in a terminal state (e.g., COMPLETED). */ previous_interaction_id?: string | undefined; /** * Whether to store the interaction so that it can be retrieved later, e.g. * * @remarks * to be referenced as the `previous_interaction_id` of a subsequent * interaction. * * This does not enable / disable the storage needed to execute the * interaction itself (e.g. to reconnect or to recover from a failure). */ store?: boolean | undefined; /** * System instruction for the interaction. * * @remarks * Deprecated: Use developer_instructions instead. */ system_instruction?: string | undefined; /** * A list of tool declarations the model may call during interaction. */ tools?: Array | undefined; }; declare type CreateInteractionGlobals = { /** * API version for request routing. */ api_version?: string | undefined; }; declare type CreateInteractionParams = Omit & CreateInteractionRequest["body"]; declare type CreateInteractionParamsNonStreaming = CreateInteractionParams & { stream?: false | undefined; }; declare type CreateInteractionParamsStreaming = CreateInteractionParams & { stream: true; }; declare type CreateInteractionParamsWithOptions = Interactions.InteractionCreateParams & AutomaticContinuationOption; declare type CreateInteractionRequest = { /** * API version for request routing. */ api_version?: string | undefined; /** * The request body. */ body: interactions.CreateAgentInteraction | interactions.CreateModelInteraction; }; /** * The request body. */ declare type CreateInteractionRequestBody = interactions.CreateAgentInteraction | interactions.CreateModelInteraction; declare type CreateInteractionResponse = interactions.Interaction | Stream; /** * Creates a `Content` object with a model role from a `PartListUnion` object or `string`. */ export declare function createModelContent(partOrString: PartListUnion | string): Content; /** * Interaction for generating the completion using models. */ declare type CreateModelInteraction = { /** * Input only. Whether to run the model interaction in the background. */ background?: boolean | undefined; /** * The name of the cached content used as context to serve the prediction. Note: only used in explicit caching, where users can have control over caching (e.g. what content to cache) and enjoy guaranteed cost savings. Format: cachedContents/{cachedContent} * * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. */ cached_content?: string | undefined; /** * Opaque token to resume a long decode. Output: set when status is * * @remarks * REQUIRES_CONTINUATION and decoding can be resumed. Input: pass the latest * token back unchanged when creating the next interaction to continue * decoding. */ continuation_token?: string | undefined; /** * The environment configuration for the interaction. Can be an object * * @remarks * specifying remote environment sources or a string referencing an existing * environment ID. */ environment?: Environment_2 | string | undefined; /** * Configuration parameters for model interactions. */ generation_config?: GenerationConfig_2 | undefined; /** * The input for the interaction. */ input?: InteractionsInput | undefined; /** * The labels with user-defined metadata for the request. * * @remarks * * Label keys and values can be no longer than 63 characters * (Unicode codepoints) and can only contain lowercase letters, numeric * characters, underscores, and dashes. International characters are allowed. * Label values are optional. Label keys must start with a letter. */ labels?: { [k: string]: string; } | undefined; /** * The model that will complete your prompt.\n\nSee [models](https://aistudio.google.com/docs/models) for additional details. */ model: Model_2; /** * The ID of the previous interaction, if any. */ previous_interaction_id?: string | undefined; /** * Enforces that the generated response is a JSON object that complies with * * @remarks * the JSON schema specified in this field. */ response_format?: ResponseFormat_2 | Array | undefined; /** * The mime type of the response. This is required if response_format is set. * * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. */ response_mime_type?: string | undefined; /** * The requested modalities of the response (TEXT, IMAGE, AUDIO). * * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. */ response_modalities?: Array | undefined; /** * Safety settings for the interaction. */ safety_settings?: Array | undefined; service_tier?: ServiceTier_2 | undefined; /** * Input only. Whether to store the response and request for later retrieval. */ store?: boolean | undefined; /** * Input only. Whether the interaction will be streamed. */ stream?: boolean | undefined; /** * System instruction for the interaction. */ system_instruction?: string | undefined; /** * A list of tool declarations the model may call during interaction. */ tools?: Array | undefined; /** * Message for configuring webhook events for a request. */ webhook_config?: WebhookConfig_2 | undefined; }; /** * The environment configuration for the interaction. Can be an object * * @remarks * specifying remote environment sources or a string referencing an existing * environment ID. */ declare type CreateModelInteractionEnvironment = Environment_2 | string; declare type CreateModelInteractionParams$ = CreateModelInteractionParams; declare type CreateModelInteractionParams = Omit & CreateModelInteraction; declare type CreateModelInteractionParamsNonStreaming$ = CreateModelInteraction; declare type CreateModelInteractionParamsNonStreaming$2 = CreateModelInteractionParamsNonStreaming; declare type CreateModelInteractionParamsNonStreaming = CreateModelInteractionParams & { stream?: false | undefined; }; declare type CreateModelInteractionParamsStreaming$ = CreateModelInteraction; declare type CreateModelInteractionParamsStreaming$2 = CreateModelInteractionParamsStreaming; declare type CreateModelInteractionParamsStreaming = CreateModelInteractionParams & { stream: true; }; /** * Enforces that the generated response is a JSON object that complies with * * @remarks * the JSON schema specified in this field. */ declare type CreateModelInteractionResponseFormat = ResponseFormat_2 | Array; /** * Creates a `Part` object from a `base64` encoded `string`. */ export declare function createPartFromBase64(data: string, mimeType: string, mediaResolution?: PartMediaResolutionLevel): Part; /** * Creates a `Part` object from the `outcome` and `output` of a `CodeExecutionResult` object. */ export declare function createPartFromCodeExecutionResult(outcome: Outcome, output: string): Part; /** * Creates a `Part` object from the `code` and `language` of an `ExecutableCode` object. */ export declare function createPartFromExecutableCode(code: string, language: Language): Part; /** * Creates a `Part` object from a `FunctionCall` object. */ export declare function createPartFromFunctionCall(name: string, args: Record): Part; /** * Creates a `Part` object from a `FunctionResponse` object. */ export declare function createPartFromFunctionResponse(id: string, name: string, response: Record, parts?: FunctionResponsePart[]): Part; /** * Creates a `Part` object from a `text` string. */ export declare function createPartFromText(text: string): Part; /** * Creates a `Part` object from a `URI` string. */ export declare function createPartFromUri(uri: string, mimeType: string, mediaResolution?: PartMediaResolutionLevel): Part; declare type CreateTriggerGlobals = { /** * API version for request routing. */ api_version?: string | undefined; }; declare type CreateTriggerParams = Omit & CreateTriggerRequest["body"]; declare type CreateTriggerRequest = { /** * API version for request routing. */ api_version?: string | undefined; /** * Required. The trigger configuration to create. */ body: triggers.TriggerCreateParams; }; /** Fine-tuning job creation request - optional fields. */ export declare interface CreateTuningJobConfig { /** Used to override HTTP request options. */ httpOptions?: HttpOptions; /** Abort signal which can be used to cancel the request. NOTE: AbortSignal is a client-only operation. Using it to cancel an operation will not cancel the request in the service. You will still be charged usage for any applicable operations. */ abortSignal?: AbortSignal; /** The method to use for tuning (SUPERVISED_FINE_TUNING or PREFERENCE_TUNING or DISTILLATION or REINFORCEMENT_TUNING). If not set, the default method (SFT) will be used. */ method?: TuningMethod; /** Validation dataset for tuning. The dataset must be formatted as a JSONL file. */ validationDataset?: TuningValidationDataset; /** The display name of the tuned Model. The name can be up to 128 characters long and can consist of any UTF-8 characters. */ tunedModelDisplayName?: string; /** The description of the TuningJob */ description?: string; /** Number of complete passes the model makes over the entire training dataset during training. */ epochCount?: number; /** Multiplier for adjusting the default learning rate. 1P models only. Mutually exclusive with learning_rate. */ learningRateMultiplier?: number; /** If set to true, disable intermediate checkpoints and only the last checkpoint will be exported. Otherwise, enable intermediate checkpoints. */ exportLastCheckpointOnly?: boolean; /** The optional checkpoint id of the pre-tuned model to use for tuning, if applicable. */ preTunedModelCheckpointId?: string; /** Adapter size for tuning. */ adapterSize?: AdapterSize; /** Tuning mode for tuning. */ tuningMode?: TuningMode; /** Custom base model for tuning. This is only supported for OSS models in Gemini platform. */ customBaseModel?: string; /** The batch size hyperparameter for tuning. This is only supported for OSS models in Gemini platform. */ batchSize?: number; /** The learning rate for tuning. OSS models only. Mutually exclusive with learning_rate_multiplier. */ learningRate?: number; /** Optional. The labels with user-defined metadata to organize TuningJob and generated resources such as Model and Endpoint. Label keys and values can be no longer than 64 characters (Unicode codepoints), can only contain lowercase letters, numeric characters, underscores and dashes. International characters are allowed. See https://goo.gl/xmQnxf for more information and examples of labels. */ labels?: Record; /** Weight for KL Divergence regularization, Preference Optimization tuning only. */ beta?: number; /** The base teacher model that is being distilled. Distillation only. */ baseTeacherModel?: string; /** The resource name of the Tuned teacher model. Distillation only. */ tunedTeacherModelSource?: string; /** Multiplier for adjusting the weight of the SFT loss. Distillation only. */ sftLossWeightMultiplier?: number; /** The Google Cloud Storage location where the tuning job outputs are written. */ outputUri?: string; /** Reward function configuration for reinforcement tuning. Reinforcement tuning only. */ rewardConfig?: SingleReinforcementTuningRewardConfig; /** Composite reward function configuration for reinforcement tuning. Reinforcement tuning only. */ compositeRewardConfig?: CompositeReinforcementTuningRewardConfig; /** Number of different responses to generate per prompt during tuning. Reinforcement tuning only. */ samplesPerPrompt?: number; /** How often at steps to evaluate the tuning job during training. Reinforcement tuning only. */ evaluateInterval?: number; /** How often at steps to save checkpoints during training. Reinforcement tuning only. */ checkpointInterval?: number; /** The maximum number of tokens to generate per prompt. Reinforcement tuning only. */ maxOutputTokens?: number; /** Indicates the maximum thinking depth. Use with earlier models shall result in error. Reinforcement tuning only. */ thinkingLevel?: ReinforcementTuningThinkingLevel; /** Cloud Storage path to file containing validation dataset for tuning. The dataset must be formatted as a JSONL file. If no validation dataset is provided, by default the API splits 25% of the training dataset or 50 examples, whichever is larger, as the validation dataset. Reinforcement tuning only. */ validationDatasetUri?: string; /** The encryption spec of the tuning job. Customer-managed encryption key options for a TuningJob. If this is set, then all resources created by the TuningJob will be encrypted with provided encryption key. */ encryptionSpec?: EncryptionSpec; } /** Fine-tuning job creation parameters - optional fields. */ export declare interface CreateTuningJobParameters { /** The base model that is being tuned, e.g., "gemini-3.8-flash". */ baseModel: string; /** Cloud Storage path to file containing training dataset for tuning. The dataset must be formatted as a JSONL file. */ trainingDataset: TuningDataset; /** Configuration for the tuning job. */ config?: CreateTuningJobConfig; } /** Fine-tuning job creation parameters - optional fields. */ export declare interface CreateTuningJobParametersPrivate { /** The base model that is being tuned, e.g., "gemini-3.8-flash". */ baseModel?: string; /** The PreTunedModel that is being tuned. */ preTunedModel?: PreTunedModel; /** Cloud Storage path to file containing training dataset for tuning. The dataset must be formatted as a JSONL file. */ trainingDataset: TuningDataset; /** Configuration for the tuning job. */ config?: CreateTuningJobConfig; } /** * Creates a `Content` object with a user role from a `PartListUnion` object or `string`. */ export declare function createUserContent(partOrString: PartListUnion | string): Content; declare type CreateVoiceGlobals = { /** * API version for request routing. */ api_version?: string | undefined; }; declare type CreateVoiceRequest$ = CreateVoiceRequest; /** * Request for creating a voice. */ declare type CreateVoiceRequest = { /** * Optional. Whether the created voice is persisted and managed by Google. * * @remarks * * * When `true`, Google stores the voice and returns `Voice.id` (for example, * `voice_abc123def456`), which you can get, list, and delete, and * reference by ID in synthesis requests. Stored voices expire after 1 * year of inactivity; using a stored voice in speech synthesis or as a * `base_voice` when creating another voice extends its * `expire_time`. Projects are subject to a maximum active stored voice * quota; exceeding the quota returns `RESOURCE_EXHAUSTED`. * * When `false` (default), the voice is not stored by Google and `Voice.key` * (for example, `voicekey_...`) is returned for client-side storage and * synthesis. Optional discovery metadata fields on `voice` are not * persisted or returned when `store` is `false`. * * Required to be `true` when `voice.type` is `"prompted"` * (otherwise fails with `INVALID_ARGUMENT`). */ store?: boolean | undefined; /** * A voice resource representing either a custom voice that you create or a * * @remarks * prebuilt system voice (returned when listing voices). */ voice: VoiceInput; }; declare type CreateVoiceRequest_2 = { /** * API version for request routing. */ api_version?: string | undefined; /** * The request body. */ body: voices.CreateVoiceRequest; }; declare type CreateWebhookGlobals = { /** * API version for request routing. */ api_version?: string | undefined; }; declare type CreateWebhookParams = Omit & CreateWebhookRequest["body"]; declare type CreateWebhookRequest = { /** * API version for request routing. */ api_version?: string | undefined; /** * Required. The request body. */ body: webhooks.WebhookInput; }; declare type Credential$ = Credential_2; /** * Server-managed credential resource stored in Secret Manager. */ declare type Credential_2 = { /** * Output only. The timestamp when the credential was created. */ create_time?: string | undefined; /** * Required. Output only. Identifier. Unique identifier for the credential. */ id: string; /** * Output only. Current status of the credential. */ status?: Status_2 | undefined; /** * Required. Output only. The type of credential. */ type?: Type_2 | undefined; /** * Output only. The timestamp when the credential was last updated. */ update_time?: string | undefined; }; declare type CredentialCreateParams$ = CredentialCreateParams; /** * Represents the fields of a Credential provided on creation. */ declare type CredentialCreateParams = EnvironmentVariableConfig | HttpBearerConfig | OAuth2Config; declare type CredentialDeleteParams$ = DeleteCredentialParams; declare type CredentialDeleteResponse$ = Empty; declare type CredentialGetParams$ = GetCredentialParams; declare type CredentialListParams$ = ListCredentialsParams; declare type CredentialListResponse$ = CredentialListResponse; declare type CredentialListResponse = { credentials?: Array | undefined; next_page_token?: string | undefined; }; export declare namespace Credentials { export type Credential = Credential$; export type CredentialCreateParams = CredentialCreateParams$; export type CredentialDeleteParams = CredentialDeleteParams$; export type CredentialDeleteResponse = CredentialDeleteResponse$; export type CredentialGetParams = CredentialGetParams$; export type CredentialListParams = CredentialListParams$; export type CredentialListResponse = CredentialListResponse$; export type CredentialUpdate = CredentialUpdate$; export type EnvironmentVariableConfig = EnvironmentVariableConfig$; export type EnvironmentVariableUpdateConfig = EnvironmentVariableUpdateConfig$; export type HttpBearerConfig = HttpBearerConfig$; export type HttpBearerUpdateConfig = HttpBearerUpdateConfig$; export type InjectionLocation = InjectionLocation$; export type InjectionLocationEnum = InjectionLocationEnum$; export type OAuth2Config = OAuth2Config$; export type OAuth2UpdateConfig = OAuth2UpdateConfig$; } declare namespace credentials { export { CredentialCreateParams, CredentialListResponse, CredentialUpdate, Status_2 as Status, Type_2 as Type, Credential_2 as Credential, EnvironmentVariableConfigInjectionLocation, EnvironmentVariableConfig, EnvironmentVariableUpdateConfigInjectionLocation, EnvironmentVariableUpdateConfig, HttpBearerConfig, HttpBearerUpdateConfig, InjectionLocationEnum, OAuth2Config, OAuth2UpdateConfig } } declare class Credentials_2 extends ClientSDK { /** * Lists credentials. */ list(params?: ListCredentialsParams, options?: Omit): APIPromise; /** * Creates a new credential. */ create(params: CreateCredentialParams, options?: RequestOptions): APIPromise; /** * Deletes a credential. */ delete(id: string, params?: DeleteCredentialParams, options?: Omit): APIPromise; /** * Gets a credential by ID. */ get(id: string, params?: GetCredentialParams, options?: Omit): APIPromise; /** * Updates a credential. */ update(id: string, params: UpdateCredentialParams, options?: RequestOptions): APIPromise; } declare type CredentialUpdate$ = CredentialUpdate; /** * Represents the fields of a Credential that can be updated. */ declare type CredentialUpdate = EnvironmentVariableUpdateConfig | HttpBearerUpdateConfig | OAuth2UpdateConfig; export declare type CredentialUpdateParams = Credentials.CredentialUpdate & { /** * API version for request routing. */ api_version?: string | undefined; /** * Optional. The list of fields to update. */ update_mask?: string | undefined; }; /** Result for custom code execution metric. This data type is not supported in Gemini API. */ export declare interface CustomCodeExecutionResult { /** Output only. Custom code execution score. */ score?: number; } /** Configures the customized avatar to be used in the session. */ export declare interface CustomizedAvatar { /** The mime type of the reference image, e.g., "image/jpeg". */ imageMimeType?: string; /** The data of the reference image. The dimensions of the reference image should be 9:16 (portrait) with a minimum resolution of 704x1280. * @remarks Encoded as base64 string. */ imageData?: string; } /** User provided metadata stored as key-value pairs. This data type is not supported in Vertex AI. */ export declare interface CustomMetadata { /** Required. The key of the metadata to store. */ key?: string; /** The numeric value of the metadata to store. */ numericValue?: number; /** The StringList value of the metadata to store. */ stringListValue?: StringList; /** The string value of the metadata to store. */ stringValue?: string; } /** Spec for custom output. This data type is not supported in Gemini API. */ export declare interface CustomOutput { /** Output only. List of raw output strings. */ rawOutputs?: RawOutput; } /** Distribution computed over a tuning dataset. This data type is not supported in Gemini API. */ export declare interface DatasetDistribution { /** Output only. Defines the histogram bucket. */ buckets?: DatasetDistributionDistributionBucket[]; /** Output only. The maximum of the population values. */ max?: number; /** Output only. The arithmetic mean of the values in the population. */ mean?: number; /** Output only. The median of the values in the population. */ median?: number; /** Output only. The minimum of the population values. */ min?: number; /** Output only. The 5th percentile of the values in the population. */ p5?: number; /** Output only. The 95th percentile of the values in the population. */ p95?: number; /** Output only. Sum of a given population of values. */ sum?: number; } /** Dataset bucket used to create a histogram for the distribution given a population of values. This data type is not supported in Gemini API. */ export declare interface DatasetDistributionDistributionBucket { /** Output only. Number of values in the bucket. */ count?: string; /** Output only. Left bound of the bucket. */ left?: number; /** Output only. Right bound of the bucket. */ right?: number; } /** Statistics computed over a tuning dataset. This data type is not supported in Gemini API. */ export declare interface DatasetStats { /** Output only. Dataset distributions for the number of contents per example. */ contentsPerExampleDistribution?: DatasetDistribution; /** Output only. A partial sample of the indices (starting from 1) of the dropped examples. */ droppedExampleIndices?: string[]; /** Output only. For each index in `dropped_example_indices`, the user-facing reason why the example was dropped. */ droppedExampleReasons?: string[]; /** Output only. Sample user dataset examples in the training dataset uri for Reinforcement Tuning. */ reinforcementTuningUserDatasetExamples?: ReinforcementTuningUserDatasetExamples; /** Output only. Number of billable characters in the tuning dataset. */ totalBillableCharacterCount?: string; /** Output only. Number of billable tokens in the tuning dataset. */ totalBillableTokenCount?: string; /** Output only. Number of tuning characters in the tuning dataset. */ totalTuningCharacterCount?: string; /** Output only. Number of examples in the tuning dataset. */ tuningDatasetExampleCount?: string; /** Output only. Number of tuning steps for this Tuning Job. */ tuningStepCount?: string; /** Output only. Sample user messages in the training dataset uri. */ userDatasetExamples?: Content[]; /** Output only. Dataset distributions for the user input tokens. */ userInputTokenDistribution?: DatasetDistribution; /** Output only. Dataset distributions for the messages per example. */ userMessagePerExampleDistribution?: DatasetDistribution; /** Output only. Dataset distributions for the user output tokens. */ userOutputTokenDistribution?: DatasetDistribution; } declare type DecisionInputContent$ = DecisionInputContent; declare type DecisionInputContent = interactions.AudioContent | interactions.DocumentContent | interactions.ImageContent | interactions.TextContent | interactions.VideoContent; declare type DecisionInstructionContent$ = DecisionInstructionContent; declare type DecisionInstructionContent = interactions.TextContent; export declare namespace Decisions { export type Answer = Answer$; export type ChoiceAnswer = ChoiceAnswer$; export type ChoiceQuestion = ChoiceQuestion$; export type CreateDecisionRequest = CreateDecisionRequest$; export type CreateDecisionResponse = CreateDecisionResponse$; export type DecisionInputContent = DecisionInputContent$; export type DecisionInstructionContent = DecisionInstructionContent$; export type NoulAnswer = NoulAnswer$; export type NoulCriteria = NoulCriteria$; export type NoulQuestion = NoulQuestion$; export type PromptFeedback = PromptFeedback$; export type Question = Question$; export type ScoreAnswer = ScoreAnswer$; export type ScoreQuestion = ScoreQuestion$; } declare namespace decisions { export { Answer, ChoiceAnswer, ChoiceQuestionInstructions, ChoiceQuestion, Input, CreateDecisionRequest, CreateDecisionResponse, DecisionInputContent, DecisionInstructionContent, NoulAnswer, NoulCriteria, NoulQuestionInstructions, NoulQuestion, BlockReason, PromptFeedback, Question, ScoreAnswer, ScoreQuestionInstructions, ScoreQuestion } } declare class Decisions_2 extends ClientSDK { /** * Evaluates a batch of structured decision questions against a shared * context state. */ create(body: decisions.CreateDecisionRequest, api_version?: string | undefined, options?: RequestOptions): APIPromise; } declare type DeepResearchAgentConfig$ = DeepResearchAgentConfig; /** * Configuration for the Deep Research agent. */ declare type DeepResearchAgentConfig = { /** * Enables human-in-the-loop planning for the Deep Research agent. If set to * * @remarks * true, the Deep Research agent will provide a research plan in its response. * The agent will then proceed only if the user confirms the plan in the next * turn. */ collaborative_planning?: boolean | undefined; /** * Enables bigquery tool for the Deep Research agent. */ enable_bigquery_tool?: boolean | undefined; thinking_summaries?: ThinkingSummaries | undefined; type: "deep-research"; /** * Whether to include visualizations in the response. */ visualization?: Visualization | undefined; }; /** * @license * Copyright 2026 Google LLC * SPDX-License-Identifier: Apache-2.0 * * g3-prettier-ignore-file */ declare type DeleteAgentGlobals = { /** * API version for request routing. */ api_version?: string | undefined; }; declare type DeleteAgentParams = Omit; declare type DeleteAgentRequest = { /** * API version for request routing. */ api_version?: string | undefined; /** * Required. The name of the agent to delete. */ id: string; }; /** * @license * Copyright 2026 Google LLC * SPDX-License-Identifier: Apache-2.0 * * g3-prettier-ignore-file */ declare type DeleteAgentTemplateGlobals = { /** * API version for request routing. */ api_version?: string | undefined; }; declare type DeleteAgentTemplateParams = Omit; declare type DeleteAgentTemplateRequest = { /** * API version for request routing. */ api_version?: string | undefined; /** * Required. The name of the agent template to delete. */ id: string; }; /** Optional parameters for models.get method. */ export declare interface DeleteBatchJobConfig { /** Used to override HTTP request options. */ httpOptions?: HttpOptions; /** Abort signal which can be used to cancel the request. NOTE: AbortSignal is a client-only operation. Using it to cancel an operation will not cancel the request in the service. You will still be charged usage for any applicable operations. */ abortSignal?: AbortSignal; } /** Config for batches.delete parameters. */ export declare interface DeleteBatchJobParameters { /** A fully-qualified BatchJob resource name or ID. Example: "projects/.../locations/.../batchPredictionJobs/456" or "456" when project and location are initialized in the client. */ name: string; /** Optional parameters for the request. */ config?: DeleteBatchJobConfig; } /** Optional parameters for caches.delete method. */ export declare interface DeleteCachedContentConfig { /** Used to override HTTP request options. */ httpOptions?: HttpOptions; /** Abort signal which can be used to cancel the request. NOTE: AbortSignal is a client-only operation. Using it to cancel an operation will not cancel the request in the service. You will still be charged usage for any applicable operations. */ abortSignal?: AbortSignal; } /** Parameters for caches.delete method. */ export declare interface DeleteCachedContentParameters { /** The server-generated resource name of the cached content. */ name: string; /** Optional parameters for the request. */ config?: DeleteCachedContentConfig; } /** Empty response for caches.delete method. */ export declare class DeleteCachedContentResponse { /** Used to retain the full HTTP response. */ sdkHttpResponse?: HttpResponse; } /** * @license * Copyright 2026 Google LLC * SPDX-License-Identifier: Apache-2.0 * * g3-prettier-ignore-file */ declare type DeleteCredentialGlobals = { /** * API version for request routing. */ api_version?: string | undefined; }; declare type DeleteCredentialParams = Omit; declare type DeleteCredentialRequest = { /** * API version for request routing. */ api_version?: string | undefined; /** * Required. Resource ID segment making up resource `name`. It identifies the resource * * @remarks * within its parent collection as described in https://google.aip.dev/122. */ id: string; }; /** Config for optional parameters. */ export declare interface DeleteDocumentConfig { /** Used to override HTTP request options. */ httpOptions?: HttpOptions; /** Abort signal which can be used to cancel the request. NOTE: AbortSignal is a client-only operation. Using it to cancel an operation will not cancel the request in the service. You will still be charged usage for any applicable operations. */ abortSignal?: AbortSignal; /** If set to true, any `Chunk`s and objects related to this `Document` will also be deleted. */ force?: boolean; } /** Config for documents.delete parameters. */ export declare interface DeleteDocumentParameters { /** The resource name of the Document. Example: fileSearchStores/file-search-store-foo/documents/documents-bar */ name: string; /** Optional parameters for the request. */ config?: DeleteDocumentConfig; } /** * @license * Copyright 2026 Google LLC * SPDX-License-Identifier: Apache-2.0 * * g3-prettier-ignore-file */ declare type DeleteEnvironmentGlobals = { /** * API version for request routing. */ api_version?: string | undefined; }; declare type DeleteEnvironmentParams = Omit; declare type DeleteEnvironmentRequest = { /** * API version for request routing. */ api_version?: string | undefined; /** * Required. Resource ID segment making up resource `name`. It identifies the resource * * @remarks * within its parent collection as described in https://google.aip.dev/122. */ id: string; }; /** Used to override the default configuration. */ export declare interface DeleteFileConfig { /** Used to override HTTP request options. */ httpOptions?: HttpOptions; /** Abort signal which can be used to cancel the request. NOTE: AbortSignal is a client-only operation. Using it to cancel an operation will not cancel the request in the service. You will still be charged usage for any applicable operations. */ abortSignal?: AbortSignal; } /** Generates the parameters for the get method. */ export declare interface DeleteFileParameters { /** The name identifier for the file to be deleted. */ name: string; /** Used to override the default configuration. */ config?: DeleteFileConfig; } /** Response for the delete file method. */ export declare class DeleteFileResponse { /** Used to retain the full HTTP response. */ sdkHttpResponse?: HttpResponse; /** The ID of the deleted file. */ id?: string; /** The object type. Always `file_deleted`. */ type?: string; } /** Optional parameters for deleting a FileSearchStore. */ export declare interface DeleteFileSearchStoreConfig { /** Used to override HTTP request options. */ httpOptions?: HttpOptions; /** Abort signal which can be used to cancel the request. NOTE: AbortSignal is a client-only operation. Using it to cancel an operation will not cancel the request in the service. You will still be charged usage for any applicable operations. */ abortSignal?: AbortSignal; /** If set to true, any Documents and objects related to this FileSearchStore will also be deleted. If false (the default), a FAILED_PRECONDITION error will be returned if the FileSearchStore contains any Documents. */ force?: boolean; } /** Config for file_search_stores.delete parameters. */ export declare interface DeleteFileSearchStoreParameters { /** The resource name of the FileSearchStore. Example: `fileSearchStores/my-file-search-store-123` */ name: string; /** Optional parameters for the request. */ config?: DeleteFileSearchStoreConfig; } /** * @license * Copyright 2026 Google LLC * SPDX-License-Identifier: Apache-2.0 * * g3-prettier-ignore-file */ declare type DeleteInteractionAuthTokenGlobals = { /** * API version for request routing. */ api_version?: string | undefined; }; export declare type DeleteInteractionAuthTokenParams = Omit; declare type DeleteInteractionAuthTokenRequest = { /** * API version for request routing. */ api_version?: string | undefined; /** * Required. The interaction ID owning the auth token to revoke. */ interaction_id: string; /** * Required. The hex token string returned by `CreateInteractionAuthToken` (the `auth_token` value without its `auth_tokens/` prefix). */ auth_token: string; }; /** * @license * Copyright 2026 Google LLC * SPDX-License-Identifier: Apache-2.0 * * g3-prettier-ignore-file */ declare type DeleteInteractionGlobals = { /** * API version for request routing. */ api_version?: string | undefined; }; declare type DeleteInteractionParams = Omit; declare type DeleteInteractionRequest = { /** * API version for request routing. */ api_version?: string | undefined; /** * Required. The name of the interaction to delete. */ id: string; }; /** Configuration for deleting a tuned model. */ export declare interface DeleteModelConfig { /** Used to override HTTP request options. */ httpOptions?: HttpOptions; /** Abort signal which can be used to cancel the request. NOTE: AbortSignal is a client-only operation. Using it to cancel an operation will not cancel the request in the service. You will still be charged usage for any applicable operations. */ abortSignal?: AbortSignal; } /** Parameters for deleting a tuned model. */ export declare interface DeleteModelParameters { model: string; /** Optional parameters for the request. */ config?: DeleteModelConfig; } export declare class DeleteModelResponse { /** Used to retain the full HTTP response. */ sdkHttpResponse?: HttpResponse; } /** The return value of delete operation. */ export declare interface DeleteResourceJob { /** Used to retain the full HTTP response. */ sdkHttpResponse?: HttpResponse; name?: string; done?: boolean; error?: JobError; } /** * @license * Copyright 2026 Google LLC * SPDX-License-Identifier: Apache-2.0 * * g3-prettier-ignore-file */ declare type DeleteTriggerGlobals = { /** * API version for request routing. */ api_version?: string | undefined; }; declare type DeleteTriggerParams = Omit; declare type DeleteTriggerRequest = { /** * API version for request routing. */ api_version?: string | undefined; /** * Required. Resource name of the trigger. */ id: string; }; /** * @license * Copyright 2026 Google LLC * SPDX-License-Identifier: Apache-2.0 * * g3-prettier-ignore-file */ declare type DeleteVoiceGlobals = { /** * API version for request routing. */ api_version?: string | undefined; }; declare type DeleteVoiceParams = Omit; declare type DeleteVoiceRequest = { /** * API version for request routing. */ api_version?: string | undefined; /** * Required. The resource name of the custom stored voice to delete * * @remarks * (for example, `voices/voice_abc123def456`). */ id: string; }; /** * @license * Copyright 2026 Google LLC * SPDX-License-Identifier: Apache-2.0 * * g3-prettier-ignore-file */ /** * Response for deleting a voice. */ declare type DeleteVoiceResponse = {}; /** * @license * Copyright 2026 Google LLC * SPDX-License-Identifier: Apache-2.0 * * g3-prettier-ignore-file */ declare type DeleteWebhookGlobals = { /** * API version for request routing. */ api_version?: string | undefined; }; declare type DeleteWebhookParams = Omit; declare type DeleteWebhookRequest = { /** * API version for request routing. */ api_version?: string | undefined; /** * Required. The ID of the webhook to delete. */ id: string; }; /** Delivery mode for the generated content. */ export declare enum Delivery { /** * Default value. This value is unused. */ DELIVERY_UNSPECIFIED = "DELIVERY_UNSPECIFIED", /** * Generated bytes are returned inline in the response. */ INLINE = "INLINE", /** * Generated content is stored and a URI is returned. */ URI = "URI" } declare type Disabled = "disabled" | (string & {}); /** * @license * Copyright 2026 Google LLC * SPDX-License-Identifier: Apache-2.0 * * g3-prettier-ignore-file */ declare type DisabledSafetyPolicy = "financial_transactions" | "sensitive_data_modification" | "communication_tool" | "account_creation" | "data_modification" | "user_consent_management" | "legal_terms_and_agreements" | (string & {}); declare type DisconnectEvent$ = DisconnectEvent; /** * @license * Copyright 2026 Google LLC * SPDX-License-Identifier: Apache-2.0 * * g3-prettier-ignore-file */ /** * Requests a graceful disconnection without ending the interaction. */ declare type DisconnectEvent = { event_type: "interaction.disconnect"; }; /** Statistics for distillation prompt dataset. These statistics do not include the responses sampled from the teacher model. This data type is not supported in Gemini API. */ export declare interface DistillationDataStats { /** Output only. Statistics computed for the training dataset. */ trainingDatasetStats?: DatasetStats; } /** Distillation hyperparameters for tuning. */ export declare interface DistillationHyperParameters { /** Number of complete passes the model makes over the entire training dataset during training. */ epochCount?: string; /** Multiplier for adjusting the default learning rate. */ learningRateMultiplier?: number; /** The size of the adapter. Can be 'small', 'medium', or 'large'. */ adapterSize?: AdapterSize; /** Batch size for tuning. This feature is only available for open source models. */ batchSize?: number; /** The learning rate for distillation tuning. */ learningRate?: number; /** Generation config for Distillation teacher model sampling. Only the following fields are supported for distillation teacher samplings: - temperature - top_p - top_k - candidate_count - thinking_config */ generationConfig?: GenerationConfig; } /** Distillation sampling spec for tuning. */ export declare interface DistillationSamplingSpec { /** Cloud Storage path to file containing prompt dataset for distillation. The dataset must be formatted as a JSONL file. */ promptDatasetUri?: string; /** Cloud Storage path to file containing validation dataset for distillation. The dataset must be formatted as a JSONL file. */ validationDatasetUri?: string; /** The base teacher model that is being distilled. See [Supported models](https://cloud.google.com/vertex-ai/generative-ai/docs/model-reference/tuning#supported_models). */ baseTeacherModel?: string; /** The resource name of the Tuned teacher model. Format: `projects/{project}/locations/{location}/models/{model}`. */ tunedTeacherModelSource?: string; /** Hyperparameters for distillation tuning. */ hyperparameters?: DistillationHyperParameters; } /** Distillation tuning spec for tuning. */ export declare interface DistillationSpec { /** The base teacher model that is being distilled. See [Supported models](https://cloud.google.com/vertex-ai/generative-ai/docs/model-reference/tuning#supported_models). */ baseTeacherModel?: string; /** Optional. Hyperparameters for Distillation. */ hyperParameters?: DistillationHyperParameters; /** Deprecated. A path in a Cloud Storage bucket, which will be treated as the root output directory of the distillation pipeline. It is used by the system to generate the paths of output artifacts. */ pipelineRootDirectory?: string; /** Optional. Cloud Storage path to file containing prompt dataset for distillation. The dataset must be formatted as a JSONL file. */ promptDatasetUri?: string; /** The student model that is being tuned, e.g., "google/gemma-2b-1.1-it". Deprecated. Use base_model instead. */ studentModel?: string; /** Deprecated. Cloud Storage path to file containing training dataset for tuning. The dataset must be formatted as a JSONL file. */ trainingDatasetUri?: string; /** The resource name of the Tuned teacher model. Format: `projects/{project}/locations/{location}/models/{model}`. */ tunedTeacherModelSource?: string; /** Optional. Specifies the tuning mode for distillation (sft part). This feature is only available for open source models. */ tuningMode?: TuningMode; /** Optional. Cloud Storage path to file containing validation dataset for tuning. The dataset must be formatted as a JSONL file. */ validationDatasetUri?: string; } declare type Document$ = DocumentDelta; /** A Document is a collection of Chunks. */ declare interface Document_2 { /** Output only. The Timestamp of when the `Document` was created. */ createTime?: string; /** Optional. User provided custom metadata stored as key-value pairs used for querying. A `Document` can have a maximum of 20 `CustomMetadata`. */ customMetadata?: CustomMetadata[]; /** Optional. The human-readable display name for the `Document`. The display name must be no more than 512 characters in length, including spaces. Example: "Semantic Retriever Documentation". */ displayName?: string; /** Output only. The mime type of the Document. */ mimeType?: string; /** Immutable. Identifier. The `Document` resource name. The ID (name excluding the "fileSearchStores/*/documents/" 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 derived from `display_name` along with a 12 character random suffix. Example: `fileSearchStores/{file_search_store_id}/documents/my-awesome-doc-123a456b789c` */ name?: string; /** Output only. The size of raw bytes ingested into the Document. */ sizeBytes?: string; /** Output only. Current state of the `Document`. */ state?: DocumentState; /** Output only. The Timestamp of when the `Document` was last updated. */ updateTime?: string; } export { Document_2 as Document } declare type DocumentContent$ = DocumentContent; /** * A document content block. */ declare type DocumentContent = { /** * The document content. */ data?: string | undefined; /** * The mime type of the document. */ mime_type?: DocumentContentMimeType | undefined; /** * How the model processes this document for understanding. */ processing?: DocumentMediaProcessing | DocumentProcessingEnum | undefined; resolution?: MediaResolution_2 | undefined; type: "document"; /** * The URI of the document. */ uri?: string | undefined; }; /** * The mime type of the document. */ declare type DocumentContentMimeType = "application/pdf" | "text/csv" | "application/vnd.openxmlformats-officedocument.presentationml.presentation" | "application/vnd.ms-powerpoint" | "application/vnd.oasis.opendocument.presentation" | "application/vnd.openxmlformats-officedocument.wordprocessingml.document" | "application/msword" | "application/vnd.openxmlformats-officedocument.wordprocessingml.template" | "application/vnd.oasis.opendocument.text" | "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" | "application/vnd.ms-excel" | "application/vnd.oasis.opendocument.spreadsheet" | (string & {}); declare type DocumentDelta = { data?: string | undefined; mime_type?: DocumentDeltaMimeType | undefined; type: "document"; uri?: string | undefined; }; /** * @license * Copyright 2026 Google LLC * SPDX-License-Identifier: Apache-2.0 * * g3-prettier-ignore-file */ declare type DocumentDeltaMimeType = "application/pdf" | "text/csv" | "application/vnd.openxmlformats-officedocument.presentationml.presentation" | "application/vnd.ms-powerpoint" | "application/vnd.oasis.opendocument.presentation" | "application/vnd.openxmlformats-officedocument.wordprocessingml.document" | "application/msword" | "application/vnd.openxmlformats-officedocument.wordprocessingml.template" | "application/vnd.oasis.opendocument.text" | "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" | "application/vnd.ms-excel" | "application/vnd.oasis.opendocument.spreadsheet" | (string & {}); declare type DocumentMediaProcessing = DocumentStaticMediaProcessing; /** Metadata describes the input document content. Set this in `Part.document_metadata` or `FunctionResponsePart.document_metadata` when `inline_data` or `file_data` contains a document to configure static document preprocessing. */ export declare interface DocumentMetadata { /** Optional. 1-indexed inclusive start page. */ startPage?: number; /** Optional. 1-indexed inclusive end page. */ endPage?: number; /** Content layers to return. If empty, defaults to [PAGE_IMAGE] when DocumentMetadata is set. When DocumentMetadata is not set, default document processing is used (for example, page images for PDFs). */ contentLayers?: DocumentMetadataContentLayer[]; } /** DocumentMetadataContentLayer */ export declare enum DocumentMetadataContentLayer { /** * Default value. */ CONTENT_LAYER_UNSPECIFIED = "CONTENT_LAYER_UNSPECIFIED", /** * Rendered page images. */ PAGE_IMAGE = "PAGE_IMAGE", /** * Extracted page text. */ PAGE_TEXT = "PAGE_TEXT" } /** * How the model processes this document for understanding. */ declare type DocumentProcessing = DocumentMediaProcessing | DocumentProcessingEnum; declare type DocumentProcessingEnum = "static" | (string & {}); declare class Documents extends BaseModule { private readonly apiClient; constructor(apiClient: ApiClient); /** * Lists documents. * * @param params - The parameters for the list request. * @return - A pager of documents. * * @example * ```ts * const documents = await ai.documents.list({parent:'rag_store_name', config: {'pageSize': 2}}); * for await (const document of documents) { * console.log(document); * } * ``` */ list: (params: types.ListDocumentsParameters) => Promise>; /** * Gets a Document. * * @param params - The parameters for getting a document. * @return Document. */ get(params: types.GetDocumentParameters): Promise; /** * Deletes a Document. * * @param params - The parameters for deleting a document. */ delete(params: types.DeleteDocumentParameters): Promise; private listInternal; } /** Output only. Current state of the `Document`. This enum is not supported in Vertex AI. */ export declare enum DocumentState { /** * The default value. This value is used if the state is omitted. */ STATE_UNSPECIFIED = "STATE_UNSPECIFIED", /** * Some `Chunks` of the `Document` are being processed (embedding and vector storage). */ STATE_PENDING = "STATE_PENDING", /** * All `Chunks` of the `Document` is processed and available for querying. */ STATE_ACTIVE = "STATE_ACTIVE", /** * Some `Chunks` of the `Document` failed processing. */ STATE_FAILED = "STATE_FAILED" } declare type DocumentStaticMediaProcessing$ = DocumentStaticMediaProcessing; declare type DocumentStaticMediaProcessing = { /** * Processing options for paginated documents, such as PDFs, Office * * @remarks * documents, and presentations. */ page_options?: PageProcessingOptions | undefined; /** * Processing options for spreadsheets. */ spreadsheet_options?: SpreadsheetProcessingOptions | undefined; type: "static"; }; declare type DomCtorParam0 = K extends keyof typeof globalThis ? (typeof globalThis)[K] extends abstract new (arg0?: infer A, ...args: never[]) => unknown ? NonNullable : Fallback : Fallback; declare type DomInstance = K extends keyof typeof globalThis ? (typeof globalThis)[K] extends abstract new (...args: never[]) => infer T ? T : Fallback : Fallback; export declare type DownloadableFileUnion = string | File_2 | GeneratedVideo | Video; export declare type DownloadEnvironmentFileParams = { environment: string; path: string; api_version?: string; }; declare interface Downloader { /** * Downloads a file to the given location. * * @param params The parameters for downloading the file. * @param apiClient The ApiClient to use for uploading. * @return A Promises that resolves when the download is complete. */ download(params: DownloadFileParameters, apiClient: ApiClient): Promise; } /** Used to override the default configuration. */ export declare interface DownloadFileConfig { /** Used to override HTTP request options. */ httpOptions?: HttpOptions; /** Abort signal which can be used to cancel the request. NOTE: AbortSignal is a client-only operation. Using it to cancel an operation will not cancel the request in the service. You will still be charged usage for any applicable operations. */ abortSignal?: AbortSignal; } /** Parameters used to download a file. */ export declare interface DownloadFileParameters { /** The file to download. It can be a file name, a file object or a generated video. */ file: DownloadableFileUnion; /** Location where the file should be downloaded to. */ downloadPath: string; /** Configuration to for the download operation. */ config?: DownloadFileConfig; } /** Used to override the default configuration. */ export declare interface DownloadMediaConfig { /** Used to override HTTP request options. */ httpOptions?: HttpOptions; /** Abort signal which can be used to cancel the request. NOTE: AbortSignal is a client-only operation. Using it to cancel an operation will not cancel the request in the service. You will still be charged usage for any applicable operations. */ abortSignal?: AbortSignal; } declare type DynamicAgentConfig$ = DynamicAgentConfig; /** * @license * Copyright 2026 Google LLC * SPDX-License-Identifier: Apache-2.0 * * g3-prettier-ignore-file */ /** * Configuration for dynamic agents. */ declare type DynamicAgentConfig = { type: "dynamic"; [additionalProperties: string]: unknown; }; /** Describes the options to customize dynamic retrieval. */ export declare interface DynamicRetrievalConfig { /** Optional. The threshold to be used in dynamic retrieval. If not set, a system default value is used. */ dynamicThreshold?: number; /** The mode of the predictor to be used in dynamic retrieval. */ mode?: DynamicRetrievalConfigMode; } /** The mode of the predictor to be used in dynamic retrieval. */ export declare enum DynamicRetrievalConfigMode { /** * Always trigger retrieval. */ MODE_UNSPECIFIED = "MODE_UNSPECIFIED", /** * Run retrieval only when system decides it is necessary. */ MODE_DYNAMIC = "MODE_DYNAMIC" } /** Configuration for editing an image. */ export declare interface EditImageConfig { /** Used to override HTTP request options. */ httpOptions?: HttpOptions; /** Abort signal which can be used to cancel the request. NOTE: AbortSignal is a client-only operation. Using it to cancel an operation will not cancel the request in the service. You will still be charged usage for any applicable operations. */ abortSignal?: AbortSignal; /** Cloud Storage URI used to store the generated images. */ outputGcsUri?: string; /** Description of what to discourage in the generated images. */ negativePrompt?: string; /** Number of images to generate. */ numberOfImages?: number; /** Aspect ratio of the generated images. Supported values are "1:1", "3:4", "4:3", "9:16", and "16:9". */ aspectRatio?: string; /** Controls how much the model adheres to the text prompt. Large values increase output and prompt alignment, but may compromise image quality. */ guidanceScale?: number; /** Random seed for image generation. This is not available when ``add_watermark`` is set to true. */ seed?: number; /** Filter level for safety filtering. */ safetyFilterLevel?: SafetyFilterLevel; /** Allows generation of people by the model. */ personGeneration?: PersonGeneration; /** Whether to report the safety scores of each generated image and the positive prompt in the response. */ includeSafetyAttributes?: boolean; /** Whether to include the Responsible AI filter reason if the image is filtered out of the response. */ includeRaiReason?: boolean; /** Language of the text in the prompt. */ language?: ImagePromptLanguage; /** MIME type of the generated image. */ outputMimeType?: string; /** Compression quality of the generated image (for ``image/jpeg`` only). */ outputCompressionQuality?: number; /** Whether to add a watermark to the generated images. */ addWatermark?: boolean; /** User specified labels to track billing usage. */ labels?: Record; /** Describes the editing mode for the request. */ editMode?: EditMode; /** The number of sampling steps. A higher value has better image quality, while a lower value has better latency. */ baseSteps?: number; } /** Parameters for the request to edit an image. */ export declare interface EditImageParameters { /** The model to use. */ model: string; /** A text description of the edit to apply to the image. */ prompt: string; /** The reference images for Imagen 3 editing. */ referenceImages: ReferenceImage[]; /** Configuration for editing. */ config?: EditImageConfig; } /** Response for the request to edit an image. */ export declare class EditImageResponse { /** Used to retain the full HTTP response. */ sdkHttpResponse?: HttpResponse; /** Generated images. */ generatedImages?: GeneratedImage[]; } /** Enum representing the editing mode. */ export declare enum EditMode { EDIT_MODE_DEFAULT = "EDIT_MODE_DEFAULT", EDIT_MODE_INPAINT_REMOVAL = "EDIT_MODE_INPAINT_REMOVAL", EDIT_MODE_INPAINT_INSERTION = "EDIT_MODE_INPAINT_INSERTION", EDIT_MODE_OUTPAINT = "EDIT_MODE_OUTPAINT", EDIT_MODE_CONTROLLED_EDITING = "EDIT_MODE_CONTROLLED_EDITING", EDIT_MODE_STYLE = "EDIT_MODE_STYLE", EDIT_MODE_BGSWAP = "EDIT_MODE_BGSWAP", EDIT_MODE_PRODUCT_IMAGE = "EDIT_MODE_PRODUCT_IMAGE" } /** Parameters for the embed_content method. */ export declare interface EmbedContentBatch { /** The content to embed. Only the `parts.text` fields will be counted. */ contents?: ContentListUnion; /** Configuration that contains optional parameters. */ config?: EmbedContentConfig; } /** Optional parameters for the embed_content method. */ export declare interface EmbedContentConfig { /** Used to override HTTP request options. */ httpOptions?: HttpOptions; /** Abort signal which can be used to cancel the request. NOTE: AbortSignal is a client-only operation. Using it to cancel an operation will not cancel the request in the service. You will still be charged usage for any applicable operations. */ abortSignal?: AbortSignal; /** Type of task for which the embedding will be used. */ taskType?: string; /** Title for the text. Only applicable when TaskType is `RETRIEVAL_DOCUMENT`. */ title?: string; /** Reduced dimension for the output embedding. If set, excessive values in the output embedding are truncated from the end. Supported by newer models since 2024 only. You cannot set this value if using the earlier model (`models/embedding-001`). */ outputDimensionality?: number; /** Gemini platform only. The MIME type of the input. */ mimeType?: string; /** Gemini platform only. Whether to silently truncate inputs longer than the max sequence length. If this option is set to false, oversized inputs will lead to an INVALID_ARGUMENT error, similar to other text APIs. */ autoTruncate?: boolean; /** Gemini platform only. Whether to enable OCR for document content. Only applicable to Gemini Embedding 2 models. */ documentOcr?: boolean; /** Gemini platform only. Whether to extract audio from video content. Only applicable to Gemini Embedding 2 models. */ audioTrackExtraction?: boolean; } /** Request-level metadata for the Gemini platform Embed Content API. */ export declare interface EmbedContentMetadata { /** Gemini platform only. The total number of billable characters included in the request. */ billableCharacterCount?: number; } /** Parameters for the embed_content method. */ export declare interface EmbedContentParameters { /** ID of the model to use. For a list of models, see `Google models `_. */ model: string; /** The content to embed. Only the `parts.text` fields will be counted. */ contents: ContentListUnion; /** Configuration that contains optional parameters. */ config?: EmbedContentConfig; } /** Parameters for the _embed_content method. */ export declare interface EmbedContentParametersPrivate { /** ID of the model to use. For a list of models, see `Google models `_. */ model: string; /** The content to embed. Only the `parts.text` fields will be counted. */ contents?: ContentListUnion; /** The single content to embed. Only the `parts.text` fields will be counted. */ content?: ContentUnion; /** The Gemini platform embedding API to use. */ embeddingApiType?: EmbeddingApiType; /** The multiple contents to embed. */ batchContents?: ContentListUnion; /** Configuration that contains optional parameters. */ config?: EmbedContentConfig; } /** Response for the embed_content method. */ export declare class EmbedContentResponse { /** Used to retain the full HTTP response. */ sdkHttpResponse?: HttpResponse; /** The embeddings for each request, in the same order as provided in the batch request. */ embeddings?: ContentEmbedding[]; /** Gemini platform only. Metadata about the request. */ metadata?: EmbedContentMetadata; /** Whether the input content was truncated before generating the embedding. This field is not supported in Gemini API. */ truncated?: boolean; /** Usage metadata about the response(s). */ usageMetadata?: UsageMetadata; } /** Enum representing the Gemini platform embedding API to use. */ export declare enum EmbeddingApiType { /** * predict API endpoint (default) */ PREDICT = "PREDICT", /** * embedContent API Endpoint */ EMBED_CONTENT = "EMBED_CONTENT", /** * batchEmbedContents API Endpoint */ BATCH_EMBED_CONTENTS = "BATCH_EMBED_CONTENTS" } export declare interface EmbeddingsBatchJobSource { /** The Gemini Developer API's file resource name of the input data (e.g. "files/12345"). */ fileName?: string; /** The Gemini Developer API's inlined input data to run batch job. */ inlinedRequests?: EmbedContentBatch; } /** * @license * Copyright 2026 Google LLC * SPDX-License-Identifier: Apache-2.0 * * g3-prettier-ignore-file */ /** * A generic empty message that you can re-use to avoid defining duplicated * * @remarks * empty messages in your APIs. A typical example is to use it as the request * or the response type of an API method. For instance: * * service Foo { * rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); * } */ declare type Empty = {}; /** Represents a customer-managed encryption key specification that can be applied to a Vertex AI resource. This data type is not supported in Gemini API. */ export declare interface EncryptionSpec { /** Required. Resource name of the Cloud KMS key used to protect the resource. The Cloud KMS key must be in the same region as the resource. It must have the format `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}`. */ kmsKeyName?: string; } /** An endpoint where you deploy models. */ export declare interface Endpoint { /** Resource name of the endpoint. */ name?: string; /** ID of the model that's deployed to the endpoint. */ deployedModelId?: string; } /** End of speech sensitivity. */ export declare enum EndSensitivity { /** * The default is END_SENSITIVITY_LOW for Gemini platform and END_SENSITIVITY_HIGH for Gemini Live. */ END_SENSITIVITY_UNSPECIFIED = "END_SENSITIVITY_UNSPECIFIED", /** * Automatic detection ends speech more often. */ END_SENSITIVITY_HIGH = "END_SENSITIVITY_HIGH", /** * Automatic detection ends speech less often. */ END_SENSITIVITY_LOW = "END_SENSITIVITY_LOW" } /** Tool to search public web data, powered by Vertex AI Search and Sec4 compliance. This data type is not supported in Gemini API. */ export declare interface EnterpriseWebSearch { /** Optional. Sites with confidence level chosen & above this value will be blocked from the search results. */ blockingConfidence?: PhishBlockThreshold; /** Optional. List of domains to be excluded from the search results. The default limit is 2000 domains. */ excludeDomains?: string[]; } /** An entity representing the segmented area. */ export declare interface EntityLabel { /** The label of the segmented entity. */ label?: string; /** The confidence score of the detected label. */ score?: number; } declare type Env = EnvVar | string; declare type Env_2 = interactions.EnvVar | string; declare type Environment$ = Environment_3; declare type Environment$2 = Environment_2; /** The target environment where the computer use tool operates. */ export declare enum Environment { /** * The environment is unspecified. */ ENVIRONMENT_UNSPECIFIED = "ENVIRONMENT_UNSPECIFIED", /** * The tool operates in a web browser. */ ENVIRONMENT_BROWSER = "ENVIRONMENT_BROWSER", /** * The tool operates in a mobile environment. */ ENVIRONMENT_MOBILE = "ENVIRONMENT_MOBILE", /** * The tool operates in a desktop environment. */ ENVIRONMENT_DESKTOP = "ENVIRONMENT_DESKTOP" } /** * Configuration for a custom environment. */ declare type Environment_2 = { /** * Optional. Arbitrary customer-defined JSON configuration passed through * * @remarks * to the self-hosted environment poller. Only supported when `mode` is * `SELF_HOSTED`. */ custom_config?: { [k: string]: any; } | undefined; /** * Environment variables to set in the sandbox environment. */ env?: { [k: string]: EnvVar | string; } | undefined; /** * Optional. The environment ID for the interaction. If specified, the request will * * @remarks * update the existing environment instead of creating a new one; * creation-only fields (`env` and `sources`) cannot be updated when resuming * an existing environment. */ environment_id?: string | undefined; /** * The compute lifecycle mode for an environment. */ mode?: EnvironmentMode | undefined; /** * Network configuration for the environment. */ network?: EnvironmentNetworkEgressAllowlist | NetworkEnum | undefined; sources?: Array | undefined; type: "remote"; }; /** * An execution environment for an agent. */ declare type Environment_3 = { /** * Output only. The time at which the environment was created in ISO 8601 format * * @remarks * (YYYY-MM-DDThh:mm:ssZ). */ created?: string | undefined; /** * Output only. Arbitrary customer-defined JSON configuration passed through to the * * @remarks * self-hosted environment poller. Only populated for `self_hosted` * environments when configured. */ custom_config?: { [k: string]: any; } | undefined; /** * Output only. Secret token generated upon environment creation for self_hosted * * @remarks * environments. Used by the self-hosted sandbox daemon to authenticate * polling and streaming requests. Only returned when the environment is * created; omitted when getting or listing environments later. */ environment_key?: string | undefined; /** * Output only. The number of files in the environment, output only. */ file_count?: string | undefined; /** * Required. Output only. The ID of the environment. */ id: string; /** * Output only. The time at which the environment was last accessed in ISO 8601 format * * @remarks * (YYYY-MM-DDThh:mm:ssZ). */ last_accessed?: string | undefined; /** * The compute lifecycle mode for an environment. */ mode?: interactions.EnvironmentMode | undefined; /** * Network configuration for the environment. */ network?: interactions.EnvironmentNetworkEgressAllowlist | EnvironmentNetworkEnum | undefined; /** * Output only. The total size of the environment files in bytes, output only. */ size_bytes?: string | undefined; /** * Sources to be mounted into the environment. */ sources?: Array | undefined; /** * Output only. The status of the environment container. */ status?: Status_3 | undefined; /** * Output only. The time at which the environment was last updated in ISO 8601 format * * @remarks * (YYYY-MM-DDThh:mm:ssZ). */ updated?: string | undefined; }; declare type EnvironmentDeleteResponse$ = Empty; /** * The environment being operated. */ declare type EnvironmentEnum = "browser" | "mobile" | "desktop" | (string & {}); declare type EnvironmentFile$ = EnvironmentFile; /** * Metadata for a file or directory within an environment. */ declare type EnvironmentFile = { /** * Output only. The creation time of the file/directory. */ created?: string | undefined; /** * Output only. The MIME type of the file (e.g., "text/python", "image/png"). * * @remarks * Empty for directories. * NOLINT */ mime_type?: string | undefined; /** * Output only. The modification time of the file/directory. */ modified?: string | undefined; /** * Output only. The name of the file or directory (e.g., "main.py" or "src"). */ name?: string | undefined; /** * Output only. The full relative path within the environment * * @remarks * (e.g., "workspace/src/main.py"). */ path?: string | undefined; /** * Output only. The size of the file/directory in bytes. * * @remarks * NOLINT */ size_bytes?: string | undefined; /** * Output only. The type of the entry. */ type?: Type_3 | undefined; }; declare type EnvironmentListResponse$ = ListEnvironmentsResponse; declare type EnvironmentMode$ = EnvironmentMode; declare type EnvironmentMode$2 = EnvironmentMode; /** * @license * Copyright 2026 Google LLC * SPDX-License-Identifier: Apache-2.0 * * g3-prettier-ignore-file */ /** * The compute lifecycle mode for an environment. */ declare type EnvironmentMode = "on_demand" | "self_hosted" | (string & {}); declare type EnvironmentNetworkEgressAllowlist$ = EnvironmentNetworkEgressAllowlist; /** * Network egress configuration for the environment. */ declare type EnvironmentNetworkEgressAllowlist = { /** * List of allowed domains and their configurations. Set to `"disabled"` * * @remarks * to block all network egress. */ allowlist?: Array | Disabled | undefined; }; declare type EnvironmentNetworkEnum = "disabled" | (string & {}); /** * Network configuration for the environment. */ declare type EnvironmentNetworkUnion = interactions.EnvironmentNetworkEgressAllowlist | EnvironmentNetworkEnum; export declare namespace Environments { export type CreateEnvironmentRequest = CreateEnvironmentRequest$; export type Environment = Environment$; export type EnvironmentDeleteResponse = EnvironmentDeleteResponse$; export type EnvironmentFile = EnvironmentFile$; export type EnvironmentListResponse = EnvironmentListResponse$; export type EnvironmentMode = EnvironmentMode$; export type GetEnvironmentFilesResponse = GetEnvironmentFilesResponse$; export type ListEnvironmentsResponse = ListEnvironmentsResponse$; } declare namespace environments { export { Env_2 as Env, CreateEnvironmentRequestNetworkEnum, CreateEnvironmentRequestNetworkUnion, CreateEnvironmentRequest, Type_3 as Type, EnvironmentFile, EnvironmentNetworkEnum, EnvironmentNetworkUnion, Status_3 as Status, Environment_3 as Environment, GetEnvironmentFilesResponse, ListEnvironmentsResponse } } declare class Environments_2 extends ClientSDK { private _internal?; get internal(): Internal; private _files?; get files(): Files_2; /** * Lists environments. */ listEnvironments(params?: ListEnvironmentsParams_2, options?: Omit): APIPromise; /** * Creates an environment. */ createEnvironment(body: environments.CreateEnvironmentRequest, api_version?: string | undefined, options?: RequestOptions): APIPromise; /** * Deletes an environment. */ deleteEnvironment(id: string, params?: DeleteEnvironmentParams, options?: Omit): APIPromise; /** * Gets an environment. */ getEnvironment(id: string, params?: GetEnvironmentParams, options?: Omit): APIPromise; } declare type EnvironmentVariableConfig$ = EnvironmentVariableConfig; /** * Configuration for environment variable credentials. */ declare type EnvironmentVariableConfig = { id: string; /** * Required. Locations where the environment variable can be injected in * * @remarks * outgoing HTTP requests. Must contain at least one location. * Accepts either a single location (e.g. "header") or an array of locations. */ injection_location: InjectionLocationEnum | Array; /** * Optional. List of domains allowed to receive this environment variable * * @remarks * value in HTTP requests. */ trusted_domains?: Array | undefined; type: "environment_variable"; /** * Required. Input only. Secret value of the environment variable. Write-only; never * * @remarks * returned in responses. */ value: string; }; /** * Required. Locations where the environment variable can be injected in * * @remarks * outgoing HTTP requests. Must contain at least one location. * Accepts either a single location (e.g. "header") or an array of locations. */ declare type EnvironmentVariableConfigInjectionLocation = InjectionLocationEnum | Array; declare type EnvironmentVariableConfigParams = Omit & EnvironmentVariableConfig; declare type EnvironmentVariableUpdateConfig$ = EnvironmentVariableUpdateConfig; /** * Configuration for updating environment variable credentials. */ declare type EnvironmentVariableUpdateConfig = { /** * Optional. Locations where the environment variable can be injected in * * @remarks * outgoing HTTP requests. * Accepts either a single location (e.g. "header") or an array of locations. */ injection_location?: InjectionLocationEnum | Array | undefined; /** * Optional. List of domains allowed to receive this environment variable * * @remarks * value in HTTP requests. */ trusted_domains?: Array | undefined; type: "environment_variable"; /** * Optional. Input only. Secret value of the environment variable. Write-only; never * * @remarks * returned in responses. */ value?: string | undefined; }; /** * Optional. Locations where the environment variable can be injected in * * @remarks * outgoing HTTP requests. * Accepts either a single location (e.g. "header") or an array of locations. */ declare type EnvironmentVariableUpdateConfigInjectionLocation = InjectionLocationEnum | Array; declare type EnvironmentVariableUpdateConfigParams = Omit & EnvironmentVariableUpdateConfig; declare type EnvVar$ = EnvVar; /** * @license * Copyright 2026 Google LLC * SPDX-License-Identifier: Apache-2.0 * * g3-prettier-ignore-file */ /** * An environment variable to set in the execution environment. */ declare type EnvVar = { /** * Optional reference to a server-managed Credential resource by ID. */ credential?: string | undefined; /** * Direct string value for plain environment variables. */ value?: string | undefined; }; declare type Error$ = ErrorT; declare type Error$2 = ErrorT; declare type ErrorEvent$ = ErrorEvent_2; declare type ErrorEvent_2 = { /** * Error message from an interaction. */ error?: ErrorT | undefined; /** * The event_id token to be used to resume the interaction stream, from * * @remarks * this event. */ event_id?: string | undefined; event_type: "error"; }; export { ErrorEvent_2 as ErrorEvent } /** * @license * Copyright 2026 Google LLC * SPDX-License-Identifier: Apache-2.0 * * g3-prettier-ignore-file */ /** * Error message from an interaction. */ declare type ErrorT = { /** * A URI that identifies the error type. */ code?: string | undefined; /** * A human-readable error message. */ message?: string | undefined; }; /** The results from an evaluation run performed by the EvaluationService. This data type is not supported in Gemini API. */ export declare class EvaluateDatasetResponse { /** Output only. Aggregation statistics derived from results of EvaluationService. */ aggregationOutput?: AggregationOutput; /** Output only. Output info for EvaluationService. */ outputInfo?: OutputInfo; } /** Evaluate Dataset Run Result for Tuning Job. This data type is not supported in Gemini API. */ export declare interface EvaluateDatasetRun { /** Output only. The checkpoint id used in the evaluation run. Only populated when evaluating checkpoints. */ checkpointId?: string; /** Output only. The error of the evaluation run if any. */ error?: GoogleRpcStatus; /** Output only. Results for EvaluationService. */ evaluateDatasetResponse?: EvaluateDatasetResponse; /** Output only. The resource name of the evaluation run. Format: `projects/{project}/locations/{location}/evaluationRuns/{evaluation_run_id}`. */ evaluationRun?: string; /** Output only. Deprecated: The updated architecture uses evaluation_run instead. */ operationName?: string; } /** The dataset used for evaluation. This data type is not supported in Gemini API. */ export declare interface EvaluationDataset { /** BigQuery source holds the dataset. */ bigquerySource?: BigQuerySource; /** Cloud storage source holds the dataset. Currently only one Cloud Storage file path is supported. */ gcsSource?: GcsSource; } /** * @license * Copyright 2026 Google LLC * SPDX-License-Identifier: Apache-2.0 * * g3-prettier-ignore-file */ /** * Used to specify configuration for ExaAISearch. */ declare type ExaAISearchConfig = { /** * Required. The API key for ExaAiSearch. */ api_key: string; /** * Optional. This field can be used to pass any parameter from the Exa.ai Search API. */ custom_config?: { [k: string]: any; } | undefined; }; /** Exact match metric value for an instance. This data type is not supported in Gemini API. */ export declare interface ExactMatchMetricValue { /** Output only. Exact match score. */ score?: number; } /** 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. */ export declare interface ExecutableCode { /** Required. The code to be executed. */ code?: string; /** Required. Programming language of the `code`. */ language?: Language; /** Optional. Unique identifier of the `ExecutableCode` part. The server returns the `CodeExecutionResult` with the matching `id`. */ id?: string; } /** * @license * Copyright 2026 Google LLC * SPDX-License-Identifier: Apache-2.0 * * g3-prettier-ignore-file */ /** * The execution mode of the tool search. */ declare type Execution = "server" | "client" | (string & {}); /** Retrieve from data source powered by external API for grounding. The external API is not owned by Google, but need to follow the pre-defined API spec. This data type is not supported in Gemini API. */ export declare interface ExternalApi { /** The authentication config to access the API. Deprecated. Please use auth_config instead. */ apiAuth?: ApiAuth; /** The API spec that the external API implements. */ apiSpec?: ApiSpec; /** The authentication config to access the API. */ authConfig?: AuthConfig; /** Parameters for the elastic search API. */ elasticSearchParams?: ExternalApiElasticSearchParams; /** The endpoint of the external API. The system will call the API at this endpoint to retrieve the data for grounding. Example: https://acme.com:443/search */ endpoint?: string; /** Parameters for the simple search API. */ simpleSearchParams?: ExternalApiSimpleSearchParams; } /** The search parameters to use for the ELASTIC_SEARCH spec. This data type is not supported in Gemini API. */ export declare interface ExternalApiElasticSearchParams { /** The ElasticSearch index to use. */ index?: string; /** Optional. Number of hits (chunks) to request. When specified, it is passed to Elasticsearch as the `num_hits` param. */ numHits?: number; /** The ElasticSearch search template to use. */ searchTemplate?: string; } /** The search parameters to use for SIMPLE_SEARCH spec. This data type is not supported in Gemini API. */ export declare interface ExternalApiSimpleSearchParams { } /** Options for feature selection preference. */ export declare enum FeatureSelectionPreference { FEATURE_SELECTION_PREFERENCE_UNSPECIFIED = "FEATURE_SELECTION_PREFERENCE_UNSPECIFIED", PRIORITIZE_QUALITY = "PRIORITIZE_QUALITY", BALANCED = "BALANCED", PRIORITIZE_COST = "PRIORITIZE_COST" } /** A custom fetch function type matching the standard fetch signature. */ export declare type Fetch = (input: RequestInfo | URL, init?: RequestInit) => Promise; /** * @license * Copyright 2026 Google LLC * SPDX-License-Identifier: Apache-2.0 * * g3-prettier-ignore-file */ declare type Fetcher = (input: RequestInfo | URL, init?: RequestInit) => Promise; export declare interface FetchPredictOperationConfig { /** Used to override HTTP request options. */ httpOptions?: HttpOptions; /** Abort signal which can be used to cancel the request. NOTE: AbortSignal is a client-only operation. Using it to cancel an operation will not cancel the request in the service. You will still be charged usage for any applicable operations. */ abortSignal?: AbortSignal; } /** Parameters for the fetchPredictOperation method. */ export declare interface FetchPredictOperationParameters { /** The server-assigned name for the operation. */ operationName: string; resourceName: string; /** Used to override the default configuration. */ config?: FetchPredictOperationConfig; } /** A file uploaded to the API. */ declare interface File_2 { /** 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` */ name?: string; /** Optional. The human-readable display name for the `File`. The display name must be no more than 512 characters in length, including spaces. Example: 'Welcome Image' */ displayName?: string; /** Output only. MIME type of the file. */ mimeType?: string; /** Output only. Size of the file in bytes. */ sizeBytes?: string; /** Output only. The timestamp of when the `File` was created. */ createTime?: string; /** Output only. The timestamp of when the `File` will be deleted. Only set if the `File` is scheduled to expire. */ expirationTime?: string; /** Output only. The timestamp of when the `File` was last updated. */ updateTime?: string; /** Output only. SHA-256 hash of the uploaded bytes. The hash value is encoded in base64 format. */ sha256Hash?: string; /** Output only. The URI of the `File`. */ uri?: string; /** Output only. The URI of the `File`, only set for downloadable (generated) files. */ downloadUri?: string; /** Output only. Processing state of the File. */ state?: FileState; /** Output only. The source of the `File`. */ source?: FileSource; /** Output only. Metadata for a video. */ videoMetadata?: Record; /** Output only. Error status if File processing failed. */ error?: FileStatus; } export { File_2 as File } declare type FileCitation$ = FileCitation; /** * @license * Copyright 2026 Google LLC * SPDX-License-Identifier: Apache-2.0 * * g3-prettier-ignore-file */ /** * A file citation annotation. */ declare type FileCitation = { /** * User provided metadata about the retrieved context. */ custom_metadata?: { [k: string]: any; } | undefined; /** * The URI of the file. */ document_uri?: string | undefined; /** * End of the attributed segment, exclusive. */ end_index?: number | undefined; /** * The name of the file. */ file_name?: string | undefined; /** * Media ID in-case of image citations, if applicable. */ media_id?: string | undefined; /** * Page number of the cited document, if applicable. */ page_number?: number | undefined; /** * Source attributed for a portion of the text. */ source?: string | undefined; /** * Start of segment of the response that is attributed to this source. * * @remarks * * Index indicates the start of the segment, measured in bytes. */ start_index?: number | undefined; type: "file_citation"; }; /** * @license * Copyright 2026 Google LLC * SPDX-License-Identifier: Apache-2.0 * * g3-prettier-ignore-file */ /** * Content of a single file in the codebase. */ declare type FileContent = { /** * The UTF-8 encoded text content of the file. */ content?: string | undefined; /** * The relative path of the file from the project root. */ path?: string | undefined; }; /** URI-based data. A FileData message contains a URI pointing to data of a specific media type. It is used to represent images, audio, and video stored in Google Cloud Storage. */ export declare interface FileData { /** Optional. The display name of the file. Used to provide a label or filename to distinguish files. This field is only returned in `PromptMessage` for prompt management. It is used in the Gemini calls only when server side tools (`code_execution`, `google_search`, and `url_context`) are enabled. */ displayName?: string; /** Required. The URI of the file in Google Cloud Storage. */ fileUri?: string; /** Required. The IANA standard MIME type of the source data. */ mimeType?: string; } export declare class Files extends BaseModule { private readonly apiClient; constructor(apiClient: ApiClient); /** * Lists files. * * @param params - The parameters for the list request. * @return - A pager of files. * * @example * ```ts * const files = await ai.files.list({config: {'pageSize': 2}}); * for await (const file of files) { * console.log(file); * } * ``` */ list: (params?: types.ListFilesParameters) => Promise>; /** * Uploads a file asynchronously to the Gemini API. * This method is not available in Gemini platform (previously known as Vertex AI). * Supported upload sources: * - Node.js: File path (string) or Blob object. * - Browser: Blob object (e.g., File). * * @remarks * The `mimeType` can be specified in the `config` parameter. If omitted: * - For file path (string) inputs, the `mimeType` will be inferred from the * file extension. * - For Blob object inputs, the `mimeType` will be set to the Blob's `type` * property. * Some examples for file extension to mimeType mapping: * .txt -> text/plain * .json -> application/json * .jpg -> image/jpeg * .png -> image/png * .mp3 -> audio/mpeg * .mp4 -> video/mp4 * * This section can contain multiple paragraphs and code examples. * * @param params - Optional parameters specified in the * `types.UploadFileParameters` interface. * @see {@link types.UploadFileParameters#config} for the optional * config in the parameters. * @return A promise that resolves to a `types.File` object. * @throws An error if called on a Gemini platform (previously known as Vertex AI) client. * @throws An error if the `mimeType` is not provided and can not be inferred, * the `mimeType` can be provided in the `params.config` parameter. * @throws An error occurs if a suitable upload location cannot be established. * * @example * The following code uploads a file to Gemini API. * * ```ts * const file = await ai.files.upload({file: 'file.txt', config: { * mimeType: 'text/plain', * }}); * console.log(file.name); * ``` */ upload(params: types.UploadFileParameters): Promise; /** * Downloads a remotely stored file asynchronously to a location specified in * the `params` object. This method only works on Node environment, to * download files in the browser, use a browser compliant method like an * tag. * * @param params - The parameters for the download request. * * @example * The following code downloads an example file named "files/mehozpxf877d" as * "file.txt". * * ```ts * await ai.files.download({file: file.name, downloadPath: 'file.txt'}); * ``` */ download(params: types.DownloadFileParameters): Promise; /** * Registers Google Cloud Storage files for use with the API. * This method is only available in Node.js environments. */ registerFiles(params: types.RegisterFilesParameters): Promise; protected _registerFiles(params: types.InternalRegisterFilesParameters): Promise; private listInternal; private createInternal; /** * Retrieves the file information from the service. * * @param params - The parameters for the get request * @return The Promise that resolves to the types.File object requested. * * @example * ```ts * const config: GetFileParameters = { * name: fileName, * }; * file = await ai.files.get(config); * console.log(file.name); * ``` */ get(params: types.GetFileParameters): Promise; /** * Deletes a remotely stored file. * * @param params - The parameters for the delete request. * @return The DeleteFileResponse, the response for the delete method. * * @example * The following code deletes an example file named "files/mehozpxf877d". * * ```ts * await ai.files.delete({name: file.name}); * ``` */ delete(params: types.DeleteFileParameters): Promise; private registerFilesInternal; } declare class Files_2 extends ClientSDK { /** * Retrieves file metadata or directory contents from an environment's snapshot. To download file content, use the download URL returned in the response. */ list(environment: string, path: string, params?: GetEnvironmentFilesParams, options?: Omit): APIPromise; } declare type FileSearch$ = FileSearch_2; declare type FileSearch$2 = FileSearch_2; /** The FileSearch tool that retrieves knowledge from Semantic Retrieval corpora. Files are imported to Semantic Retrieval corpora using the ImportFile API. This data type is not supported in Vertex AI. */ export declare interface FileSearch { /** Required. The names of the file_search_stores to retrieve from. Example: `fileSearchStores/my-file-search-store-123` */ fileSearchStoreNames?: string[]; /** Optional. Metadata filter to apply to the semantic retrieval documents and chunks. */ metadataFilter?: string; /** Optional. The number of semantic retrieval chunks to retrieve. */ topK?: number; } /** * @license * Copyright 2026 Google LLC * SPDX-License-Identifier: Apache-2.0 * * g3-prettier-ignore-file */ /** * A tool that can be used by the model to search files. */ declare type FileSearch_2 = { /** * The file search store names to search. */ file_search_store_names?: Array | undefined; /** * Metadata filter to apply to the semantic retrieval documents and chunks. */ metadata_filter?: string | undefined; /** * The number of semantic retrieval chunks to retrieve. */ top_k?: number | undefined; type: "file_search"; }; declare type FileSearchCall$ = FileSearchCallDelta; /** * @license * Copyright 2026 Google LLC * SPDX-License-Identifier: Apache-2.0 * * g3-prettier-ignore-file */ declare type FileSearchCallDelta = { /** * A signature hash for backend validation. */ signature?: string | undefined; type: "file_search_call"; }; declare type FileSearchCallStep$ = FileSearchCallStep; /** * @license * Copyright 2026 Google LLC * SPDX-License-Identifier: Apache-2.0 * * g3-prettier-ignore-file */ /** * File Search call step. */ declare type FileSearchCallStep = { /** * Required. A unique ID for this specific tool call. */ id: string; /** * A signature hash for backend validation. */ signature?: string | undefined; type: "file_search_call"; }; declare type FileSearchResult$ = FileSearchResultDelta; /** * @license * Copyright 2026 Google LLC * SPDX-License-Identifier: Apache-2.0 * * g3-prettier-ignore-file */ /** * The result of the File Search. */ declare type FileSearchResult = {}; declare type FileSearchResultDelta = { result: Array; /** * A signature hash for backend validation. */ signature?: string | undefined; type: "file_search_result"; }; declare type FileSearchResultStep$ = FileSearchResultStep; /** * @license * Copyright 2026 Google LLC * SPDX-License-Identifier: Apache-2.0 * * g3-prettier-ignore-file */ /** * File Search result step. */ declare type FileSearchResultStep = { /** * Required. ID to match the ID from the function call block. */ call_id: string; /** * A signature hash for backend validation. */ signature?: string | undefined; type: "file_search_result"; }; /** A collection of Documents. */ export declare interface FileSearchStore { /** The embedding model used by the FileSearchStore. */ embeddingModel?: string; /** Output only. The number of documents in the `FileSearchStore` that are active and ready for retrieval. */ activeDocumentsCount?: string; /** Output only. The Timestamp of when the `FileSearchStore` was created. */ createTime?: string; /** Optional. The human-readable display name for the `FileSearchStore`. The display name must be no more than 512 characters in length, including spaces. Example: "Docs on Semantic Retriever". */ displayName?: string; /** Output only. The number of documents in the `FileSearchStore` that have failed processing. */ failedDocumentsCount?: string; /** Output only. Immutable. Identifier. The `FileSearchStore` resource name. It is an ID (name excluding the "fileSearchStores/" prefix) that can contain up to 40 characters that are lowercase alphanumeric or dashes (-). It is output only. The unique name will be derived from `display_name` along with a 12 character random suffix. Example: `fileSearchStores/my-awesome-file-search-store-123a456b789c` If `display_name` is not provided, the name will be randomly generated. */ name?: string; /** Output only. The number of documents in the `FileSearchStore` that are being processed. */ pendingDocumentsCount?: string; /** Output only. The size of raw bytes ingested into the `FileSearchStore`. This is the total size of all the documents in the `FileSearchStore`. */ sizeBytes?: string; /** Output only. The Timestamp of when the `FileSearchStore` was last updated. */ updateTime?: string; } declare class FileSearchStores extends BaseModule { private readonly apiClient; readonly documents: Documents; constructor(apiClient: ApiClient, documents?: Documents); /** * Lists file search stores. * * @param params - The parameters for the list request. * @return - A pager of file search stores. * * @example * ```ts * const fileSearchStores = await ai.fileSearchStores.list({config: {'pageSize': 2}}); * for await (const fileSearchStore of fileSearchStores) { * console.log(fileSearchStore); * } * ``` */ list: (params?: types.ListFileSearchStoresParameters) => Promise>; /** * Uploads a file asynchronously to a given File Search Store. * This method is not available in Gemini platform (previously known as Vertex AI). * Supported upload sources: * - Node.js: File path (string) or Blob object. * - Browser: Blob object (e.g., File). * * @remarks * The `mimeType` can be specified in the `config` parameter. If omitted: * - For file path (string) inputs, the `mimeType` will be inferred from the * file extension. * - For Blob object inputs, the `mimeType` will be set to the Blob's `type` * property. * * This section can contain multiple paragraphs and code examples. * * @param params - Optional parameters specified in the * `types.UploadToFileSearchStoreParameters` interface. * @see {@link types.UploadToFileSearchStoreParameters#config} for the optional * config in the parameters. * @return A promise that resolves to a long running operation. * @throws An error if called on a Gemini platform (previously known as Vertex AI) client. * @throws An error if the `mimeType` is not provided and can not be inferred, * the `mimeType` can be provided in the `params.config` parameter. * @throws An error occurs if a suitable upload location cannot be established. * * @example * The following code uploads a file to a given file search store. * * ```ts * const operation = await ai.fileSearchStores.upload({fileSearchStoreName: 'fileSearchStores/foo-bar', file: 'file.txt', config: { * mimeType: 'text/plain', * }}); * console.log(operation.name); * ``` */ uploadToFileSearchStore(params: types.UploadToFileSearchStoreParameters): Promise; /** * Downloads media using a Media ID or URI. * This method is only supported in the Gemini Developer client. * * @param uri - The URI or Media ID of the blob. * @param config - Optional configuration for the download. * @returns A promise that resolves to the blob data as a Uint8Array. */ downloadMedia(uri: string, config?: types.DownloadMediaConfig): Promise; /** * Creates a File Search Store. * * @param params - The parameters for creating a File Search Store. * @return FileSearchStore. */ create(params: types.CreateFileSearchStoreParameters): Promise; /** * Gets a File Search Store. * * @param params - The parameters for getting a File Search Store. * @return FileSearchStore. */ get(params: types.GetFileSearchStoreParameters): Promise; /** * Deletes a File Search Store. * * @param params - The parameters for deleting a File Search Store. */ delete(params: types.DeleteFileSearchStoreParameters): Promise; private listInternal; private uploadToFileSearchStoreInternal; /** * Imports a File from File Service to a FileSearchStore. * * This is a long-running operation, see aip.dev/151 * * @param params - The parameters for importing a file to a file search store. * @return ImportFileOperation. */ importFile(params: types.ImportFileParameters): Promise; } /** Source of the File. */ export declare enum FileSource { SOURCE_UNSPECIFIED = "SOURCE_UNSPECIFIED", UPLOADED = "UPLOADED", GENERATED = "GENERATED", REGISTERED = "REGISTERED" } /** * Represents the size and mimeType of a file. The information is used to * request the upload URL from the https://generativelanguage.googleapis.com/upload/{api_version}/files endpoint. * This interface defines the structure for constructing and executing HTTP * requests. */ declare interface FileStat { /** * The size of the file in bytes. */ size: number; /** * The MIME type of the file. */ type: string | undefined; } /** State for the lifecycle of a File. */ export declare enum FileState { STATE_UNSPECIFIED = "STATE_UNSPECIFIED", PROCESSING = "PROCESSING", ACTIVE = "ACTIVE", FAILED = "FAILED" } /** Status of a File that uses a common error model. */ export declare interface FileStatus { /** A list of messages that carry the error details. There is a common set of message types for APIs to use. */ details?: Record[]; /** A list of messages that carry the error details. There is a common set of message types for APIs to use. */ message?: string; /** The status code. 0 for OK, 1 for CANCELLED */ code?: number; } /** * @license * Copyright 2026 Google LLC * SPDX-License-Identifier: Apache-2.0 * * g3-prettier-ignore-file */ /** * Config for filters. */ declare type Filter = { /** * Optional. String for metadata filtering. */ metadata_filter?: string | undefined; /** * Optional. Only returns contexts with vector distance smaller than the * * @remarks * threshold. */ vector_distance_threshold?: number | undefined; /** * Optional. Only returns contexts with vector similarity larger than the * * @remarks * threshold. */ vector_similarity_threshold?: number | undefined; }; declare type FindRequest$ = FindRequest; /** * Request parameters specific to FIND sessions, used for discovering * * @remarks * vulnerabilities in a codebase. */ declare type FindRequest = { /** * Additional context or custom instructions provided by the user to guide * * @remarks * the vulnerability analysis. */ description?: string | undefined; /** * The identifier of a specific finding to verify. This is primarily used in * * @remarks * VERIFY mode to focus the agent's execution-based validation on a single * vulnerability. */ finding_id?: string | undefined; /** * The mode of the find session. */ mode?: Mode | undefined; /** * A list of source files to provide as context for the scan. */ source_files?: Array | undefined; }; /** Output only. The reason why the model stopped generating tokens. If empty, the model has not stopped generating. */ export declare enum FinishReason { /** * The finish reason is unspecified. */ FINISH_REASON_UNSPECIFIED = "FINISH_REASON_UNSPECIFIED", /** * The model reached a natural stopping point or a configured stop sequence. */ STOP = "STOP", /** * The model generated the maximum number of tokens allowed by the `max_output_tokens` parameter. */ MAX_TOKENS = "MAX_TOKENS", /** * The model stopped generating because the content potentially violates safety policies. NOTE: When streaming, the `content` field is empty if content filters block the output. */ SAFETY = "SAFETY", /** * The model stopped generating because the content may be a recitation from a source. */ RECITATION = "RECITATION", /** * The response candidate content was flagged for using an unsupported language. This enum value is not supported in Vertex AI. */ LANGUAGE = "LANGUAGE", /** * The model stopped generating for a reason not otherwise specified. */ OTHER = "OTHER", /** * The model stopped generating because the content contains a term from a configured blocklist. */ BLOCKLIST = "BLOCKLIST", /** * The model stopped generating because the content may be prohibited. */ PROHIBITED_CONTENT = "PROHIBITED_CONTENT", /** * The model stopped generating because the content may contain sensitive personally identifiable information (SPII). */ SPII = "SPII", /** * The model generated a function call that is syntactically invalid and can't be parsed. */ MALFORMED_FUNCTION_CALL = "MALFORMED_FUNCTION_CALL", /** * The generated image potentially violates safety policies. */ IMAGE_SAFETY = "IMAGE_SAFETY", /** * The generated image may contain prohibited content. */ IMAGE_PROHIBITED_CONTENT = "IMAGE_PROHIBITED_CONTENT", /** * The image generation stopped for a reason not otherwise specified. */ IMAGE_OTHER = "IMAGE_OTHER", /** * The model was expected to generate an image, but didn't. */ NO_IMAGE = "NO_IMAGE", /** * The generated image may be a recitation from a source. */ IMAGE_RECITATION = "IMAGE_RECITATION", /** * The model generated a function call that is semantically invalid. This can happen, for example, if function calling is not enabled or the generated function is not in the function declaration. */ UNEXPECTED_TOOL_CALL = "UNEXPECTED_TOOL_CALL", /** * The model made too many tool calls in a single request, so the server-side tool loop stopped before the model returned a final answer. */ TOO_MANY_TOOL_CALLS = "TOO_MANY_TOOL_CALLS", /** * Request has at least one thought signature missing. This enum value is not supported in Vertex AI. */ MISSING_THOUGHT_SIGNATURE = "MISSING_THOUGHT_SIGNATURE", /** * Finishes due to malformed response. */ MALFORMED_RESPONSE = "MALFORMED_RESPONSE", /** * Request was filtered by an escalation rule. This enum value is not supported in Vertex AI. */ ESCALATION = "ESCALATION", /** * Indicates that token generation stopped because the user account is limited or disabled due to Prohibited Use Policy (PUP) violations. This enum value is not supported in Vertex AI. */ PUP_LIMITED_DISABLED = "PUP_LIMITED_DISABLED", /** * Token generation was stopped because the response reached the per-request token limit, but generation is not yet complete. The model response can be continued via a subsequent request using the returned `continuation_token`. */ CONTINUATION = "CONTINUATION", /** * The model response was blocked by Model Armor. This enum value is not supported in Gemini API. */ MODEL_ARMOR = "MODEL_ARMOR" } declare type FixRequest$ = FixRequest; /** * Request parameters specific to FIX sessions, used for generating and * * @remarks * validating security patches. */ declare type FixRequest = { /** * Additional context or custom instructions provided by the user to guide * * @remarks * the patch generation process. */ description?: string | undefined; /** * The identifier of the specific security finding to be remediated. This ID * * @remarks * maps to a previously discovered vulnerability. */ finding_id?: string | undefined; /** * A list of source files providing context for the remediation. These files * * @remarks * are typically the ones containing the identified vulnerability. */ source_files?: Array | undefined; }; /** Tuning Spec for Full Fine Tuning. This data type is not supported in Gemini API. */ export declare interface FullFineTuningSpec { /** Optional. Hyperparameters for Full Fine Tuning. */ hyperParameters?: SupervisedHyperParameters; /** Required. Training dataset used for tuning. The dataset can be specified as either a Cloud Storage path to a JSONL file or as the resource name of a Vertex Multimodal Dataset. */ trainingDatasetUri?: string; /** Optional. Validation dataset used for tuning. The dataset can be specified as either a Cloud Storage path to a JSONL file or as the resource name of a Vertex Multimodal Dataset. */ validationDatasetUri?: string; } declare type Function$ = FunctionT; /** A predicted FunctionCall returned from the model that contains a string representing the FunctionDeclaration.name and a structured JSON object containing the parameters and their values. */ export declare interface FunctionCall { /** Optional. The function parameters and values in JSON object format. See FunctionDeclaration.parameters for parameter details. */ args?: Record; /** Optional. The unique id of the function call. If populated, the client to execute the `function_call` and return the response with the matching `id`. */ id?: string; /** Optional. The name of the function to call. Matches FunctionDeclaration.name. */ name?: string; /** Optional. The partial argument value of the function call. If provided, represents the arguments/fields that are streamed incrementally. This field is not supported in Gemini API. */ partialArgs?: PartialArg[]; /** Optional. Whether this is the last part of the FunctionCall. If true, another partial message for the current FunctionCall is expected to follow. This field is not supported in Gemini API. */ willContinue?: boolean; } /** Function calling config. */ export declare interface FunctionCallingConfig { /** Optional. Function names to call. Only set when the Mode is ANY. Function names should match FunctionDeclaration.name. With mode set to ANY, model will predict a function call from the set of function names provided. */ allowedFunctionNames?: string[]; /** Optional. Function calling mode. */ mode?: FunctionCallingConfigMode; /** Optional. When set to true, arguments of a single function call will be streamed out in multiple parts/contents/responses. Partial parameter results will be returned in the `FunctionCall.partial_args` field. This field is not supported in Gemini API. */ streamFunctionCallArguments?: boolean; } /** Function calling mode. */ export declare enum FunctionCallingConfigMode { /** * Unspecified function calling mode. This value should not be used. */ MODE_UNSPECIFIED = "MODE_UNSPECIFIED", /** * Default model behavior, model decides to predict either function calls or natural language response. */ AUTO = "AUTO", /** * Model is constrained to always predicting function calls only. If "allowed_function_names" are set, the predicted function calls will be limited to any one of "allowed_function_names", else the predicted function calls will be any one of the provided "function_declarations". */ ANY = "ANY", /** * Model will not predict any function calls. Model behavior is same as when not passing any function declarations. */ NONE = "NONE", /** * Model is constrained to predict either function calls or natural language response. If "allowed_function_names" are set, the predicted function calls will be limited to any one of "allowed_function_names", else the predicted function calls will be any one of the provided "function_declarations". */ VALIDATED = "VALIDATED" } declare type FunctionCallStep$ = FunctionCallStep; /** * @license * Copyright 2026 Google LLC * SPDX-License-Identifier: Apache-2.0 * * g3-prettier-ignore-file */ /** * A function tool call step. */ declare type FunctionCallStep = { /** * Required. The arguments to pass to the function. */ arguments: { [k: string]: any; }; /** * Required. A unique ID for this specific tool call. */ id: string; /** * Required. The name of the tool to call. */ name: string; type: "function_call"; }; /** Structured representation of a function declaration as defined by the [OpenAPI 3.0 specification](https://spec.openapis.org/oas/v3.0.3). Included in this declaration are the function name, description, parameters and response type. This FunctionDeclaration is a representation of a block of code that can be used as a `Tool` by the model and executed by the client. */ export declare interface FunctionDeclaration { /** Optional. Specifies the function Behavior. If not specified, the system keeps the current function call behavior. This field is currently only supported by the BidiGenerateContent method. */ behavior?: Behavior; /** Optional. Description and purpose of the function. Model uses it to decide how and whether to call the function. */ description?: string; /** Required. The name of the function to call. Must start with a letter or an underscore. Must be a-z, A-Z, 0-9, or contain underscores, dots, colons and dashes, with a maximum length of 128. */ name?: string; /** Optional. Describes the parameters to this function in JSON Schema Object format. Reflects the Open API 3.03 Parameter Object. string Key: the name of the parameter. Parameter names are case sensitive. Schema Value: the Schema defining the type used for the parameter. For function with no parameters, this can be left unset. Parameter names must start with a letter or an underscore and must only contain chars a-z, A-Z, 0-9, or underscores with a maximum length of 64. Example with 1 required and 1 optional parameter: type: OBJECT properties: param1: type: STRING param2: type: INTEGER required: - param1 */ parameters?: Schema; /** Optional. Describes the parameters to the function in JSON Schema format. The schema must describe an object where the properties are the parameters to the function. For example: ``` { "type": "object", "properties": { "name": { "type": "string" }, "age": { "type": "integer" } }, "additionalProperties": false, "required": ["name", "age"], "propertyOrdering": ["name", "age"] } ``` This field is mutually exclusive with `parameters`. */ parametersJsonSchema?: unknown; /** Optional. Describes the output from this function in JSON Schema format. Reflects the Open API 3.03 Response Object. The Schema defines the type used for the response value of the function. */ response?: Schema; /** Optional. Describes the output from this function in JSON Schema format. The value specified by the schema is the response value of the function. This field is mutually exclusive with `response`. */ responseJsonSchema?: unknown; } /** The result output from a FunctionCall that contains a string representing the FunctionDeclaration.name and a structured JSON object containing any output from the function is used as context to the model. This should contain the result of a `FunctionCall` made based on model prediction. */ export declare class FunctionResponse { /** Optional. The id of the function call this response is for. Populated by the client to match the corresponding function call `id`. */ id?: string; /** Required. The name of the function to call. Matches FunctionDeclaration.name and FunctionCall.name. */ name?: string; /** Optional. Ordered `Parts` that constitute a function response. Parts may have different IANA MIME types. */ parts?: FunctionResponsePart[]; /** Required. The function response in JSON object format. Use "output" key to specify function output and "error" key to specify error details (if any). If "output" and "error" keys are not specified, then whole "response" is treated as function output. */ response?: Record; /** Optional. Specifies how the response should be scheduled in the conversation. Only applicable to NON_BLOCKING function calls, is ignored otherwise. Defaults to WHEN_IDLE. */ scheduling?: FunctionResponseScheduling; /** Optional. Signals that function call continues, and more responses will be returned, turning the function call into a generator. Is only applicable to NON_BLOCKING function calls, is ignored otherwise. If set to false, future responses will not be considered. It is allowed to return empty `response` with `will_continue=False` to signal that the function call is finished. This may still trigger the model generation. To avoid triggering the generation and finish the function call, additionally set `scheduling` to `SILENT`. This field is not supported in Vertex AI. */ willContinue?: boolean; } /** Raw media bytes for function response. Text should not be sent as raw bytes, use the 'text' field. */ export declare class FunctionResponseBlob { /** Required. Raw bytes. * @remarks Encoded as base64 string. */ data?: string; /** Optional. Display name of the blob. Used to provide a label or filename to distinguish blobs, and to reference the blob from `FunctionResponse.response` (for example, via `{"$ref": ""}`). */ displayName?: string; /** Required. The IANA standard MIME type of the source data. */ mimeType?: string; } /** URI based data for function response. */ export declare class FunctionResponseFileData { /** Optional. Display name of the file. Used to provide a label or filename to distinguish file data, and to reference the file from `FunctionResponse.response` (for example, via `{"$ref": ""}`). */ displayName?: string; /** Required. URI. */ fileUri?: string; /** Required. The IANA standard MIME type of the source data. */ mimeType?: string; } /** A datatype containing media that is part of a `FunctionResponse` message. A `FunctionResponsePart` consists of data which has an associated datatype. A `FunctionResponsePart` can only contain one of the accepted types in `FunctionResponsePart.data`. A `FunctionResponsePart` must have a fixed IANA MIME type identifying the type and subtype of the media if the `inline_data` field is filled with raw bytes. */ export declare class FunctionResponsePart { /** URI based data. */ fileData?: FunctionResponseFileData; /** Inline media bytes. */ inlineData?: FunctionResponseBlob; /** Optional. Processes this part's media for understanding. Only meaningful for video parts (`inline_data` or `file_data` with video mime). Non-video parts ignore this field. */ mediaProcessing?: MediaProcessing; /** Media resolution for the input media. */ mediaResolution?: PartMediaResolution; /** Video metadata. The metadata should only be specified while the video data is presented in inline_data or file_data. */ videoMetadata?: VideoMetadata; /** Document metadata. The metadata should only be specified while the document data is presented in inline_data or file_data. */ documentMetadata?: DocumentMetadata; /** Spreadsheet metadata. The metadata should only be specified while the spreadsheet data is presented in inline_data or file_data. */ spreadsheetMetadata?: SpreadsheetMetadata; /** Audio metadata. The metadata should only be specified while the audio data is presented in inline_data or file_data. */ audioMetadata?: AudioMetadata; } /** Specifies how the response should be scheduled in the conversation. Only applicable to NON_BLOCKING function calls, is ignored otherwise. Defaults to WHEN_IDLE. */ export declare enum FunctionResponseScheduling { /** * This value is unused. */ SCHEDULING_UNSPECIFIED = "SCHEDULING_UNSPECIFIED", /** * Only add the result to the conversation context, do not interrupt or trigger generation. */ SILENT = "SILENT", /** * Add the result to the conversation context, and prompt to generate output without interrupting ongoing generation. */ WHEN_IDLE = "WHEN_IDLE", /** * Add the result to the conversation context, interrupt ongoing generation and prompt to generate output. */ INTERRUPT = "INTERRUPT" } declare type FunctionResult$ = FunctionResultDelta; declare type FunctionResultDelta = { is_error?: boolean | undefined; name?: string | undefined; result: Array | FunctionResultDeltaResult | string; type: "function_result"; }; declare type FunctionResultDeltaResult = {}; declare type FunctionResultDeltaResultUnion = Array | FunctionResultDeltaResult | string; declare type FunctionResultStep$ = FunctionResultStep; /** * Result of a function tool call. */ declare type FunctionResultStep = { /** * Required. ID to match the ID from the function call block. */ call_id: string; /** * Whether the tool call resulted in an error. */ is_error?: boolean | undefined; /** * The name of the tool that was called. */ name?: string | undefined; /** * Required. The result of the tool call. */ result: Array | FunctionResultStepResult | string; type: "function_result"; }; declare type FunctionResultStepResult = {}; /** * Required. The result of the tool call. */ declare type FunctionResultStepResultUnion = Array | FunctionResultStepResult | string; declare type FunctionResultSubcontent = AudioContent | DocumentContent | FunctionT | ImageContent | TextContent | VideoContent; /** * @license * Copyright 2026 Google LLC * SPDX-License-Identifier: Apache-2.0 * * g3-prettier-ignore-file */ /** * A tool that can be used by the model. */ declare type FunctionT = { /** * If true, the function's loading is deferred. */ defer_loading?: boolean | undefined; /** * A description of the function. */ description?: string | undefined; /** * The name of the function. */ name?: string | undefined; /** * The JSON Schema for the function's parameters. * * @remarks * * Supports a subset of JSON Schema. `minLength`, `maxLength`, * `minProperties`, `maxProperties`, `uniqueItems`, `contains`, * `minContains`, and `maxContains` are ignored and not enforced. */ parameters?: any | undefined; /** * A brief description of the function, shown to the model as a * * @remarks * short summary of functions with `defer_loading` set to true. */ short_description?: string | undefined; type: "function"; }; /** The Google Cloud Storage location for the input content. This data type is not supported in Gemini API. */ export declare interface GcsSource { /** Required. Google Cloud Storage URI(-s) to the input file(s). May contain wildcards. For more information on wildcards, see https://cloud.google.com/storage/docs/wildcards. */ uris?: string[]; } declare class GeminiNextGenAgents { private readonly parentClient; private sdk; readonly templates: GeminiNextGenAgentTemplates; constructor(parentClient: GoogleGenAIParentClient); create(params?: Agents.AgentCreateParams | null | undefined, options?: GoogleGenAIRequestOptions): Promise; list(params?: Agents.AgentListParams | null | undefined, options?: GoogleGenAIRequestOptions): Promise; get(id: string, params?: Agents.AgentGetParams | null | undefined, options?: GoogleGenAIRequestOptions): Promise; update(id: string, params?: Agents.AgentUpdateParams | null | undefined, options?: GoogleGenAIRequestOptions): Promise; delete(id: string, params?: Agents.AgentDeleteParams | null | undefined, options?: GoogleGenAIRequestOptions): Promise; private getClient; } /** * Client wrapper for Agent Templates CRUD operations. */ declare class GeminiNextGenAgentTemplates { private readonly resolveClient; constructor(resolveClient: (apiVersion?: string) => GoogleGenAI_2); create(params?: (Agents.Templates.AgentTemplateCreateParams & { api_version?: string | undefined; }) | null | undefined, options?: GoogleGenAIRequestOptions): Promise; list(params?: Agents.Templates.AgentTemplateListParams | null | undefined, options?: GoogleGenAIRequestOptions): Promise; get(id: string, params?: Agents.Templates.AgentTemplateGetParams | null | undefined, options?: GoogleGenAIRequestOptions): Promise; update(id: string, params?: Agents.Templates.AgentTemplateUpdateParams | null | undefined, options?: GoogleGenAIRequestOptions): Promise; delete(id: string, params?: Agents.Templates.AgentTemplateDeleteParams | null | undefined, options?: GoogleGenAIRequestOptions): Promise; } /** * @license * Copyright 2026 Google LLC * SPDX-License-Identifier: Apache-2.0 */ /** Base error class for Gemini NextGen API client errors. */ declare class GeminiNextGenAPIClientError extends Error { constructor(message?: string); } declare class GeminiNextGenCredentials { private readonly parentClient; private sdk; constructor(parentClient: GoogleGenAIParentClient); create(params: Credentials.CredentialCreateParams & { api_version?: string; }, options?: GoogleGenAIRequestOptions): Promise; list(params?: Credentials.CredentialListParams | null | undefined, options?: GoogleGenAIRequestOptions): Promise; get(id: string, params?: { api_version?: string; } | null | undefined, options?: GoogleGenAIRequestOptions): Promise; update(id: string, params: CredentialUpdateParams, options?: GoogleGenAIRequestOptions): Promise; delete(id: string, params?: { api_version?: string; } | null | undefined, options?: GoogleGenAIRequestOptions): Promise; private getClient; } declare class GeminiNextGenDecisions { private readonly parentClient; private sdk; constructor(parentClient: GoogleGenAIParentClient); create(params: Decisions.CreateDecisionRequest & { api_version?: string; }, options?: GoogleGenAIRequestOptions): Promise; private getClient; } declare class GeminiNextGenEnvironmentFiles { private readonly resolveClient; private readonly parentClient?; constructor(resolveClient: (apiVersion?: string) => GoogleGenAI_2, parentClient?: GoogleGenAIParentClient | undefined); list(params: ListEnvironmentFilesParams, options?: GoogleGenAIRequestOptions): Promise; download(params: DownloadEnvironmentFileParams, options?: GoogleGenAIRequestOptions): Promise; upload(params: UploadEnvironmentFileParams, options?: GoogleGenAIRequestOptions): Promise; } declare class GeminiNextGenEnvironments { private readonly parentClient; private sdk; readonly files: GeminiNextGenEnvironmentFiles; constructor(parentClient: GoogleGenAIParentClient); create(params: Environments.CreateEnvironmentRequest & { api_version?: string; }, options?: GoogleGenAIRequestOptions): Promise; list(params?: ListEnvironmentsParams | null | undefined, options?: GoogleGenAIRequestOptions): Promise; get(id: string, params?: { api_version?: string; } | null | undefined, options?: GoogleGenAIRequestOptions): Promise; delete(id: string, params?: { api_version?: string; } | null | undefined, options?: GoogleGenAIRequestOptions): Promise; private getClient; } /** * Sub-resource for creating and deleting short-lived Live Interaction auth tokens. * * Experimental: Live Interactions SDK support is experimental and may change * in future versions. * * @experimental */ declare class GeminiNextGenInteractionAuthTokens { private readonly resolveClient; private readonly isVertexAI; constructor(resolveClient: (apiVersion?: string) => GoogleGenAI_2, isVertexAI?: () => boolean); /** * Creates a short-lived auth token for a Live Interaction. * * Experimental: Live Interactions SDK support is experimental and may change * in future versions. * * @experimental */ create(interaction_id: string, params?: CreateInteractionAuthTokenParams | null | undefined, options?: GoogleGenAIRequestOptions): Promise>; /** * Deletes (revokes) an auth token for a Live Interaction. * * Experimental: Live Interactions SDK support is experimental and may change * in future versions. * * @experimental */ delete(interaction_id: string, auth_token: string, params?: DeleteInteractionAuthTokenParams | null | undefined, options?: GoogleGenAIRequestOptions): Promise>; } declare class GeminiNextGenInteractions { private readonly parentClient; private readonly webSocketFactory?; private sdk; readonly authTokens: GeminiNextGenInteractionAuthTokens; constructor(parentClient: GoogleGenAIParentClient, webSocketFactory?: WebSocketFactory | undefined); /** * Creates a model interaction. Long decodes are continued automatically * across hops and merged into one interaction unless * `automatic_continuation: false` is passed; see * {@link AutomaticContinuationOption}. */ create(params: Interactions.InteractionCreateParams.CreateModelInteractionParamsNonStreaming & AutomaticContinuationOption, options?: GoogleGenAIRequestOptions): Promise; /** * Creates an agent interaction. Agent loops are managed by the server, so * `automatic_continuation` has no effect; see * {@link AutomaticContinuationOption}. */ create(params: Interactions.InteractionCreateParams.CreateAgentInteractionParamsNonStreaming & AutomaticContinuationOption, options?: GoogleGenAIRequestOptions): Promise; /** * Creates a streaming model interaction. Long decodes are continued * automatically: the returned stream yields the events of every hop unless * `automatic_continuation: false` is passed; see * {@link AutomaticContinuationOption}. */ create(params: Interactions.InteractionCreateParams.CreateModelInteractionParamsStreaming & AutomaticContinuationOption, options?: GoogleGenAIRequestOptions): Promise>; /** * Creates a streaming agent interaction. Agent loops are managed by the * server, so `automatic_continuation` has no effect; see * {@link AutomaticContinuationOption}. */ create(params: Interactions.InteractionCreateParams.CreateAgentInteractionParamsStreaming & AutomaticContinuationOption, options?: GoogleGenAIRequestOptions): Promise>; /** * Creates a streaming interaction; see {@link AutomaticContinuationOption}. */ create(params: Interactions.InteractionCreateParams.InteractionCreateParamsStreaming & AutomaticContinuationOption, options?: GoogleGenAIRequestOptions): Promise>; /** * Creates an interaction; see {@link AutomaticContinuationOption}. */ create(params: Interactions.InteractionCreateParams.InteractionCreateParamsNonStreaming & AutomaticContinuationOption, options?: GoogleGenAIRequestOptions): Promise; /** * Creates an interaction; see {@link AutomaticContinuationOption}. */ create(params: CreateInteractionParamsWithOptions, options?: GoogleGenAIRequestOptions): Promise>; /** * Connects a WebRTC session to an existing live interaction. * * Experimental: Live Interactions SDK support is experimental and may change * in future versions. * * `receive()` yields server events continuously over the `"events"` data * channel until a terminal server event (`interaction.completed` or * `interaction.canceled`) arrives, the server closes the data channel after * `interaction.requires_reconnection`, or the connection detaches. * * Terminal server events, errors, and `await connection.cancel()` * automatically flush and close the local WebRTC transport. Call * `connection.detach()` to disconnect locally while leaving the server * interaction resumable, or call `await connection.complete()` and consume * `connection.receive()` until `interaction.completed` to finish. * * @experimental */ connect(id: string, params: InteractionConnectParams & { transport: "webrtc" | InteractionWebRTCTransport; }, options?: GoogleGenAIRequestOptions): Promise; /** * Connects a WebSocket session to an existing live interaction. * * Experimental: Live Interactions SDK support is experimental and may change * in future versions. * * `receive()` yields server events continuously until a terminal server event * (`interaction.completed` or `interaction.canceled`) arrives, the server * closes the WebSocket cleanly (code `1000`) after * `interaction.requires_reconnection`, or the connection detaches. * * Terminal server events, errors, and `await connection.cancel()` * automatically close the local WebSocket. Call `connection.detach()` to * disconnect locally while leaving the server interaction resumable, or call * `await connection.complete()` and consume `connection.receive()` until * `interaction.completed` to finish. * * @experimental */ connect(id: string, params?: InteractionConnectParams & { transport?: "websocket"; }, options?: GoogleGenAIRequestOptions): Promise; /** * Connects a WebSocket or WebRTC session to an existing live interaction. * * Experimental: Live Interactions SDK support is experimental and may change * in future versions. * * @experimental */ connect(id: string, params?: InteractionConnectParams, options?: GoogleGenAIRequestOptions): Promise; get(id: string, params?: Interactions.InteractionGetParamsNonStreaming | null, options?: GoogleGenAIRequestOptions): Promise; get(id: string, params: Interactions.InteractionGetParamsStreaming, options?: GoogleGenAIRequestOptions): Promise>; get(id: string, params?: Interactions.InteractionGetParams | null, options?: GoogleGenAIRequestOptions): Promise>; delete(id: string, params?: { api_version?: string; } | null | undefined, options?: GoogleGenAIRequestOptions): Promise; cancel(id: string, params?: { api_version?: string; } | null | undefined, options?: GoogleGenAIRequestOptions): Promise; private getClient; } declare class GeminiNextGenTriggers { private readonly parentClient; private sdk; constructor(parentClient: GoogleGenAIParentClient); create(params: Triggers.TriggerCreateParams & { api_version?: string | undefined; }, options?: GoogleGenAIRequestOptions): Promise; list(params?: Triggers.TriggerListParams | null | undefined, options?: GoogleGenAIRequestOptions): Promise; get(id: string, params?: Triggers.TriggerGetParams | null | undefined, options?: GoogleGenAIRequestOptions): Promise; update(id: string, params: Triggers.TriggerUpdateParams, options?: GoogleGenAIRequestOptions): Promise; delete(id: string, params?: Triggers.TriggerDeleteParams | null | undefined, options?: GoogleGenAIRequestOptions): Promise; run(trigger_id: string, params?: Triggers.TriggerRunParams | null | undefined, options?: GoogleGenAIRequestOptions): Promise; listExecutions(trigger_id: string, params?: Triggers.TriggerListExecutionsParams | null | undefined, options?: GoogleGenAIRequestOptions): Promise; private getClient; } declare class GeminiNextGenVoices { private readonly parentClient; private sdk; constructor(parentClient: GoogleGenAIParentClient); create(params: Voices.VoiceCreateParams["body"] & { api_version?: string; }, options?: GoogleGenAIRequestOptions): Promise; list(params?: Voices.VoiceListParams | null | undefined, options?: GoogleGenAIRequestOptions): Promise; get(id: string, params?: Voices.VoiceGetParams | null | undefined, options?: GoogleGenAIRequestOptions): Promise; delete(id: string, params?: Voices.VoiceDeleteParams | null | undefined, options?: GoogleGenAIRequestOptions): Promise; private getClient; } declare class GeminiNextGenWebhooks { private readonly parentClient; private sdk; constructor(parentClient: GoogleGenAIParentClient); create(params: Webhooks.WebhookInput & { api_version?: string; }, options?: GoogleGenAIRequestOptions): Promise; list(params?: Webhooks.WebhookListParams | null | undefined, options?: GoogleGenAIRequestOptions): Promise; get(id: string, params?: { api_version?: string; } | null | undefined, options?: GoogleGenAIRequestOptions): Promise; update(id: string, params?: (Webhooks.WebhookUpdate & { api_version?: string | undefined; update_mask?: string | undefined; }) | null | undefined, options?: GoogleGenAIRequestOptions): Promise; delete(id: string, params?: { api_version?: string; } | null | undefined, options?: GoogleGenAIRequestOptions): Promise; rotateSigningSecret(id: string, params?: (Webhooks.RotateSigningSecretRequest & { api_version?: string; }) | null | undefined, options?: GoogleGenAIRequestOptions): Promise; ping(id: string, params?: { api_version?: string; body?: Webhooks.PingWebhookRequest; } | null | undefined, options?: GoogleGenAIRequestOptions): Promise; private getClient; } /** Input example for preference optimization. This data type is not supported in Gemini API. */ export declare interface GeminiPreferenceExample { /** List of completions for a given prompt. */ completions?: GeminiPreferenceExampleCompletion[]; /** Multi-turn contents that represents the Prompt. */ contents?: Content[]; } /** Completion and its preference score. This data type is not supported in Gemini API. */ export declare interface GeminiPreferenceExampleCompletion { /** Single turn completion for the given prompt. */ completion?: Content; /** The score for the given completion. */ score?: number; } /** Optional model configuration parameters. For more information, see `Content generation parameters `_. */ export declare interface GenerateContentConfig { /** Used to override HTTP request options. */ httpOptions?: HttpOptions; /** Abort signal which can be used to cancel the request. NOTE: AbortSignal is a client-only operation. Using it to cancel an operation will not cancel the request in the service. You will still be charged usage for any applicable operations. */ abortSignal?: AbortSignal; /** The service tier to use for the request. For example, ServiceTier.FLEX. */ serviceTier?: ServiceTier; /** Instructions for the model to steer it toward better performance. For example, "Answer as concisely as possible" or "Don't use technical terms in your response". */ systemInstruction?: ContentUnion; /** Value that controls the degree of randomness in token selection. Lower temperatures are good for prompts that require a less open-ended or creative response, while higher temperatures can lead to more diverse or creative results. */ temperature?: number; /** Tokens are selected from the most to least probable until the sum of their probabilities equals this value. Use a lower value for less random responses and a higher value for more random responses. */ topP?: number; /** For each token selection step, the ``top_k`` tokens with the highest probabilities are sampled. Then tokens are further filtered based on ``top_p`` with the final token selected using temperature sampling. Use a lower number for less random responses and a higher number for more random responses. */ topK?: number; /** Number of response variations to return. */ candidateCount?: number; /** Maximum number of tokens that can be generated in the response. */ maxOutputTokens?: number; /** List of strings that tells the model to stop generating text if one of the strings is encountered in the response. */ stopSequences?: string[]; /** Whether to return the log probabilities of the tokens that were chosen by the model at each step. */ responseLogprobs?: boolean; /** Number of top candidate tokens to return the log probabilities for at each generation step. */ logprobs?: number; /** Positive values penalize tokens that already appear in the generated text, increasing the probability of generating more diverse content. */ presencePenalty?: number; /** Positive values penalize tokens that repeatedly appear in the generated text, increasing the probability of generating more diverse content. */ frequencyPenalty?: number; /** When ``seed`` is fixed to a specific number, the model makes a best effort to provide the same response for repeated requests. By default, a random number is used. */ seed?: number; /** Output response mimetype of the generated candidate text. Supported mimetype: - `text/plain`: (default) Text output. - `application/json`: JSON response in the candidates. The model needs to be prompted to output the appropriate response type, otherwise the behavior is undefined. */ responseMimeType?: string; /** The `Schema` object allows the definition of input and output data types. These types can be objects, but also primitives and arrays. Represents a select subset of an [OpenAPI 3.0 schema object](https://spec.openapis.org/oas/v3.0.3#schema). If set, a compatible response_mime_type must also be set. Compatible mimetypes: `application/json`: Schema for JSON response. If `response_schema` doesn't process your schema correctly, try using `response_json_schema` instead. */ responseSchema?: SchemaUnion; /** Optional. Output schema of the generated response. This is an alternative to `response_schema` that accepts [JSON Schema](https://json-schema.org/). If set, `response_schema` must be omitted, but `response_mime_type` is required. While the full JSON Schema may be sent, not all features are supported. Specifically, only the following properties are supported: - `$id` - `$defs` - `$ref` - `$anchor` - `type` - `format` - `title` - `description` - `enum` (for strings and numbers) - `items` - `prefixItems` - `minItems` - `maxItems` - `minimum` - `maximum` - `anyOf` - `oneOf` (interpreted the same as `anyOf`) - `properties` - `additionalProperties` - `required` The non-standard `propertyOrdering` property may also be set. Cyclic references are unrolled to a limited degree and, as such, may only be used within non-required properties. (Nullable properties are not sufficient.) If `$ref` is set on a sub-schema, no other properties, except for than those starting as a `$`, may be set. */ responseJsonSchema?: unknown; /** Configuration for model router requests. */ routingConfig?: GenerationConfigRoutingConfig; /** Configuration for model selection. */ modelSelectionConfig?: ModelSelectionConfig; /** Safety settings in the request to block unsafe content in the response. */ safetySettings?: SafetySetting[]; /** Code that enables the system to interact with external systems to perform an action outside of the knowledge and scope of the model. */ tools?: ToolListUnion; /** Associates model output to a specific function call. */ toolConfig?: ToolConfig; /** Labels with user-defined metadata for the request. */ labels?: Record; /** Resource name of a context cache that can be used in subsequent requests. */ cachedContent?: string; /** The requested modalities of the response. Represents the set of modalities that the model can return. */ responseModalities?: string[]; /** If specified, the media resolution specified will be used. */ mediaResolution?: MediaResolution; /** The speech generation configuration. */ speechConfig?: SpeechConfigUnion; /** If enabled, audio timestamp will be included in the request to the model. */ audioTimestamp?: boolean; /** The configuration for automatic function calling. */ automaticFunctionCalling?: AutomaticFunctionCallingConfig; /** The thinking features configuration. */ thinkingConfig?: ThinkingConfig; /** Optional. Configuration for audio transcription (speech recognition). */ audioTranscriptionConfig?: AudioTranscriptionConfig; /** The image generation configuration. */ imageConfig?: ImageConfig; /** Enables enhanced civic answers. It may not be available for all models. This field is not supported in Gemini platform. */ enableEnhancedCivicAnswers?: boolean; /** Settings for prompt and response sanitization using the Model Armor service. If supplied, safety_settings must not be supplied. */ modelArmorConfig?: ModelArmorConfig; /** An opaque continuation token used to resume generation from a previous response that stopped with `finish_reason` set to `CONTINUATION`. * @remarks Encoded as base64 string. */ continuationToken?: string; /** Defaults to true. When a response ends with finish reason `CONTINUATION`, the SDK sends the same request again with the response's continuation token until the model finishes. Timeouts, retries and billing apply to each request. Set to false to turn this off. */ automaticContinuation?: boolean; /** Optional. Configuration for persisting output assets to external storage. */ generationOutputConfig?: GenerationOutputConfig; /** Configures the logging behavior for a given request. If set, it takes precedence over the project-level logging config. This field is not supported in Gemini platform. */ store?: boolean; } /** Config for models.generate_content parameters. */ export declare interface GenerateContentParameters { /** ID of the model to use. For a list of models, see `Google models `_. */ model: string; /** Content of the request. */ contents: ContentListUnion; /** Configuration that contains optional model parameters. */ config?: GenerateContentConfig; } /** Response message for PredictionService.GenerateContent. */ export declare class GenerateContentResponse { /** Used to retain the full HTTP response. */ sdkHttpResponse?: HttpResponse; /** Response variations returned by the model. */ candidates?: Candidate[]; /** Timestamp when the request is made to the server. */ createTime?: string; /** The history of automatic function calling. */ automaticFunctionCallingHistory?: Content[]; /** Output only. The model version used to generate the response. */ modelVersion?: string; /** Output only. Content filter results for a prompt sent in the request. Note: Sent only in the first stream chunk. Only happens when no candidates were generated due to content violations. */ promptFeedback?: GenerateContentResponsePromptFeedback; /** Output only. response_id is used to identify each response. It is the encoding of the event_id. */ responseId?: string; /** Usage metadata about the response(s). */ usageMetadata?: GenerateContentResponseUsageMetadata; /** Output only. The current model status of this model. This field is not supported in Vertex AI. */ modelStatus?: ModelStatus; /** * Returns the concatenation of all text parts from the first candidate in the response. * * @remarks * If there are multiple candidates in the response, the text from the first * one will be returned. * If there are non-text parts in the response, the concatenation of all text * parts will be returned, and a warning will be logged. * If there are thought parts in the response, the concatenation of all text * parts excluding the thought parts will be returned. * * @example * ```ts * const response = await ai.models.generateContent({ * model: 'gemini-3.8-flash', * contents: * 'Why is the sky blue?', * }); * * console.debug(response.text); * ``` */ get text(): string | undefined; /** * Returns the concatenation of all inline data parts from the first candidate * in the response. * * @remarks * If there are multiple candidates in the response, the inline data from the * first one will be returned. If there are non-inline data parts in the * response, the concatenation of all inline data parts will be returned, and * a warning will be logged. */ get data(): string | undefined; /** * Returns the function calls from the first candidate in the response. * * @remarks * If there are multiple candidates in the response, the function calls from * the first one will be returned. * If there are no function calls in the response, undefined will be returned. * * @example * ```ts * const controlLightFunctionDeclaration: FunctionDeclaration = { * name: 'controlLight', * parameters: { * type: Type.OBJECT, * description: 'Set the brightness and color temperature of a room light.', * properties: { * brightness: { * type: Type.NUMBER, * description: * 'Light level from 0 to 100. Zero is off and 100 is full brightness.', * }, * colorTemperature: { * type: Type.STRING, * description: * 'Color temperature of the light fixture which can be `daylight`, `cool` or `warm`.', * }, * }, * required: ['brightness', 'colorTemperature'], * }; * const response = await ai.models.generateContent({ * model: 'gemini-3.8-flash', * contents: 'Dim the lights so the room feels cozy and warm.', * config: { * tools: [{functionDeclarations: [controlLightFunctionDeclaration]}], * toolConfig: { * functionCallingConfig: { * mode: FunctionCallingConfigMode.ANY, * allowedFunctionNames: ['controlLight'], * }, * }, * }, * }); * console.debug(JSON.stringify(response.functionCalls)); * ``` */ get functionCalls(): FunctionCall[] | undefined; /** * Returns the first executable code from the first candidate in the response. * * @remarks * If there are multiple candidates in the response, the executable code from * the first one will be returned. * If there are no executable code in the response, undefined will be * returned. * * @example * ```ts * const response = await ai.models.generateContent({ * model: 'gemini-3.8-flash', * contents: * 'What is the sum of the first 50 prime numbers? Generate and run code for the calculation, and make sure you get all 50.' * config: { * tools: [{codeExecution: {}}], * }, * }); * * console.debug(response.executableCode); * ``` */ get executableCode(): string | undefined; /** * Returns the first code execution result from the first candidate in the response. * * @remarks * If there are multiple candidates in the response, the code execution result from * the first one will be returned. * If there are no code execution result in the response, undefined will be returned. * * @example * ```ts * const response = await ai.models.generateContent({ * model: 'gemini-3.8-flash', * contents: * 'What is the sum of the first 50 prime numbers? Generate and run code for the calculation, and make sure you get all 50.' * config: { * tools: [{codeExecution: {}}], * }, * }); * * console.debug(response.codeExecutionResult); * ``` */ get codeExecutionResult(): string | undefined; /** * Returns the prompt token count from the initial request prior to any continuation hops. */ get initialPromptTokenCount(): number | undefined; } /** Content filter results for a prompt sent in the request. Note: This is sent only in the first stream chunk and only if no candidates were generated due to content violations. */ export declare class GenerateContentResponsePromptFeedback { /** Output only. The reason why the prompt was blocked. */ blockReason?: BlockedReason; /** Output only. A readable message that explains the reason why the prompt was blocked. This field is not supported in Gemini API. */ blockReasonMessage?: string; /** Output only. A list of safety ratings for the prompt. There is one rating per category. */ safetyRatings?: SafetyRating[]; } /** Usage metadata about the content generation request and response. This message provides a detailed breakdown of token usage and other relevant metrics. This data type is not supported in Gemini API. */ export declare class GenerateContentResponseUsageMetadata { /** Output only. A detailed breakdown of the token count for each modality in the cached content. */ cacheTokensDetails?: ModalityTokenCount[]; /** Output only. The number of tokens in the cached content that was used for this request. */ cachedContentTokenCount?: number; /** The total number of tokens in the generated candidates. */ candidatesTokenCount?: number; /** Output only. A detailed breakdown of the token count for each modality in the generated candidates. */ candidatesTokensDetails?: ModalityTokenCount[]; /** The total number of tokens in the prompt. This includes any text, images, or other media provided in the request. When `cached_content` is set, this also includes the number of tokens in the cached content. */ promptTokenCount?: number; /** Output only. A detailed breakdown of the token count for each modality in the prompt. */ promptTokensDetails?: ModalityTokenCount[]; /** Output only. The number of tokens that were part of the model's generated "thoughts" output, if applicable. */ thoughtsTokenCount?: number; /** Output only. The number of tokens in the results from tool executions, which are provided back to the model as input, if applicable. */ toolUsePromptTokenCount?: number; /** Output only. A detailed breakdown by modality of the token counts from the results of tool executions, which are provided back to the model as input. */ toolUsePromptTokensDetails?: ModalityTokenCount[]; /** The total number of tokens for the entire request. This is the sum of `prompt_token_count`, `candidates_token_count`, `tool_use_prompt_token_count`, and `thoughts_token_count`. */ totalTokenCount?: number; /** Output only. The traffic type for this request. */ trafficType?: TrafficType; /** Output only. The prompt token count from the initial request prior to any continuation hops. */ initialPromptTokenCount?: number; } /** An output image. */ export declare interface GeneratedImage { /** The output image data. */ image?: Image_2; /** Responsible AI filter reason if the image is filtered out of the response. */ raiFilteredReason?: string; /** Safety attributes of the image. Lists of RAI categories and their scores of each content. */ safetyAttributes?: SafetyAttributes; /** The rewritten prompt used for the image generation if the prompt enhancer is enabled. */ enhancedPrompt?: string; } /** A generated image mask. */ export declare interface GeneratedImageMask { /** The generated image mask. */ mask?: Image_2; /** The detected entities on the segmented area. */ labels?: EntityLabel[]; } /** A generated video. */ export declare interface GeneratedVideo { /** The output video */ video?: Video; } /** The config for generating an images. */ export declare interface GenerateImagesConfig { /** Used to override HTTP request options. */ httpOptions?: HttpOptions; /** Abort signal which can be used to cancel the request. NOTE: AbortSignal is a client-only operation. Using it to cancel an operation will not cancel the request in the service. You will still be charged usage for any applicable operations. */ abortSignal?: AbortSignal; /** Cloud Storage URI used to store the generated images. */ outputGcsUri?: string; /** Description of what to discourage in the generated images. */ negativePrompt?: string; /** Number of images to generate. */ numberOfImages?: number; /** Aspect ratio of the generated images. Supported values are "1:1", "3:4", "4:3", "9:16", and "16:9". */ aspectRatio?: string; /** Controls how much the model adheres to the text prompt. Large values increase output and prompt alignment, but may compromise image quality. */ guidanceScale?: number; /** Random seed for image generation. This is not available when ``add_watermark`` is set to true. */ seed?: number; /** Filter level for safety filtering. */ safetyFilterLevel?: SafetyFilterLevel; /** Allows generation of people by the model. */ personGeneration?: PersonGeneration; /** Whether to report the safety scores of each generated image and the positive prompt in the response. */ includeSafetyAttributes?: boolean; /** Whether to include the Responsible AI filter reason if the image is filtered out of the response. */ includeRaiReason?: boolean; /** Language of the text in the prompt. */ language?: ImagePromptLanguage; /** MIME type of the generated image. */ outputMimeType?: string; /** Compression quality of the generated image (for ``image/jpeg`` only). */ outputCompressionQuality?: number; /** Whether to add a watermark to the generated images. */ addWatermark?: boolean; /** User specified labels to track billing usage. */ labels?: Record; /** The size of the largest dimension of the generated image. Supported sizes are 1K and 2K (not supported for Imagen 3 models). */ imageSize?: string; /** Whether to use the prompt rewriting logic. */ enhancePrompt?: boolean; } /** The parameters for generating images. */ export declare interface GenerateImagesParameters { /** ID of the model to use. For a list of models, see `Google models `_. */ model: string; /** Text prompt that typically describes the images to output. */ prompt: string; /** Configuration for generating images. */ config?: GenerateImagesConfig; } /** The output images response. */ export declare class GenerateImagesResponse { /** Used to retain the full HTTP response. */ sdkHttpResponse?: HttpResponse; /** List of generated images. */ generatedImages?: GeneratedImage[]; /** Safety attributes of the positive prompt. Only populated if ``include_safety_attributes`` is set to True. */ positivePromptSafetyAttributes?: SafetyAttributes; } /** Configuration for generating videos. */ export declare interface GenerateVideosConfig { /** Used to override HTTP request options. */ httpOptions?: HttpOptions; /** Abort signal which can be used to cancel the request. NOTE: AbortSignal is a client-only operation. Using it to cancel an operation will not cancel the request in the service. You will still be charged usage for any applicable operations. */ abortSignal?: AbortSignal; /** Number of output videos. */ numberOfVideos?: number; /** The gcs bucket where to save the generated videos. */ outputGcsUri?: string; /** Frames per second for video generation. */ fps?: number; /** Duration of the clip for video generation in seconds. */ durationSeconds?: number; /** The RNG seed. If RNG seed is exactly same for each request with unchanged inputs, the prediction results will be consistent. Otherwise, a random RNG seed will be used each time to produce a different result. */ seed?: number; /** The aspect ratio for the generated video. 16:9 (landscape) and 9:16 (portrait) are supported. */ aspectRatio?: string; /** The resolution for the generated video. 720p and 1080p are supported. */ resolution?: string; /** Whether allow to generate person videos, and restrict to specific ages. Supported values are: dont_allow, allow_adult. */ personGeneration?: string; /** The pubsub topic where to publish the video generation progress. */ pubsubTopic?: string; /** Explicitly state what should not be included in the generated videos. */ negativePrompt?: string; /** Whether to use the prompt rewriting logic. */ enhancePrompt?: boolean; /** Whether to generate audio along with the video. */ generateAudio?: boolean; /** Image to use as the last frame of generated videos. Only supported for image to video use cases. */ lastFrame?: Image_2; /** The images to use as the references to generate the videos. If this field is provided, the text prompt field must also be provided. The image, video, or last_frame field are not supported. Each image must be associated with a type. Veo 2 supports up to 3 asset images *or* 1 style image. */ referenceImages?: VideoGenerationReferenceImage[]; /** The mask to use for generating videos. */ mask?: VideoGenerationMask; /** Compression quality of the generated videos. */ compressionQuality?: VideoCompressionQuality; /** User specified labels to track billing usage. */ labels?: Record; /** Webhook configuration for receiving notifications when the video generation operation completes. */ webhookConfig?: WebhookConfig; /** Resize mode of the image input for video generation. */ resizeMode?: ImageResizeMode; } /** A video generation operation. */ export declare class GenerateVideosOperation implements Operation { /** 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}`. */ name?: string; /** Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such metadata. Any method that returns a long-running operation should document the metadata type, if any. */ metadata?: Record; /** If the value is `false`, it means the operation is still in progress. If `true`, the operation is completed, and either `error` or `response` is available. */ done?: boolean; /** The error result of the operation in case of failure or cancellation. */ error?: Record; /** The generated videos. */ response?: GenerateVideosResponse; /** * Instantiates an Operation of the same type as the one being called with the fields set from the API response. */ _fromAPIResponse({ apiResponse, _isVertexAI, }: OperationFromAPIResponseParameters): Operation; /** The full HTTP response. */ sdkHttpResponse?: HttpResponse; } /** Class that represents the parameters for generating videos. */ export declare interface GenerateVideosParameters { /** ID of the model to use. For a list of models, see `Google models `_. */ model: string; /** The text prompt for generating the videos. Optional if image or video is provided. */ prompt?: string; /** The input image for generating the videos. Optional if prompt is provided. Not allowed if video is provided. */ image?: Image_2; /** The input video for video extension use cases. Optional if prompt is provided. Not allowed if image is provided. */ video?: Video; /** A set of source input(s) for video generation. */ source?: GenerateVideosSource; /** Configuration for generating videos. */ config?: GenerateVideosConfig; } /** Response with generated videos. */ export declare class GenerateVideosResponse { /** List of the generated videos */ generatedVideos?: GeneratedVideo[]; /** Returns if any videos were filtered due to RAI policies. */ raiMediaFilteredCount?: number; /** Returns rai failure reasons if any. */ raiMediaFilteredReasons?: string[]; } /** A set of source input(s) for video generation. */ export declare interface GenerateVideosSource { /** The text prompt for generating the videos. Optional if image or video is provided. */ prompt?: string; /** The input image for generating the videos. Optional if prompt is provided. Not allowed if video is provided. */ image?: Image_2; /** The input video for video extension use cases. Optional if prompt is provided. Not allowed if image is provided. */ video?: Video; } declare type GenerationConfig$ = GenerationConfig_2; /** Generation config. */ export declare interface GenerationConfig { /** Optional. Config for model selection. */ modelSelectionConfig?: ModelSelectionConfig; /** Output schema of the generated response. This is an alternative to `response_schema` that accepts [JSON Schema](https://json-schema.org/). */ responseJsonSchema?: unknown; /** Optional. Configuration for audio transcription (speech recognition). */ audioTranscriptionConfig?: AudioTranscriptionConfig; /** Optional. If enabled, audio timestamps will be included in the request to the model. This can be useful for synchronizing audio with other modalities in the response. This field is not supported in Gemini API. */ audioTimestamp?: boolean; /** Optional. The number of candidate responses to generate. A higher `candidate_count` can provide more options to choose from, but it also consumes more resources. This can be useful for generating a variety of responses and selecting the best one. */ candidateCount?: number; /** Optional. If enabled, the model will detect emotions and adapt its responses accordingly. For example, if the model detects that the user is frustrated, it may provide a more empathetic response. */ enableAffectiveDialog?: boolean; /** Optional. Penalizes tokens based on their frequency in the generated text. A positive value helps to reduce the repetition of words and phrases. Valid values can range from [-2.0, 2.0]. */ frequencyPenalty?: number; /** Optional. The number of top log probabilities to return for each token. This can be used to see which other tokens were considered likely candidates for a given position. A higher value will return more options, but it will also increase the size of the response. */ logprobs?: number; /** Optional. The maximum number of tokens to generate in the response. A token is approximately four characters. The default value varies by model. This parameter can be used to control the length of the generated text and prevent overly long responses. */ maxOutputTokens?: number; /** Optional. The token resolution at which input media content is sampled. This is used to control the trade-off between the quality of the response and the number of tokens used to represent the media. A higher resolution allows the model to perceive more detail, which can lead to a more nuanced response, but it will also use more tokens. This does not affect the image dimensions sent to the model. */ mediaResolution?: MediaResolution; /** Optional. Penalizes tokens that have already appeared in the generated text. A positive value encourages the model to generate more diverse and less repetitive text. Valid values can range from [-2.0, 2.0]. */ presencePenalty?: number; /** Optional. New response format field for the model to configure output formatting and delivery. */ responseFormat?: ResponseFormat[]; /** Optional. If set to true, the log probabilities of the output tokens are returned. Log probabilities are the logarithm of the probability of a token appearing in the output. A higher log probability means the token is more likely to be generated. This can be useful for analyzing the model's confidence in its own output and for debugging. */ responseLogprobs?: boolean; /** Optional. The IANA standard MIME type of the response. The model will generate output that conforms to this MIME type. Supported values include 'text/plain' (default) and 'application/json'. The model needs to be prompted to output the appropriate response type, otherwise the behavior is undefined. Deprecated: Use `response_format` instead. */ responseMimeType?: string; /** Optional. The modalities of the response. The model will generate a response that includes all the specified modalities. For example, if this is set to `[TEXT, IMAGE]`, the response will include both text and an image. */ responseModalities?: Modality[]; /** Optional. Lets you to specify a schema for the model's response, ensuring that the output conforms to a particular structure. This is useful for generating structured data such as JSON. The schema is a subset of the [OpenAPI 3.0 schema object](https://spec.openapis.org/oas/v3.0.3#schema) object. When this field is set, you must also set the `response_mime_type` to `application/json`. Deprecated: Use `response_format` instead. */ responseSchema?: Schema; /** Optional. Routing configuration. This field is not supported in Gemini API. */ routingConfig?: GenerationConfigRoutingConfig; /** Optional. A seed for the random number generator. By setting a seed, you can make the model's output mostly deterministic. For a given prompt and parameters (like temperature, top_p, etc.), the model will produce the same response every time. However, it's not a guaranteed absolute deterministic behavior. This is different from parameters like `temperature`, which control the *level* of randomness. `seed` ensures that the "random" choices the model makes are the same on every run, making it essential for testing and ensuring reproducible results. */ seed?: number; /** Optional. The speech generation config. */ speechConfig?: SpeechConfig; /** Optional. A list of character sequences that will stop the model from generating further tokens. If a stop sequence is generated, the output will end at that point. This is useful for controlling the length and structure of the output. For example, you can use ["\n", "###"] to stop generation at a new line or a specific marker. */ stopSequences?: string[]; /** Optional. Controls the randomness of the output. A higher temperature results in more creative and diverse responses, while a lower temperature makes the output more predictable and focused. The valid range is (0.0, 2.0]. */ temperature?: number; /** Optional. Configuration for thinking features. An error will be returned if this field is set for models that don't support thinking. */ thinkingConfig?: ThinkingConfig; /** Optional. Specifies the top-k sampling threshold. The model considers only the top k most probable tokens for the next token. This can be useful for generating more coherent and less random text. For example, a `top_k` of 40 means the model will choose the next word from the 40 most likely words. */ topK?: number; /** Optional. Specifies the nucleus sampling threshold. The model considers only the smallest set of tokens whose cumulative probability is at least `top_p`. This helps generate more diverse and less repetitive responses. For example, a `top_p` of 0.9 means the model considers tokens until the cumulative probability of the tokens to select from reaches 0.9. It's recommended to adjust either temperature or `top_p`, but not both. */ topP?: number; /** Optional. Enables enhanced civic answers. It may not be available for all models. This field is not supported in Vertex AI. */ enableEnhancedCivicAnswers?: boolean; /** Optional. Config for translation. */ translationConfig?: TranslationConfig; } /** * Configuration parameters for model interactions. */ declare type GenerationConfig_2 = { /** * The configuration for image interaction. * * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. */ image_config?: ImageConfig_2 | undefined; /** * The maximum number of tokens to include in the response. */ max_output_tokens?: number | undefined; /** * Seed used in decoding for reproducibility. */ seed?: number | undefined; /** * Optional. Speech and multi-speaker configuration. */ speech_config?: SpeakerConfig | Array | undefined; /** * A list of character sequences that will stop output interaction. */ stop_sequences?: Array | undefined; /** * When true, the arguments of a single function call stream out in multiple * * @remarks * `arguments_delta` pieces. Independent of the tool choice mode. */ stream_function_call_arguments?: boolean | undefined; /** * Controls the randomness of the output. * * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. */ temperature?: number | undefined; thinking_level?: ThinkingLevel_2 | undefined; thinking_summaries?: ThinkingSummaries | undefined; /** * The tool choice configuration. */ tool_choice?: ToolChoiceConfig | ToolChoiceType | undefined; /** * The maximum cumulative probability of tokens to consider when sampling. * * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. */ top_p?: number | undefined; /** * Configuration for speech recognition (transcription). */ transcription_config?: TranscriptionConfig | undefined; /** * Configuration options for video generation. */ video_config?: VideoConfig | undefined; }; /** The configuration for routing the request to a specific model. This can be used to control which model is used for the generation, either automatically or by specifying a model name. This data type is not supported in Gemini API. */ export declare interface GenerationConfigRoutingConfig { /** In this mode, the model is selected automatically based on the content of the request. */ autoMode?: GenerationConfigRoutingConfigAutoRoutingMode; /** In this mode, the model is specified manually. */ manualMode?: GenerationConfigRoutingConfigManualRoutingMode; } /** The configuration for automated routing. When automated routing is specified, the routing will be determined by the pretrained routing model and customer provided model routing preference. This data type is not supported in Gemini API. */ export declare interface GenerationConfigRoutingConfigAutoRoutingMode { /** The model routing preference. */ modelRoutingPreference?: 'UNKNOWN' | 'PRIORITIZE_QUALITY' | 'BALANCED' | 'PRIORITIZE_COST'; } /** The configuration for manual routing. When manual routing is specified, the model will be selected based on the model name provided. This data type is not supported in Gemini API. */ export declare interface GenerationConfigRoutingConfigManualRoutingMode { /** The name of the model to use. Only public LLM models are accepted. */ modelName?: string; } /** * Config for thinking feature. * * @deprecated This interface will be deprecated. Please use `ThinkingConfig` instead. */ export declare interface GenerationConfigThinkingConfig extends ThinkingConfig { } /** Configuration for persisting output assets to external storage. */ export declare interface GenerationOutputConfig { /** Optional. The Cloud Storage URI prefix or directory where generated media assets should be written (e.g. "gs://my-bucket/prefix/"). Supported URI schemes: "gs://". When set, media bytes are written directly to this location and returned as FileData with a file_uri instead of raw inline bytes. */ outputUriPrefix?: string; } /** * @license * Copyright 2026 Google LLC * SPDX-License-Identifier: Apache-2.0 * * g3-prettier-ignore-file */ declare type GetAgentGlobals = { /** * API version for request routing. */ api_version?: string | undefined; }; declare type GetAgentParams = Omit; declare type GetAgentRequest = { /** * API version for request routing. */ api_version?: string | undefined; /** * Required. The name of the agent to retrieve. */ id: string; }; /** * @license * Copyright 2026 Google LLC * SPDX-License-Identifier: Apache-2.0 * * g3-prettier-ignore-file */ declare type GetAgentTemplateGlobals = { /** * API version for request routing. */ api_version?: string | undefined; }; declare type GetAgentTemplateParams = Omit; declare type GetAgentTemplateRequest = { /** * API version for request routing. */ api_version?: string | undefined; /** * Required. The name of the agent template to retrieve. */ id: string; }; /** Optional parameters. */ export declare interface GetBatchJobConfig { /** Used to override HTTP request options. */ httpOptions?: HttpOptions; /** Abort signal which can be used to cancel the request. NOTE: AbortSignal is a client-only operation. Using it to cancel an operation will not cancel the request in the service. You will still be charged usage for any applicable operations. */ abortSignal?: AbortSignal; } /** Config for batches.get parameters. */ export declare interface GetBatchJobParameters { /** A fully-qualified BatchJob resource name or ID. Example: "projects/.../locations/.../batchPredictionJobs/456" or "456" when project and location are initialized in the client. */ name: string; /** Optional parameters for the request. */ config?: GetBatchJobConfig; } /** Optional parameters for caches.get method. */ export declare interface GetCachedContentConfig { /** Used to override HTTP request options. */ httpOptions?: HttpOptions; /** Abort signal which can be used to cancel the request. NOTE: AbortSignal is a client-only operation. Using it to cancel an operation will not cancel the request in the service. You will still be charged usage for any applicable operations. */ abortSignal?: AbortSignal; } /** Parameters for caches.get method. */ export declare interface GetCachedContentParameters { /** The server-generated resource name of the cached content. */ name: string; /** Optional parameters for the request. */ config?: GetCachedContentConfig; } /** * @license * Copyright 2026 Google LLC * SPDX-License-Identifier: Apache-2.0 * * g3-prettier-ignore-file */ declare type GetCredentialGlobals = { /** * API version for request routing. */ api_version?: string | undefined; }; declare type GetCredentialParams = Omit; declare type GetCredentialRequest = { /** * API version for request routing. */ api_version?: string | undefined; /** * Required. Resource ID segment making up resource `name`. It identifies the resource * * @remarks * within its parent collection as described in https://google.aip.dev/122. */ id: string; }; /** Optional Config. */ export declare interface GetDocumentConfig { /** Used to override HTTP request options. */ httpOptions?: HttpOptions; /** Abort signal which can be used to cancel the request. NOTE: AbortSignal is a client-only operation. Using it to cancel an operation will not cancel the request in the service. You will still be charged usage for any applicable operations. */ abortSignal?: AbortSignal; } /** Parameters for documents.get. */ export declare interface GetDocumentParameters { /** The resource name of the Document. Example: fileSearchStores/file-search-store-foo/documents/documents-bar */ name: string; /** Optional parameters for the request. */ config?: GetDocumentConfig; } /** * @license * Copyright 2026 Google LLC * SPDX-License-Identifier: Apache-2.0 * * g3-prettier-ignore-file */ declare type GetEnvironmentFilesGlobals = { /** * API version for request routing. */ api_version?: string | undefined; }; declare type GetEnvironmentFilesParams = Omit; declare type GetEnvironmentFilesRequest = { /** * API version for request routing. */ api_version?: string | undefined; /** * The ID of the environment whose snapshot to read. */ environment: string; /** * Path of the file or directory inside the environment workspace, relative to its root (e.g. src). */ path: string; /** * Optional. Maximum number of entries to return per page (for directory listing). */ page_size?: number | undefined; /** * Optional. Pagination token for directory listing. */ page_token?: string | undefined; /** * Optional. If true and the path is a directory, recursively lists all files. */ recursive?: boolean | undefined; }; declare type GetEnvironmentFilesResponse$ = GetEnvironmentFilesResponse; /** * Response for getting an environment's files. */ declare type GetEnvironmentFilesResponse = { /** * If the requested path is a directory, this contains its contents. * * @remarks * If the requested path is a file, this contains a single entry with the * file's metadata. * If alt=media was specified, this is empty (content is served via `blob`). */ files?: Array | undefined; /** * Pagination token for directory listing. * * @remarks * NOLINT */ next_page_token?: string | undefined; }; /** * @license * Copyright 2026 Google LLC * SPDX-License-Identifier: Apache-2.0 * * g3-prettier-ignore-file */ declare type GetEnvironmentGlobals = { /** * API version for request routing. */ api_version?: string | undefined; }; declare type GetEnvironmentParams = Omit; declare type GetEnvironmentRequest = { /** * API version for request routing. */ api_version?: string | undefined; /** * Required. Resource ID segment making up resource `name`. It identifies the resource * * @remarks * within its parent collection as described in https://google.aip.dev/122. */ id: string; }; /** Used to override the default configuration. */ export declare interface GetFileConfig { /** Used to override HTTP request options. */ httpOptions?: HttpOptions; /** Abort signal which can be used to cancel the request. NOTE: AbortSignal is a client-only operation. Using it to cancel an operation will not cancel the request in the service. You will still be charged usage for any applicable operations. */ abortSignal?: AbortSignal; } /** Generates the parameters for the get method. */ export declare interface GetFileParameters { /** The name identifier for the file to retrieve. */ name: string; /** Used to override the default configuration. */ config?: GetFileConfig; } /** Optional parameters for getting a FileSearchStore. */ export declare interface GetFileSearchStoreConfig { /** Used to override HTTP request options. */ httpOptions?: HttpOptions; /** Abort signal which can be used to cancel the request. NOTE: AbortSignal is a client-only operation. Using it to cancel an operation will not cancel the request in the service. You will still be charged usage for any applicable operations. */ abortSignal?: AbortSignal; } /** Config for file_search_stores.get parameters. */ export declare interface GetFileSearchStoreParameters { /** The resource name of the FileSearchStore. Example: `fileSearchStores/my-file-search-store-123` */ name: string; /** Optional parameters for the request. */ config?: GetFileSearchStoreConfig; } declare type GetInteractionByIdGlobals = { /** * API version for request routing. */ api_version?: string | undefined; }; declare type GetInteractionByIdParams = Omit; declare type GetInteractionByIdParamsNonStreaming = GetInteractionByIdParams & { stream?: false | undefined; }; declare type GetInteractionByIdParamsStreaming = GetInteractionByIdParams & { stream: true; }; declare type GetInteractionByIdRequest = { /** * API version for request routing. */ api_version?: string | undefined; /** * If true, includes the input in the response. */ include_input?: boolean | undefined; /** * Required. The name of the interaction to retrieve. */ id: string; /** * If set, resumes the interaction stream from the chunk after the event * * @remarks * marked by the event id. Can only be used if `stream` is true. */ last_event_id?: string | undefined; /** * If true, streams the interaction events as Server-Sent Events. */ stream?: boolean | undefined; }; declare type GetInteractionByIdResponse = interactions.Interaction | Stream; /** Optional parameters for models.get method. */ export declare interface GetModelConfig { /** Used to override HTTP request options. */ httpOptions?: HttpOptions; /** Abort signal which can be used to cancel the request. NOTE: AbortSignal is a client-only operation. Using it to cancel an operation will not cancel the request in the service. You will still be charged usage for any applicable operations. */ abortSignal?: AbortSignal; } export declare interface GetModelParameters { model: string; /** Optional parameters for the request. */ config?: GetModelConfig; } export declare interface GetOperationConfig { /** Used to override HTTP request options. */ httpOptions?: HttpOptions; /** Abort signal which can be used to cancel the request. NOTE: AbortSignal is a client-only operation. Using it to cancel an operation will not cancel the request in the service. You will still be charged usage for any applicable operations. */ abortSignal?: AbortSignal; } /** Parameters for the GET method. */ export declare interface GetOperationParameters { /** The server-assigned name for the operation. */ operationName: string; /** Used to override the default configuration. */ config?: GetOperationConfig; } /** * @license * Copyright 2026 Google LLC * SPDX-License-Identifier: Apache-2.0 * * g3-prettier-ignore-file */ declare type GetTriggerGlobals = { /** * API version for request routing. */ api_version?: string | undefined; }; declare type GetTriggerParams = Omit; declare type GetTriggerRequest = { /** * API version for request routing. */ api_version?: string | undefined; /** * Required. Resource name of the trigger. */ id: string; }; /** Optional parameters for tunings.get method. */ export declare interface GetTuningJobConfig { /** Used to override HTTP request options. */ httpOptions?: HttpOptions; /** Abort signal which can be used to cancel the request. NOTE: AbortSignal is a client-only operation. Using it to cancel an operation will not cancel the request in the service. You will still be charged usage for any applicable operations. */ abortSignal?: AbortSignal; } /** Parameters for the get method. */ export declare interface GetTuningJobParameters { name: string; /** Optional parameters for the request. */ config?: GetTuningJobConfig; } /** * @license * Copyright 2026 Google LLC * SPDX-License-Identifier: Apache-2.0 * * g3-prettier-ignore-file */ declare type GetVoiceGlobals = { /** * API version for request routing. */ api_version?: string | undefined; }; declare type GetVoiceParams = Omit; declare type GetVoiceRequest = { /** * API version for request routing. */ api_version?: string | undefined; /** * Required. The resource name of the custom stored voice to retrieve * * @remarks * (for example, `voices/voice_abc123def456`). */ id: string; }; /** * @license * Copyright 2026 Google LLC * SPDX-License-Identifier: Apache-2.0 * * g3-prettier-ignore-file */ declare type GetWebhookGlobals = { /** * API version for request routing. */ api_version?: string | undefined; }; declare type GetWebhookParams = Omit; declare type GetWebhookRequest = { /** * API version for request routing. */ api_version?: string | undefined; /** * Required. The ID of the webhook to retrieve. */ id: string; }; /** * The Google GenAI SDK. * * @remarks * Provides access to the GenAI features through either the {@link * https://cloud.google.com/vertex-ai/docs/reference/rest | Gemini API} or * the {@link https://cloud.google.com/vertex-ai/docs/reference/rest | Vertex AI * API}. * * The {@link GoogleGenAIOptions.vertexai} value determines which of the API * services to use. * * When using the Gemini API, a {@link GoogleGenAIOptions.apiKey} must also be * set. When using Vertex AI, both {@link GoogleGenAIOptions.project} and {@link * GoogleGenAIOptions.location} must be set, or a {@link * GoogleGenAIOptions.apiKey} must be set when using Express Mode. * * Explicitly passed in values in {@link GoogleGenAIOptions} will always take * precedence over environment variables. If both project/location and api_key * exist in the environment variables, the project/location will be used. * * @example * Initializing the SDK for using the Gemini API: * ```ts * import {GoogleGenAI} from '@google/genai'; * const ai = new GoogleGenAI({apiKey: 'GEMINI_API_KEY'}); * ``` * * @example * Initializing the SDK for using the Vertex AI API: * ```ts * import {GoogleGenAI} from '@google/genai'; * const ai = new GoogleGenAI({ * vertexai: true, * project: 'PROJECT_ID', * location: 'PROJECT_LOCATION' * }); * ``` * */ export declare class GoogleGenAI { protected readonly apiClient: ApiClient; private readonly apiKey?; readonly vertexai: boolean; private readonly googleAuthOptions?; private readonly project?; private readonly location?; private readonly apiVersion?; private readonly httpOptions?; readonly models: Models; readonly live: Live; readonly batches: Batches; readonly chats: Chats; readonly caches: Caches; readonly files: Files; readonly operations: Operations; readonly authTokens: Tokens; readonly tunings: Tunings; readonly fileSearchStores: FileSearchStores; private _interactions; private _webhooks; private _agents; private _environments; private _credentials; private _voices; private _decisions; private _nextGenClient; private _triggers; private getNextGenClient; get interactions(): GeminiNextGenInteractions; get webhooks(): GeminiNextGenWebhooks; get agents(): GeminiNextGenAgents; get triggers(): GeminiNextGenTriggers; get environments(): GeminiNextGenEnvironments; get credentials(): GeminiNextGenCredentials; get voices(): GeminiNextGenVoices; get decisions(): GeminiNextGenDecisions; constructor(options?: GoogleGenAIOptions); } declare class GoogleGenAI_2 extends ClientSDK { private _environments?; get environments(): Environments_2; private _agents?; get agents(): Agents_2; private _credentials?; get credentials(): Credentials_2; private _decisions?; get decisions(): Decisions_2; private _interactions?; get interactions(): Interactions_2; private _triggers?; get triggers(): Triggers_2; private _voices?; get voices(): Voices_2; private _webhooks?; get webhooks(): Webhooks_2; } export declare type GoogleGenAIInteraction = GoogleGenAIResponseWithSdkHttpResponse & { steps: Interactions.Step[]; }>; /** * Google Gen AI SDK's configuration options. * * See {@link GoogleGenAI} for usage samples. */ export declare interface GoogleGenAIOptions { /** * Optional. Determines whether to use the Vertex AI or the Gemini API. * * @remarks * When true, the {@link https://cloud.google.com/vertex-ai/docs/reference/rest | Gemini platform API} will used. * When false, the {@link https://aistudio.google.com/api-reference | Gemini API} will be used. * When both enterprise and vertexai are set, and they have different values, * an Error will be thrown. * * If unset, default SDK behavior is to use the Gemini API service. */ enterprise?: boolean; /** * Optional. Determines whether to use the Vertex AI (now Gemini platform) or the Gemini API. * The `enterprise` flag is recommended instead. * * @remarks * When true, the {@link https://cloud.google.com/vertex-ai/docs/reference/rest | Vertex AI API} will used. * When false, the {@link https://aistudio.google.com/api-reference | Gemini API} will be used. * When both enterprise and vertexai are set, and they have different values, * an Error will be thrown. * * If unset, default SDK behavior is to use the Gemini API service. */ vertexai?: boolean; /** * Optional. The Google Cloud project ID for Vertex AI clients. * * Find your project ID: https://cloud.google.com/resource-manager/docs/creating-managing-projects#identifying_projects * * @remarks * Only supported on Node runtimes, ignored on browser runtimes. */ project?: string; /** * Optional. The Google Cloud project {@link https://cloud.google.com/vertex-ai/generative-ai/docs/learn/locations | location} for Vertex AI clients. * * @remarks * Only supported on Node runtimes, ignored on browser runtimes. * */ location?: string; /** * The API Key, required for Gemini API clients. * * @remarks * Required on browser runtimes. */ apiKey?: string; /** * Optional. The API version to use. * * @remarks * If neither this nor `httpOptions.apiVersion` is set, the * `GOOGLE_GENAI_API_VERSION` environment variable (Node runtimes only) is * used if set; otherwise the default API version for the backend is used. */ apiVersion?: string; /** * Optional. Authentication options defined by the by google-auth-library for Vertex AI clients. * * @remarks * @see {@link https://github.com/googleapis/google-auth-library-nodejs/blob/v9.15.0/src/auth/googleauth.ts | GoogleAuthOptions interface in google-auth-library-nodejs}. * * Only supported on Node runtimes, ignored on browser runtimes. * */ googleAuthOptions?: GoogleAuthOptions; /** * Optional. A set of customizable configuration for HTTP requests. */ httpOptions?: HttpOptions; } declare interface GoogleGenAIParentClient { isVertexAI(): boolean; getProject(): string | undefined; getLocation(): string | undefined; getBaseUrl(): string; getWebsocketBaseUrl?(): string; getApiVersion(): string; getApiKey?(): string | undefined; getDefaultHeaders?(): Record; getHeaders?(): Record | undefined; getAuthHeaders(url?: string): Headers | Promise; getFetch?(): Fetcher | undefined; getTimeout?(): number | undefined; } export declare type GoogleGenAIRequestOptions = { /** * Sets a timeout, in milliseconds, on HTTP requests made by an SDK method. If * `fetchOptions.signal` is set then it will take precedence over this option. * * For `interactions.create()` with automatic continuation enabled (the * default), this bounds the whole call across continuation hops: each hop is * sent with the time left, and once it runs out the call stops with a * `ContinuationInterruptedError`. See `AutomaticContinuationOption`. */ timeout_ms?: number; /** * Set or override a retry policy on HTTP calls. */ retries?: RetryConfig; /** * Specifies the status codes which should be retried using the given retry policy. */ retry_codes?: string[]; /** * Overrides the base server URL that will be used by an operation. */ server_url?: string | URL; /** * @deprecated `fetchOptions` has been flattened into `GoogleGenAIRequestOptions`. * * Sets various request options on the `fetch` call made by an SDK method. * * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options|Request} */ fetch_options?: Omit; /** * Additional query parameters to set on the request URL. Entries replace * any query parameters of the same name produced by the operation. Entries * with null or undefined values are skipped, array values are encoded as * repeated keys and plain object values are JSON-encoded. */ extra_query?: Record; /** * Additional fields to merge into the JSON object request body. Entries * replace any fields of the same name produced by the operation. Entries * with undefined values are skipped. Setting this option on an operation * whose request body is not a JSON object results in an error. */ extra_body?: Record; timeout?: number; maxRetries?: number; defaultBaseURL?: string; fetchOptions?: Omit; query?: unknown; body?: unknown; } & Omit; export declare type GoogleGenAIResponseWithSdkHttpResponse = T & { sdkHttpResponse?: GoogleGenAISdkHttpResponse; }; export declare type GoogleGenAISdkHttpResponse = { headers?: Record; responseInternal: Response; json(): Promise; }; declare type GoogleMaps$ = GoogleMaps_2; declare type GoogleMaps$2 = GoogleMaps_2; /** Tool to retrieve knowledge from Google Maps. */ export declare interface GoogleMaps { /** The authentication config to access the API. Only API key is supported. This field is not supported in Gemini API. */ authConfig?: AuthConfig; /** Deprecated. The Google Maps contextual widget behavior in Grounding with Google Maps is being deprecated; this field is planned for removal and no longer has any effect once removed. Optional. Whether to return a widget context token in the GroundingMetadata of the response. */ enableWidget?: boolean; /** Optional. Specifies the types of Google Maps grounding to enable. Defaults to `places` when unset, and to `places` and `routing` for Gemini 4 and later models. When set, only the listed types are enabled; for example, setting only `places` disables routing. This field is not supported in Gemini API. */ groundingTypes?: GoogleMapsGroundingTypes; } /** * @license * Copyright 2026 Google LLC * SPDX-License-Identifier: Apache-2.0 * * g3-prettier-ignore-file */ /** * A tool that can be used by the model to call Google Maps. */ declare type GoogleMaps_2 = { /** * Whether to return a widget context token in the tool call result of the * * @remarks * response. */ enable_widget?: boolean | undefined; /** * The latitude of the user's location. */ latitude?: number | undefined; /** * The longitude of the user's location. */ longitude?: number | undefined; type: "google_maps"; }; declare type GoogleMapsCall$ = GoogleMapsCallDelta; declare type GoogleMapsCallArguments$ = GoogleMapsCallArguments; /** * @license * Copyright 2026 Google LLC * SPDX-License-Identifier: Apache-2.0 * * g3-prettier-ignore-file */ /** * The arguments to pass to the Google Maps tool. */ declare type GoogleMapsCallArguments = { /** * The queries to be executed. */ queries?: Array | undefined; }; declare type GoogleMapsCallDelta = { /** * The arguments to pass to the Google Maps tool. */ arguments?: GoogleMapsCallArguments | undefined; /** * A signature hash for backend validation. */ signature?: string | undefined; type: "google_maps_call"; }; declare type GoogleMapsCallStep$ = GoogleMapsCallStep; /** * Google Maps call step. */ declare type GoogleMapsCallStep = { /** * The arguments to pass to the Google Maps tool. */ arguments?: GoogleMapsCallArguments | undefined; /** * Required. A unique ID for this specific tool call. */ id: string; /** * A signature hash for backend validation. */ signature?: string | undefined; type: "google_maps_call"; }; /** Defines the types of Google Maps grounding that can be enabled and their configurations. This data type is not supported in Gemini API. */ export declare interface GoogleMapsGroundingTypes { /** Optional. Enables grounding with Google Maps Places. This is the default grounding type when no `GroundingTypes` are specified. */ places?: GoogleMapsPlaces; /** Optional. Enables grounding with Google Maps Routing APIs (ComputeRoutes and SearchAlongRoute). Also enabled by default for Gemini 4 and later models when no `GroundingTypes` are specified. */ routing?: GoogleMapsRouting; } /** Grounding with Google Maps Places data (e.g. QueryPlaces). This is the default Google Maps grounding type when no other type is specified. This data type is not supported in Gemini API. */ export declare interface GoogleMapsPlaces { } declare type GoogleMapsResult$ = GoogleMapsResult; declare type GoogleMapsResult$2 = GoogleMapsResultDelta; /** * The result of the Google Maps. */ declare type GoogleMapsResult = { places?: Array | undefined; widget_context_token?: string | undefined; }; declare type GoogleMapsResultDelta = { /** * The results of the Google Maps. */ result?: Array | undefined; /** * A signature hash for backend validation. */ signature?: string | undefined; type: "google_maps_result"; }; declare type GoogleMapsResultPlaces = { name?: string | undefined; place_id?: string | undefined; review_snippets?: Array | undefined; url?: string | undefined; }; declare type GoogleMapsResultStep$ = GoogleMapsResultStep; /** * Google Maps result step. */ declare type GoogleMapsResultStep = { /** * Required. ID to match the ID from the function call block. */ call_id: string; result: Array; /** * A signature hash for backend validation. */ signature?: string | undefined; type: "google_maps_result"; }; /** Grounding with Google Maps Routing APIs (ComputeRoutes and SearchAlongRoute). Also enabled by default for Gemini 4 and later models when no grounding type is specified. This data type is not supported in Gemini API. */ export declare interface GoogleMapsRouting { } /** The `Status` type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by [gRPC](https://github.com/grpc). Each `Status` message contains three pieces of data: error code, error message, and error details. You can find out more about this error model and how to work with it in the [API Design Guide](https://cloud.google.com/apis/design/errors). This data type is not supported in Gemini API. */ export declare interface GoogleRpcStatus { /** The status code, which should be an enum value of google.rpc.Code. */ code?: number; /** A list of messages that carry the error details. There is a common set of message types for APIs to use. */ details?: Record[]; /** A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the google.rpc.Status.details field, or localized by the client. */ message?: string; } declare type GoogleSearch$ = GoogleSearch_2; declare type GoogleSearch$2 = GoogleSearch_2; /** GoogleSearch tool type. Tool to support Google Search in Model. Powered by Google. */ export declare interface GoogleSearch { /** Optional. Sites with confidence level chosen & above this value will be blocked from the search results. This field is not supported in Gemini API. */ blockingConfidence?: PhishBlockThreshold; /** Optional. List of domains to be excluded from the search results. The default limit is 2000 domains. Example: ["amazon.com", "facebook.com"]. This field is not supported in Gemini API. */ excludeDomains?: string[]; /** Optional. The set of search types to enable. If not set, web search is enabled by default. */ searchTypes?: SearchTypes; /** Optional. Filter search results to a specific time range. If customers set a start time, they must set an end time (and vice versa). This field is not supported in Vertex AI. */ timeRangeFilter?: Interval; } /** * A tool that can be used by the model to search Google. */ declare type GoogleSearch_2 = { /** * The types of search grounding to enable. */ search_types?: Array | undefined; type: "google_search"; }; declare type GoogleSearchCall$ = GoogleSearchCallDelta; declare type GoogleSearchCallArguments$ = GoogleSearchCallArguments; /** * @license * Copyright 2026 Google LLC * SPDX-License-Identifier: Apache-2.0 * * g3-prettier-ignore-file */ /** * The arguments to pass to Google Search. */ declare type GoogleSearchCallArguments = { /** * Web search queries for the following-up web search. */ queries?: Array | undefined; }; declare type GoogleSearchCallDelta = { /** * The arguments to pass to Google Search. */ arguments: GoogleSearchCallArguments; /** * A signature hash for backend validation. */ signature?: string | undefined; type: "google_search_call"; }; declare type GoogleSearchCallStep$ = GoogleSearchCallStep; /** * Google Search call step. */ declare type GoogleSearchCallStep = { /** * The arguments to pass to Google Search. */ arguments: GoogleSearchCallArguments; /** * Required. A unique ID for this specific tool call. */ id: string; /** * The type of search grounding enabled. */ search_type?: GoogleSearchCallStepSearchType | undefined; /** * A signature hash for backend validation. */ signature?: string | undefined; type: "google_search_call"; }; /** * The type of search grounding enabled. */ declare type GoogleSearchCallStepSearchType = "web_search" | "image_search" | "enterprise_web_search" | (string & {}); declare type GoogleSearchResult$ = GoogleSearchResult; declare type GoogleSearchResult$2 = GoogleSearchResultDelta; /** * @license * Copyright 2026 Google LLC * SPDX-License-Identifier: Apache-2.0 * * g3-prettier-ignore-file */ /** * The result of the Google Search. */ declare type GoogleSearchResult = { /** * Web content snippet that can be embedded in a web page or an app webview. */ search_suggestions?: string | undefined; }; declare type GoogleSearchResultDelta = { is_error?: boolean | undefined; result: Array; /** * A signature hash for backend validation. */ signature?: string | undefined; type: "google_search_result"; }; declare type GoogleSearchResultStep$ = GoogleSearchResultStep; /** * Google Search result step. */ declare type GoogleSearchResultStep = { /** * Required. ID to match the ID from the function call block. */ call_id: string; /** * Whether the Google Search resulted in an error. */ is_error?: boolean | undefined; /** * Required. The results of the Google Search. */ result: Array; /** * A signature hash for backend validation. */ signature?: string | undefined; type: "google_search_result"; }; /** Tool to retrieve public web data for grounding, powered by Google. */ export declare interface GoogleSearchRetrieval { /** Specifies the dynamic retrieval configuration for the given source. */ dynamicRetrievalConfig?: DynamicRetrievalConfig; } /** * @license * Copyright 2026 Google LLC * SPDX-License-Identifier: Apache-2.0 * * g3-prettier-ignore-file */ declare type GoogleSearchSearchType = "web_search" | "image_search" | "enterprise_web_search" | (string & {}); /** Represents a whole or partial calendar date, such as a birthday. The time of day and time zone are either specified elsewhere or are insignificant. The date is relative to the Gregorian Calendar. This can represent one of the following: * A full date, with non-zero year, month, and day values. * A month and day, with a zero year (for example, an anniversary). * A year on its own, with a zero month and a zero day. * A year and month, with a zero day (for example, a credit card expiration date). Related types: * google.type.TimeOfDay * google.type.DateTime * google.protobuf.Timestamp. This data type is not supported in Gemini API. */ export declare interface GoogleTypeDate { /** Day of a month. Must be from 1 to 31 and valid for the year and month, or 0 to specify a year by itself or a year and month where the day isn't significant. */ day?: number; /** Month of a year. Must be from 1 to 12, or 0 to specify a year without a month and day. */ month?: number; /** Year of the date. Must be from 1 to 9999, or 0 to specify a date without a year. */ year?: number; } /** A piece of evidence that supports a claim made by the model. This is used to show a citation for a claim made by the model. When grounding is enabled, the model returns a `GroundingChunk` that contains a reference to the source of the information. */ export declare interface GroundingChunk { /** A `Maps` chunk is a piece of evidence that comes from Google Maps. It contains information about a place, such as its name, address, and reviews. This is used to provide the user with rich, location-based information. */ maps?: GroundingChunkMaps; /** A grounding chunk from an image search result. See the `Image` message for details. */ image?: GroundingChunkImage; /** A grounding chunk from a data source retrieved by a retrieval tool, such as Vertex AI Search. See the `RetrievedContext` message for details */ retrievedContext?: GroundingChunkRetrievedContext; /** A grounding chunk from a web page, typically from Google Search. See the `Web` message for details. */ web?: GroundingChunkWeb; } /** User provided metadata about the GroundingFact. This data type is not supported in Vertex AI. */ export declare interface GroundingChunkCustomMetadata { /** The key of the metadata. */ key?: string; /** Optional. The numeric value of the metadata. The expected range for this value depends on the specific `key` used. */ numericValue?: number; /** Optional. A list of string values for the metadata. */ stringListValue?: GroundingChunkStringList; /** Optional. The string value of the metadata. */ stringValue?: string; } /** An `Image` chunk is a piece of evidence that comes from an image search result. It contains the URI of the image search result and the URI of the image. This is used to provide the user with a link to the source of the information. */ export declare interface GroundingChunkImage { /** The domain of the image search result page. */ domain?: string; /** The URI of the image. */ imageUri?: string; /** The URI of the image search result page. */ sourceUri?: string; /** The title of the image search result page. */ title?: string; } /** A `Maps` chunk is a piece of evidence that comes from Google Maps. It contains information about a place, such as its name, address, and reviews. This is used to provide the user with rich, location-based information. */ export declare interface GroundingChunkMaps { /** The sources that were used to generate the place answer. This includes review snippets and photos that were used to generate the answer, as well as URIs to flag content. */ placeAnswerSources?: GroundingChunkMapsPlaceAnswerSources; /** This Place's resource name, in `places/{place_id}` format. This can be used to look up the place in the Google Maps API. */ placeId?: string; /** The text of the place answer. */ text?: string; /** The title of the place. */ title?: string; /** The URI of the place. */ uri?: string; /** Output only. Route information. */ route?: GroundingChunkMapsRoute; } /** The sources that were used to generate the place answer. This includes review snippets and photos that were used to generate the answer, as well as URIs to flag content. */ export declare interface GroundingChunkMapsPlaceAnswerSources { /** Snippets of reviews that were used to generate the answer. */ reviewSnippet?: GroundingChunkMapsPlaceAnswerSourcesReviewSnippet[]; /** A link where users can flag a problem with the generated answer. */ flagContentUri?: string; /** Snippets of reviews that were used to generate the answer. */ reviewSnippets?: GroundingChunkMapsPlaceAnswerSourcesReviewSnippet[]; } /** Author attribution for a photo or review. */ export declare interface GroundingChunkMapsPlaceAnswerSourcesAuthorAttribution { /** Name of the author of the Photo or Review. */ displayName?: string; /** Profile photo URI of the author of the Photo or Review. */ photoUri?: string; /** URI of the author of the Photo or Review. */ uri?: string; } /** Encapsulates a review snippet. */ export declare interface GroundingChunkMapsPlaceAnswerSourcesReviewSnippet { /** This review's author. */ authorAttribution?: GroundingChunkMapsPlaceAnswerSourcesAuthorAttribution; /** A link where users can flag a problem with the review. */ flagContentUri?: string; /** A link to show the review on Google Maps. */ googleMapsUri?: string; /** A string of formatted recent time, expressing the review time relative to the current time in a form appropriate for the language and country. */ relativePublishTimeDescription?: string; /** A reference representing this place review which may be used to look up this place review again. */ review?: string; /** Id of the review referencing the place. */ reviewId?: string; /** Title of the review. */ title?: string; } /** Route information from Google Maps. This data type is not supported in Gemini API. */ export declare interface GroundingChunkMapsRoute { /** The total distance of the route, in meters. */ distanceMeters?: number; /** The total duration of the route. */ duration?: string; /** An encoded polyline of the route. See https://developers.google.com/maps/documentation/utilities/polylinealgorithm */ encodedPolyline?: string; } /** Context retrieved from a data source to ground the model's response. This is used when a retrieval tool fetches information from a user-provided corpus or a public dataset. */ export declare interface GroundingChunkRetrievedContext { /** Output only. The full resource name of the referenced Vertex AI Search document. This is used to identify the specific document that was retrieved. The format is `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document}`. This field is not supported in Gemini API. */ documentName?: string; /** Additional context for a Retrieval-Augmented Generation (RAG) retrieval result. This is populated only when the RAG retrieval tool is used. This field is not supported in Gemini API. */ ragChunk?: RagChunk; /** The content of the retrieved data source. */ text?: string; /** The title of the retrieved data source. */ title?: string; /** The URI of the retrieved data source. */ uri?: string; /** Optional. User-provided metadata about the retrieved context. This field is not supported in Vertex AI. */ customMetadata?: GroundingChunkCustomMetadata[]; /** Optional. Name of the `FileSearchStore` containing the document. Example: `fileSearchStores/123`. This field is not supported in Vertex AI. */ fileSearchStore?: string; /** Optional. The media blob resource name for multimodal file search results. Format: fileSearchStores/{file_search_store_id}/media/{blob_id}. This field is not supported in Vertex AI. */ mediaId?: string; /** Optional. Page number of the retrieved context, if applicable. This field is not supported in Vertex AI. */ pageNumber?: number; } /** A list of string values. This data type is not supported in Vertex AI. */ export declare interface GroundingChunkStringList { /** The string values of the list. */ values?: string[]; } /** A `Web` chunk is a piece of evidence that comes from a web page. It contains the URI of the web page, the title of the page, and the domain of the page. This is used to provide the user with a link to the source of the information. */ export declare interface GroundingChunkWeb { /** The domain of the web page that contains the evidence. This can be used to filter out low-quality sources. This field is not supported in Gemini API. */ domain?: string; /** The title of the web page that contains the evidence. */ title?: string; /** The URI of the web page that contains the evidence. */ uri?: string; } /** Information for various kinds of grounding. */ export declare interface GroundingMetadata { /** A list of supporting references retrieved from the grounding source. This field is populated when the grounding source is Google Search, Vertex AI Search, or Google Maps. */ groundingChunks?: GroundingChunk[]; /** List of grounding support. */ groundingSupports?: GroundingSupport[]; /** Metadata related to retrieval in the grounding flow. */ retrievalMetadata?: RetrievalMetadata; /** Optional. Google search entry for the following-up web searches. */ searchEntryPoint?: SearchEntryPoint; /** Web search queries for the following-up web search. */ webSearchQueries?: string[]; /** Optional. Output only. Deprecated: The Google Maps contextual widget behavior in Grounding with Google Maps is being deprecated; this field is planned for removal and will no longer be populated once removed. A token that can be used to render a Google Maps widget with the contextual data. This field is populated only when the grounding source is Google Maps. */ googleMapsWidgetContextToken?: string; /** Optional. The image search queries that were used to generate the content. This field is populated only when the grounding source is Google Search with the Image Search search_type enabled. */ imageSearchQueries?: string[]; /** Optional. The queries that were executed by the retrieval tools. This field is populated only when the grounding source is a retrieval tool, such as Vertex AI Search. This field is not supported in Gemini API. */ retrievalQueries?: string[]; /** Optional. Output only. A list of URIs that can be used to flag a place or review for inappropriate content. This field is populated only when the grounding source is Google Maps. This field is not supported in Gemini API. */ sourceFlaggingUris?: GroundingMetadataSourceFlaggingUri[]; } /** A URI that can be used to flag a place or review for inappropriate content. This is populated only when the grounding source is Google Maps. This data type is not supported in Gemini API. */ export declare interface GroundingMetadataSourceFlaggingUri { /** The URI that can be used to flag the content. */ flagContentUri?: string; /** The ID of the place or review. */ sourceId?: string; } /** Grounding support. */ export declare interface GroundingSupport { /** Confidence score of the support references. Ranges from 0 to 1. 1 is the most confident. This list must have the same size as the grounding_chunk_indices. */ confidenceScores?: number[]; /** A list of indices (into 'grounding_chunk') specifying the citations associated with the claim. For instance [1,3,4] means that grounding_chunk[1], grounding_chunk[3], grounding_chunk[4] are the retrieved content attributed to the claim. */ groundingChunkIndices?: number[]; /** Segment of the content this support belongs to. */ segment?: Segment; /** Indices into the `rendered_parts` field of the `GroundingMetadata` message. These indices specify which rendered parts are associated with this support message. */ renderedParts?: number[]; } declare type GroundingToolCount$ = GroundingToolCount; /** * The number of grounding tool counts. */ declare type GroundingToolCount = { /** * The number of grounding tool counts. */ count?: number | undefined; /** * The grounding tool type associated with the count. */ type?: GroundingToolCountType | undefined; }; /** * @license * Copyright 2026 Google LLC * SPDX-License-Identifier: Apache-2.0 * * g3-prettier-ignore-file */ /** * The grounding tool type associated with the count. */ declare type GroundingToolCountType = "google_search" | "google_maps" | "retrieval" | (string & {}); /** The method for blocking content. If not specified, the default behavior is to use the probability score. This enum is not supported in Gemini API. */ export declare enum HarmBlockMethod { /** * The harm block method is unspecified. */ HARM_BLOCK_METHOD_UNSPECIFIED = "HARM_BLOCK_METHOD_UNSPECIFIED", /** * The harm block method uses both probability and severity scores. */ SEVERITY = "SEVERITY", /** * The harm block method uses the probability score. */ PROBABILITY = "PROBABILITY" } /** The threshold for blocking content. If the harm probability exceeds this threshold, the content will be blocked. */ export declare enum HarmBlockThreshold { /** * The harm block threshold is unspecified. */ HARM_BLOCK_THRESHOLD_UNSPECIFIED = "HARM_BLOCK_THRESHOLD_UNSPECIFIED", /** * Block content with a low harm probability or higher. */ BLOCK_LOW_AND_ABOVE = "BLOCK_LOW_AND_ABOVE", /** * Block content with a medium harm probability or higher. */ BLOCK_MEDIUM_AND_ABOVE = "BLOCK_MEDIUM_AND_ABOVE", /** * Block content with a high harm probability. */ BLOCK_ONLY_HIGH = "BLOCK_ONLY_HIGH", /** * Do not block any content, regardless of its harm probability. */ BLOCK_NONE = "BLOCK_NONE", /** * Turn off the safety filter entirely. */ OFF = "OFF" } declare type HarmCategory$ = HarmCategory_2; /** The harm category to be blocked. */ export declare enum HarmCategory { /** * Default value. This value is unused. */ HARM_CATEGORY_UNSPECIFIED = "HARM_CATEGORY_UNSPECIFIED", /** * Abusive, threatening, or content intended to bully, torment, or ridicule. */ HARM_CATEGORY_HARASSMENT = "HARM_CATEGORY_HARASSMENT", /** * Content that promotes violence or incites hatred against individuals or groups based on certain attributes. */ HARM_CATEGORY_HATE_SPEECH = "HARM_CATEGORY_HATE_SPEECH", /** * Content that contains sexually explicit material. */ HARM_CATEGORY_SEXUALLY_EXPLICIT = "HARM_CATEGORY_SEXUALLY_EXPLICIT", /** * Content that promotes, facilitates, or enables dangerous activities. */ HARM_CATEGORY_DANGEROUS_CONTENT = "HARM_CATEGORY_DANGEROUS_CONTENT", /** * Deprecated: Election filter is not longer supported. The harm category is civic integrity. */ HARM_CATEGORY_CIVIC_INTEGRITY = "HARM_CATEGORY_CIVIC_INTEGRITY", /** * Prompts designed to bypass safety filters. */ HARM_CATEGORY_JAILBREAK = "HARM_CATEGORY_JAILBREAK", /** * Images that contain hate speech. This enum value is not supported in Gemini API. */ HARM_CATEGORY_IMAGE_HATE = "HARM_CATEGORY_IMAGE_HATE", /** * Images that contain dangerous content. This enum value is not supported in Gemini API. */ HARM_CATEGORY_IMAGE_DANGEROUS_CONTENT = "HARM_CATEGORY_IMAGE_DANGEROUS_CONTENT", /** * Images that contain harassment. This enum value is not supported in Gemini API. */ HARM_CATEGORY_IMAGE_HARASSMENT = "HARM_CATEGORY_IMAGE_HARASSMENT", /** * Images that contain sexually explicit content. This enum value is not supported in Gemini API. */ HARM_CATEGORY_IMAGE_SEXUALLY_EXPLICIT = "HARM_CATEGORY_IMAGE_SEXUALLY_EXPLICIT" } /** * @license * Copyright 2026 Google LLC * SPDX-License-Identifier: Apache-2.0 * * g3-prettier-ignore-file */ declare type HarmCategory_2 = "hate_speech" | "dangerous_content" | "harassment" | "sexually_explicit" | "civic_integrity" | "image_hate" | "image_dangerous_content" | "image_harassment" | "image_sexually_explicit" | "jailbreak" | (string & {}); /** Output only. The probability of harm for this category. */ export declare enum HarmProbability { /** * The harm probability is unspecified. */ HARM_PROBABILITY_UNSPECIFIED = "HARM_PROBABILITY_UNSPECIFIED", /** * The harm probability is negligible. */ NEGLIGIBLE = "NEGLIGIBLE", /** * The harm probability is low. */ LOW = "LOW", /** * The harm probability is medium. */ MEDIUM = "MEDIUM", /** * The harm probability is high. */ HIGH = "HIGH" } /** Output only. The severity of harm for this category. This enum is not supported in Gemini API. */ export declare enum HarmSeverity { /** * The harm severity is unspecified. */ HARM_SEVERITY_UNSPECIFIED = "HARM_SEVERITY_UNSPECIFIED", /** * The harm severity is negligible. */ HARM_SEVERITY_NEGLIGIBLE = "HARM_SEVERITY_NEGLIGIBLE", /** * The harm severity is low. */ HARM_SEVERITY_LOW = "HARM_SEVERITY_LOW", /** * The harm severity is medium. */ HARM_SEVERITY_MEDIUM = "HARM_SEVERITY_MEDIUM", /** * The harm severity is high. */ HARM_SEVERITY_HIGH = "HARM_SEVERITY_HIGH" } /** Configuration for history exchange between client and server. */ export declare interface HistoryConfig { /** If true, after sending `setup_complete`, the server will wait and at first process `client_content` messages until `turn_complete` is `true`. This initial history will not trigger a model call and may end with model content. After `turn_complete` is `true`, the client can start the realtime conversation via `realtime_input`. */ initialHistoryInClientContent?: boolean; } declare type HookContext = { base_url: string | URL; operation_id: string; o_auth2_scopes: string[] | null; security_source?: any | (() => Promise); retry_config: RetryConfig; resolved_security: SecurityState | null; options: SDKOptions; timeout_ms?: number; }; declare interface Hooks { /** Registers a hook to be used by the SDK for initialization event. */ registerSDKInitHook(hook: SDKInitHook): void; /** Registers a hook to be used by the SDK for to modify `Request` construction. */ registerBeforeCreateRequestHook(hook: BeforeCreateRequestHook): void; /** Registers a hook to be used by the SDK for the before request event. */ registerBeforeRequestHook(hook: BeforeRequestHook_2): void; /** Registers a hook to be used by the SDK for the after success event. */ registerAfterSuccessHook(hook: AfterSuccessHook): void; /** Registers a hook to be used by the SDK for the after error event. */ registerAfterErrorHook(hook: AfterErrorHook): void; } declare type HttpBearerConfig$ = HttpBearerConfig; /** * @license * Copyright 2026 Google LLC * SPDX-License-Identifier: Apache-2.0 * * g3-prettier-ignore-file */ /** * Configuration for HTTP Bearer token credentials. */ declare type HttpBearerConfig = { /** * Optional. Header name to inject the token into. Defaults to * * @remarks * 'Authorization'. */ header_name?: string | undefined; id: string; /** * Optional. Prefix to prepend to the token. Defaults to 'Bearer'. Set to '' * * @remarks * for no prefix. */ prefix?: string | undefined; /** * Required. Input only. The static bearer token. Write-only; never returned in responses. */ token: string; type: "bearer_token"; }; declare type HttpBearerConfigParams = Omit & HttpBearerConfig; declare type HttpBearerUpdateConfig$ = HttpBearerUpdateConfig; /** * @license * Copyright 2026 Google LLC * SPDX-License-Identifier: Apache-2.0 * * g3-prettier-ignore-file */ /** * Configuration for updating HTTP Bearer token credentials. */ declare type HttpBearerUpdateConfig = { /** * Optional. Header name to inject the token into. Defaults to * * @remarks * 'Authorization'. */ header_name?: string | undefined; /** * Optional. Prefix to prepend to the token. Defaults to 'Bearer'. Set to '' * * @remarks * for no prefix. */ prefix?: string | undefined; /** * Optional. Input only. The static bearer token. Write-only; never returned in responses. */ token?: string | undefined; type: "bearer_token"; }; declare type HttpBearerUpdateConfigParams = Omit & HttpBearerUpdateConfig; declare class HTTPClient { private fetcher; private requestHooks; private requestErrorHooks; private responseHooks; private options; constructor(options?: HTTPClientOptions); request(request: Request): Promise; /** * Registers a hook that is called before a request is made. The hook function * can mutate the request or return a new request. This may be useful to add * additional information to request such as request IDs and tracing headers. */ addHook(hook: "beforeRequest", fn: BeforeRequestHook): this; /** * Registers a hook that is called when a request cannot be made due to a * network error. */ addHook(hook: "requestError", fn: RequestErrorHook): this; /** * Registers a hook that is called when a response has been received from the * server. */ addHook(hook: "response", fn: ResponseHook): this; /** Removes a hook that was previously registered with `addHook`. */ removeHook(hook: "beforeRequest", fn: BeforeRequestHook): this; /** Removes a hook that was previously registered with `addHook`. */ removeHook(hook: "requestError", fn: RequestErrorHook): this; /** Removes a hook that was previously registered with `addHook`. */ removeHook(hook: "response", fn: ResponseHook): this; clone(): HTTPClient; } /** * @license * Copyright 2026 Google LLC * SPDX-License-Identifier: Apache-2.0 * * g3-prettier-ignore-file */ /** * Base class for all HTTP errors. */ declare class HTTPClientError extends Error { /** The underlying cause of the error. */ readonly cause: unknown; name: string; constructor(message: string, opts?: { cause?: unknown; }); } declare interface HTTPClientOptions { fetcher?: Fetcher; } /** The location of the API key. This enum is not supported in Gemini API. */ export declare enum HttpElementLocation { HTTP_IN_UNSPECIFIED = "HTTP_IN_UNSPECIFIED", /** * Element is in the HTTP request query. */ HTTP_IN_QUERY = "HTTP_IN_QUERY", /** * Element is in the HTTP request header. */ HTTP_IN_HEADER = "HTTP_IN_HEADER", /** * Element is in the HTTP request path. */ HTTP_IN_PATH = "HTTP_IN_PATH", /** * Element is in the HTTP request body. */ HTTP_IN_BODY = "HTTP_IN_BODY", /** * Element is in the HTTP request cookie. */ HTTP_IN_COOKIE = "HTTP_IN_COOKIE" } /** HTTP options to be used in each of the requests. */ export declare interface HttpOptions { /** The base URL for the AI platform service endpoint. */ baseUrl?: string; /** The resource scope used to constructing the resource name when base_url is set */ baseUrlResourceScope?: ResourceScope; /** Specifies the version of the API to use. */ apiVersion?: string; /** Additional HTTP headers to be sent with the request. */ headers?: Record; /** Timeout for the request in milliseconds. */ timeout?: number; /** Extra parameters to add to the request body. The structure must match the backend API's request structure. - Gemini platform backend API docs: https://cloud.google.com/vertex-ai/docs/reference/rest - GeminiAPI backend API docs: https://aistudio.google.com/api-reference */ extraBody?: Record; /** HTTP retry options for the request. */ retryOptions?: HttpRetryOptions; /** Custom fetch implementation to use for network requests. */ fetch?: Fetch; } /** * Represents the necessary information to send a request to an API endpoint. * This interface defines the structure for constructing and executing HTTP * requests. */ declare interface HttpRequest { /** * URL path from the modules, this path is appended to the base API URL to * form the complete request URL. * * If you wish to set full URL, use httpOptions.baseUrl instead. Example to * set full URL in the request: * * const request: HttpRequest = { * path: '', * httpOptions: { * baseUrl: 'https://', * apiVersion: '', * }, * httpMethod: 'GET', * }; * * The result URL will be: https:// * */ path: string; /** * Optional query parameters to be appended to the request URL. */ queryParams?: Record; /** * Optional request body in json string or Blob format, GET request doesn't * need a request body. */ body?: string | Blob; /** * The HTTP method to be used for the request. */ httpMethod: 'GET' | 'POST' | 'PATCH' | 'DELETE'; /** * Optional set of customizable configuration for HTTP requests. */ httpOptions?: types.HttpOptions; /** * Optional abort signal which can be used to cancel the request. */ abortSignal?: AbortSignal; } /** A wrapper class for the http response. */ export declare class HttpResponse { /** Used to retain the processed HTTP headers in the response. */ headers?: Record; /** * The original http response. */ responseInternal: Response; constructor(response: Response); json(): Promise; } /** HTTP retry options to be used in each of the requests. */ export declare interface HttpRetryOptions { /** Maximum number of attempts, including the original request. If 0 or 1, it means no retries. If not specified, default to 5. */ attempts?: number; /** Initial delay before the first retry, in fractions of a second. If not specified, default to 1.0 second. */ initialDelay?: number; /** Maximum delay between retries, in fractions of a second. If not specified, default to 60.0 seconds. */ maxDelay?: number; /** Multiplier by which the delay increases after each attempt. If not specified, default to 2.0. */ expBase?: number; /** Randomness factor for the delay. If not specified, default to 1.0. */ jitter?: number; /** List of HTTP status codes that should trigger a retry. If not specified, a default set of retryable codes (408, 429, and 5xx) may be used. */ httpStatusCodes?: number[]; } /** * @license * Copyright 2026 Google LLC * SPDX-License-Identifier: Apache-2.0 * * g3-prettier-ignore-file */ /** * Config for Hybrid Search. */ declare type HybridSearch = { /** * Optional. Alpha value controls the weight between dense and sparse vector search * * @remarks * results. */ alpha?: number | undefined; }; declare type Image$ = ImageDelta; /** An image. */ declare interface Image_2 { /** The Cloud Storage URI of the image. ``Image`` can contain a value for this field or the ``image_bytes`` field but not both. */ gcsUri?: string; /** The image bytes data. ``Image`` can contain a value for this field or the ``gcs_uri`` field but not both. * @remarks Encoded as base64 string. */ imageBytes?: string; /** The MIME type of the image. */ mimeType?: string; } export { Image_2 as Image } /** The image generation configuration to be used in GenerateContentConfig. */ export declare interface ImageConfig { /** Aspect ratio of the generated images. Supported values are "1:1", "2:3", "3:2", "3:4", "4:3", "9:16", "16:9", and "21:9". */ aspectRatio?: string; /** Optional. Specifies the size of generated images. Supported values are `1K`, `2K`, `4K`. If not specified, the model will use default value `1K`. */ imageSize?: string; /** Controls the generation of people. Supported values are: ALLOW_ALL, ALLOW_ADULT, ALLOW_NONE. */ personGeneration?: string; /** MIME type of the generated image. This field is not supported in Gemini API. */ outputMimeType?: string; /** Compression quality of the generated image (for ``image/jpeg`` only). This field is not supported in Gemini API. */ outputCompressionQuality?: number; /** Optional. The image output format for generated images. This field is not supported in Gemini API. */ imageOutputOptions?: ImageConfigImageOutputOptions; /** Optional. Controls whether prominent people (celebrities) generation is allowed. If used with personGeneration, personGeneration enum would take precedence. For instance, if ALLOW_NONE is set, all person generation would be blocked. If this field is unspecified, the default behavior is to allow prominent people. This field is not supported in Gemini API. */ prominentPeople?: ProminentPeople; } /** * The configuration for image interaction. * * @deprecated class: This will be removed in a future release, please migrate away from it as soon as possible. */ declare type ImageConfig_2 = { /** * The aspect ratio of the image to generate. Supported aspect ratios: 1:1, * * @remarks * 2:3, 3:2, 3:4, 4:3, 9:16, 16:9, 21:9. * * If not specified, the model will choose a default aspect ratio based on any * reference images provided. */ aspect_ratio?: ImageConfigAspectRatio | undefined; /** * Specifies the size of generated images. Supported values are `1K`, `2K`, * * @remarks * `4K`. If not specified, the model will use default value `1K`. */ image_size?: ImageConfigImageSize | undefined; }; /** * @license * Copyright 2026 Google LLC * SPDX-License-Identifier: Apache-2.0 * * g3-prettier-ignore-file */ /** * The aspect ratio of the image to generate. Supported aspect ratios: 1:1, * * @remarks * 2:3, 3:2, 3:4, 4:3, 9:16, 16:9, 21:9. * * If not specified, the model will choose a default aspect ratio based on any * reference images provided. */ declare type ImageConfigAspectRatio = "1:1" | "2:3" | "3:2" | "3:4" | "4:3" | "4:5" | "5:4" | "9:16" | "16:9" | "21:9" | "1:8" | "8:1" | "1:4" | "4:1" | (string & {}); /** The image output format for generated images. This data type is not supported in Gemini API. */ export declare interface ImageConfigImageOutputOptions { /** Optional. The compression quality of the output image. */ compressionQuality?: number; /** Optional. The image format that the output should be saved as. */ mimeType?: string; } /** * Specifies the size of generated images. Supported values are `1K`, `2K`, * * @remarks * `4K`. If not specified, the model will use default value `1K`. */ declare type ImageConfigImageSize = "1K" | "2K" | "4K" | "512" | (string & {}); declare type ImageContent$ = ImageContent; /** * An image content block. */ export declare type ImageContent = { /** * The image content. */ data?: string | undefined; /** * The mime type of the image. */ mime_type?: ImageContentMimeType | undefined; resolution?: MediaResolution_2 | undefined; type: "image"; /** * The URI of the image. */ uri?: string | undefined; }; /** * The mime type of the image. */ declare type ImageContentMimeType = "image/png" | "image/jpeg" | "image/webp" | "image/heic" | "image/heif" | "image/gif" | "image/bmp" | "image/tiff" | (string & {}); declare type ImageDelta = { data?: string | undefined; mime_type?: ImageDeltaMimeType | undefined; resolution?: MediaResolution_2 | undefined; type: "image"; uri?: string | undefined; }; declare type ImageDeltaMimeType = "image/png" | "image/jpeg" | "image/webp" | "image/heic" | "image/heif" | "image/gif" | "image/bmp" | "image/tiff" | (string & {}); /** Enum that specifies the language of the text in the prompt. */ export declare enum ImagePromptLanguage { /** * Auto-detect the language. */ auto = "auto", /** * English */ en = "en", /** * Japanese */ ja = "ja", /** * Korean */ ko = "ko", /** * Hindi */ hi = "hi", /** * Chinese */ zh = "zh", /** * Portuguese */ pt = "pt", /** * Spanish */ es = "es" } /** Resize mode for the image input for video generation. */ export declare enum ImageResizeMode { /** * Crop the image to fit the correct aspect ratio (so we lose parts of the image in the process). */ CROP = "CROP", /** * Pad the image to fit the correct aspect ratio (so we don't lose any parts of the image in the process). */ PAD = "PAD" } declare type ImageResponseFormat$ = ImageResponseFormat_2; /** Configuration for image-specific output formatting. */ export declare class ImageResponseFormat { /** Optional. The aspect ratio for the image output. */ aspectRatio?: AspectRatio; /** Optional. Delivery mode for the generated content. */ delivery?: Delivery; /** Optional. The size of the image output. */ imageSize?: ImageSize; /** Optional. The MIME type of the image output. */ mimeType?: string; } /** * Configuration for image output format. */ declare type ImageResponseFormat_2 = { /** * The aspect ratio for the image output. */ aspect_ratio?: ImageResponseFormatAspectRatio | undefined; /** * The delivery mode for the image output. */ delivery?: ImageResponseFormatDelivery | undefined; /** * The size of the image output. */ image_size?: ImageResponseFormatImageSize | undefined; /** * The MIME type of the image output. */ mime_type?: ImageResponseFormatMimeType | undefined; type: "image"; }; /** * @license * Copyright 2026 Google LLC * SPDX-License-Identifier: Apache-2.0 * * g3-prettier-ignore-file */ /** * The aspect ratio for the image output. */ declare type ImageResponseFormatAspectRatio = "1:1" | "2:3" | "3:2" | "3:4" | "4:3" | "4:5" | "5:4" | "9:16" | "16:9" | "21:9" | "1:8" | "8:1" | "1:4" | "4:1" | (string & {}); /** * The delivery mode for the image output. */ declare type ImageResponseFormatDelivery = "inline" | "uri" | (string & {}); /** * The size of the image output. */ declare type ImageResponseFormatImageSize = "512" | "1K" | "2K" | "4K" | (string & {}); /** * The MIME type of the image output. */ declare type ImageResponseFormatMimeType = "image/jpeg" | (string & {}); /** Image search for grounding and related configurations. */ export declare interface ImageSearch { } /** The size of the image output. */ export declare enum ImageSize { /** * Default value. This value is unused. */ IMAGE_SIZE_UNSPECIFIED = "IMAGE_SIZE_UNSPECIFIED", /** * 512px image size. */ IMAGE_SIZE_FIVE_TWELVE = "IMAGE_SIZE_FIVE_TWELVE", /** * 1K image size. */ IMAGE_SIZE_ONE_K = "IMAGE_SIZE_ONE_K", /** * 2K image size. */ IMAGE_SIZE_TWO_K = "IMAGE_SIZE_TWO_K", /** * 4K image size. */ IMAGE_SIZE_FOUR_K = "IMAGE_SIZE_FOUR_K" } /** Optional parameters for importing a file. */ export declare interface ImportFileConfig { /** Used to override HTTP request options. */ httpOptions?: HttpOptions; /** Abort signal which can be used to cancel the request. NOTE: AbortSignal is a client-only operation. Using it to cancel an operation will not cancel the request in the service. You will still be charged usage for any applicable operations. */ abortSignal?: AbortSignal; /** User provided custom metadata stored as key-value pairs used for querying. */ customMetadata?: CustomMetadata[]; /** Config for telling the service how to chunk the file. */ chunkingConfig?: ChunkingConfig; } /** Long-running operation for importing a file to a FileSearchStore. */ export declare class ImportFileOperation implements Operation { /** 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}`. */ name?: string; /** Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such metadata. Any method that returns a long-running operation should document the metadata type, if any. */ metadata?: Record; /** If the value is `false`, it means the operation is still in progress. If `true`, the operation is completed, and either `error` or `response` is available. */ done?: boolean; /** The error result of the operation in case of failure or cancellation. */ error?: Record; /** The result of the ImportFile operation, available when the operation is done. */ response?: ImportFileResponse; /** * Instantiates an Operation of the same type as the one being called with the fields set from the API response. */ _fromAPIResponse({ apiResponse, _isVertexAI, }: OperationFromAPIResponseParameters): Operation; /** The full HTTP response. */ sdkHttpResponse?: HttpResponse; } /** Config for file_search_stores.import_file parameters. */ export declare interface ImportFileParameters { /** The resource name of the FileSearchStore. Example: `fileSearchStores/my-file-search-store-123` */ fileSearchStoreName: string; /** The name of the File API File to import. Example: `files/abc-123` */ fileName: string; /** Optional parameters for the request. */ config?: ImportFileConfig; } /** Response for ImportFile to import a File API file with a file search store. */ export declare class ImportFileResponse { /** Used to retain the full HTTP response. */ sdkHttpResponse?: HttpResponse; /** The name of the FileSearchStore containing Documents. */ parent?: string; /** The identifier for the Document imported. */ documentName?: string; } declare type InjectionLocation$ = InjectionLocationEnum; declare type InjectionLocationEnum$ = InjectionLocationEnum; /** * @license * Copyright 2026 Google LLC * SPDX-License-Identifier: Apache-2.0 * * g3-prettier-ignore-file */ declare type InjectionLocationEnum = "header" | "query" | "body"; /** Config for `inlined_embedding_responses` parameter. */ export declare class InlinedEmbedContentResponse { /** Output only. The response to the request. */ response?: SingleEmbedContentResponse; /** Output only. The error encountered while processing the request. */ error?: JobError; /** Output only. The metadata associated with the request. */ metadata?: Record; } /** Config for inlined request. */ export declare interface InlinedRequest { /** ID of the model to use. For a list of models, see `Google models `_. */ model?: string; /** Content of the request. */ contents?: ContentListUnion; /** The metadata to be associated with the request. */ metadata?: Record; /** Configuration that contains optional model parameters. */ config?: GenerateContentConfig; } /** Config for `inlined_responses` parameter. */ export declare class InlinedResponse { /** The response to the request. */ response?: GenerateContentResponse; /** The metadata to be associated with the request. */ metadata?: Record; /** The error encountered while processing the request. */ error?: JobError; } /** * Required. Shared input prefix evaluated once across all decision questions. */ declare type Input = DecisionInputContent | Array | string; declare type InputEvent$ = InputEvent_2; /** * Atomic input payload — replaces user_input step on bidi wire. * * @remarks * Sent by clients as a single complete input message. */ declare type InputEvent_2 = { /** * Content parts making up the input (text, images, documents, etc.). * * @remarks * Reuses the existing Content message from content.proto. */ content?: Array | undefined; event_type: "input"; }; declare type InputTokensByModality$ = ModalityTokens; declare type Interaction$ = Interaction; /** * The Interaction resource. */ declare type Interaction = { /** * The agent to interact with. */ agent?: AgentOption | undefined; /** * Configuration parameters for the agent interaction. */ agent_config?: AntigravityAgentConfig | CodeMenderAgentConfig | DeepResearchAgentConfig | DynamicAgentConfig | undefined; /** * The name of the cached content used as context to serve the prediction. Note: only used in explicit caching, where users can have control over caching (e.g. what content to cache) and enjoy guaranteed cost savings. Format: cachedContents/{cachedContent} * * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. */ cached_content?: string | undefined; /** * The IDs of all server interactions merged into this response when automatic continuation is enabled, in order (ending with the final hop's ID). * * @remarks * * Note: this is added by the SDK. */ continuation_ids?: Array | undefined; /** * Opaque token to resume a long decode. Output: set when status is * * @remarks * REQUIRES_CONTINUATION and decoding can be resumed. Input: pass the latest * token back unchanged when creating the next interaction to continue * decoding. */ continuation_token?: string | undefined; /** * Required. Output only. The time at which the response was created in ISO 8601 format * * @remarks * (YYYY-MM-DDThh:mm:ssZ). */ created?: string | undefined; /** * The environment configuration for the interaction. Can be an object * * @remarks * specifying remote environment sources or a string referencing an existing * environment ID. */ environment?: Environment_2 | string | undefined; /** * Output only. The environment ID for the interaction. Only populated if environment * * @remarks * config is set in the request. */ environment_id?: string | undefined; /** * Output only. Diagnostic faults / platform errors recorded on the interaction. */ errors?: Array | undefined; /** * Configuration parameters for model interactions. */ generation_config?: GenerationConfig_2 | undefined; /** * Required. Output only. A unique identifier for the interaction completion. */ id: string; /** * The input for the interaction. */ input?: InteractionsInput | undefined; /** * The labels with user-defined metadata for the request. * * @remarks * * Label keys and values can be no longer than 63 characters * (Unicode codepoints) and can only contain lowercase letters, numeric * characters, underscores, and dashes. International characters are allowed. * Label values are optional. Label keys must start with a letter. */ labels?: { [k: string]: string; } | undefined; /** * The model that will complete your prompt.\n\nSee [models](https://aistudio.google.com/docs/models) for additional details. */ model?: Model_2 | undefined; /** * An audio content block. */ output_audio?: AudioContent | undefined; /** * An image content block. */ output_image?: ImageContent | undefined; /** * Concatenated text from the last model output in response to the current request. * * @remarks * * Note: this is added by the SDK. */ output_text?: string | undefined; /** * A video content block. */ output_video?: VideoContent | undefined; /** * The ID of the previous interaction, if any. */ previous_interaction_id?: string | undefined; /** * Enforces that the generated response is a JSON object that complies with * * @remarks * the JSON schema specified in this field. */ response_format?: ResponseFormat_2 | Array | undefined; /** * The mime type of the response. This is required if response_format is set. * * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. */ response_mime_type?: string | undefined; /** * The requested modalities of the response (TEXT, IMAGE, AUDIO). * * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. */ response_modalities?: Array | undefined; /** * Safety settings for the interaction. */ safety_settings?: Array | undefined; service_tier?: ServiceTier_2 | undefined; /** * Required. Output only. The status of the interaction. */ status: InteractionStatus_2; /** * Required. Output only. The steps that make up the interaction, when included in the response. */ steps?: Array | undefined; /** * System instruction for the interaction. */ system_instruction?: string | undefined; /** * A list of tool declarations the model may call during interaction. */ tools?: Array | undefined; /** * Required. Output only. The time at which the response was last updated in ISO 8601 format * * @remarks * (YYYY-MM-DDThh:mm:ssZ). */ updated?: string | undefined; /** * Statistics on the interaction request's token usage. */ usage?: Usage | undefined; /** * Message for configuring webhook events for a request. */ webhook_config?: WebhookConfig_2 | undefined; }; /** * Configuration parameters for the agent interaction. */ declare type InteractionAgentConfig = AntigravityAgentConfig | CodeMenderAgentConfig | DeepResearchAgentConfig | DynamicAgentConfig; declare type InteractionAuthToken$ = InteractionAuthToken; /** * @license * Copyright 2026 Google LLC * SPDX-License-Identifier: Apache-2.0 * * g3-prettier-ignore-file */ export declare type InteractionAuthToken = { /** * The auth token. */ auth_token?: string | undefined; /** * Expiration time of the auth token. */ expires_at?: string | undefined; }; declare type InteractionAuthTokenCreateParams$ = InteractionAuthTokenCreateParams; /** * @license * Copyright 2026 Google LLC * SPDX-License-Identifier: Apache-2.0 * * g3-prettier-ignore-file */ export declare type InteractionAuthTokenCreateParams = { /** * Hard deadline - messages rejected after this time. */ expire_time?: string | undefined; }; declare type InteractionAuthTokenDeleteParams$ = DeleteInteractionAuthTokenParams; /** Shared base class for live interaction connections. */ declare class InteractionBaseConnection, TServerEvent = Record> { /** Identifier of the connected interaction. */ id: string; private readonly queue; private socket?; private detached; private terminal; private reconnectionRequested; private receiving; private pendingClose?; private connectionError?; /** @internal */ constructor(id: string); /** @internal */ attach(socket: WebSocket_2 & { flush?(): Promise; }): void; private closeSocket; private finishTerminal; private finishClientCancel; /** @internal */ handleMessage(data: unknown): void; private markTerminal; private decodeFrameEvents; protected newConnectionError(options: { message: string; closeCode?: number | undefined; httpStatus?: number | undefined; serverCode?: string | undefined; }): APIConnectionError; private failProtocol; /** @internal */ handleTransportError(): void; protected isNormalReconnectionClose(code: number): boolean; /** @internal */ handleClose(code?: number): void; private ensureWritable; private sendEvent; /** @internal Initial lifecycle frame used only during connect(). */ sendInitial(event: Record): void; /** Sends text, one client event, or a list of client events. */ send(input: string | TClientEvent | (Record & { event_type: string; }) | Array & { event_type: string; })>): Promise; /** Yields server events continuously until the interaction terminates or detaches. */ receive(): AsyncGenerator; /** Requests completion on the server while leaving the connection open for acknowledgement. */ complete(): Promise; /** Cancels inference on the server, marks the connection terminal, and closes the transport after flushing. */ cancel(): Promise; /** Gracefully detaches from the interaction locally without completing it on the server. */ detach(): void; } /** Async disposal interface for `InteractionBaseConnection`. */ declare interface InteractionBaseConnection, TServerEvent = Record> extends Record Promise> { } declare type InteractionCancelledEvent$ = InteractionCancelledEvent; /** * Signals that the Interaction was cancelled, e.g., in response to a * * @remarks * CancelInteractionEvent. Any work in flight was aborted and no more input * can be sent to the Interaction after this. */ export declare type InteractionCancelledEvent = { event_type: "interaction.cancelled"; /** * Statistics on the interaction request's token usage. */ usage?: Usage | undefined; }; declare type InteractionCancelParams$ = CancelInteractionByIdParams; declare type InteractionCompletedEvent$ = InteractionCompletedEvent; /** * Signals that the Interaction completed. Sent when the Interaction receives * * @remarks * Complete/Cancel or naturally terminates. No more input can be sent to the * Interaction after this. */ declare type InteractionCompletedEvent = { /** * The event_id token to be used to resume the interaction stream, from * * @remarks * this event. */ event_id?: string | undefined; event_type: "interaction.completed"; /** * Partial interaction resource emitted by interaction lifecycle SSE events. * * @remarks * Streaming lifecycle payloads may omit fields that are only available on * full non-streaming Interaction responses. */ interaction: InteractionSseEventInteraction; }; declare type InteractionConnectedEvent$ = InteractionConnectedEvent; /** * @license * Copyright 2026 Google LLC * SPDX-License-Identifier: Apache-2.0 * * g3-prettier-ignore-file */ /** * The response when reconnecting to a live interaction. * * @remarks * * The server sets `next_input_seq_num` to tell the client the first input * event it still needs (i.e., resume input from here). Additionally, * `ack_input_seq_num` on the enclosing `ServerEventBatch` confirms * cumulative receipt through that seq_num. */ declare type InteractionConnectedEvent = { event_type: "interaction.connected"; }; /** * Parameters for connecting to an interaction. * * Experimental: Live Interactions SDK support is experimental and may change * in future versions. * * @experimental */ export declare interface InteractionConnectParams { /** Optional API version override (for example, `"v1alpha"` or `"v1beta"`). */ api_version?: string; /** * Transport protocol to use for the live interaction. * Defaults to `"websocket"`. Pass `"webrtc"` or an `InteractionWebRTCTransport` * instance to connect via the `:webrtc` SDP exchange + `"events"` data channel. */ transport?: 'websocket' | 'webrtc' | InteractionWebRTCTransport; } declare type InteractionCreatedEvent$ = InteractionCreatedEvent; /** * Server response confirming that a new interaction was created. */ declare type InteractionCreatedEvent = { /** * The event_id token to be used to resume the interaction stream, from * * @remarks * this event. */ event_id?: string | undefined; event_type: "interaction.created"; /** * Partial interaction resource emitted by interaction lifecycle SSE events. * * @remarks * Streaming lifecycle payloads may omit fields that are only available on * full non-streaming Interaction responses. */ interaction: InteractionSseEventInteraction; }; declare type InteractionCreateParams$ = CreateInteractionParams; declare type InteractionCreateParamsNonStreaming$ = CreateInteractionParamsNonStreaming; declare type InteractionCreateParamsStreaming$ = CreateInteractionParamsStreaming; declare type InteractionDeleteParams$ = DeleteInteractionParams; declare type InteractionDeleteResponse$ = Empty; /** * The environment configuration for the interaction. Can be an object * * @remarks * specifying remote environment sources or a string referencing an existing * environment ID. */ declare type InteractionEnvironment = Environment_2 | string; /** Fetch function signature accepted by Live Interactions transports. */ declare type InteractionFetch = (input: RequestInfo | URL, init?: RequestInit) => Promise; declare type InteractionGetParams$ = GetInteractionByIdParams; declare type InteractionGetParamsNonStreaming$ = GetInteractionByIdParamsNonStreaming; declare type InteractionGetParamsStreaming$ = GetInteractionByIdParamsStreaming; /** Internal parent client interface for Live Interactions. */ declare interface InteractionParentClient { isVertexAI(): boolean; getBaseUrl(): string; getWebsocketBaseUrl?(): string; getApiVersion(): string; getApiKey?(): string | undefined; getDefaultHeaders?(): Record; getHeaders?(): Record | undefined; getAuthHeaders(url?: string): Headers | Promise; getFetch?(): InteractionFetch | undefined; getTimeout?(): number | undefined; } /** * Enforces that the generated response is a JSON object that complies with * * @remarks * the JSON schema specified in this field. */ declare type InteractionResponseFormat = ResponseFormat_2 | Array; export declare namespace Interactions { export type AllowedTools = AllowedTools$; export type Annotation = Annotation$; export type AntigravityAgentConfig = AntigravityAgentConfig$; export type AudioContent = AudioContent$; export type AudioResponseFormat = AudioResponseFormat$; export type AudioStaticMediaProcessing = AudioStaticMediaProcessing$; export type CancelInteractionEvent = CancelInteractionEvent$; export type ClientEvent = ClientEvent$; export type CodeExecutionCallArguments = CodeExecutionCallArguments$; export interface CodeExecutionCallStep extends CodeExecutionCallStep$ { } export type CodeExecutionResultStep = CodeExecutionResultStep$; export interface CodeMenderAgentConfig extends CodeMenderAgentConfig$ { } export type CompleteInteractionEvent = CompleteInteractionEvent$; export type ConnectInteractionEvent = ConnectInteractionEvent$; export type Content = Content$; export type CreateAgentInteractionParamsNonStreaming = CreateAgentInteractionParamsNonStreaming$; export type CreateAgentInteractionParamsStreaming = CreateAgentInteractionParamsStreaming$; export type CreateInteractionEvent = CreateInteractionEvent$; export type CreateModelInteractionParamsNonStreaming = CreateModelInteractionParamsNonStreaming$; export type CreateModelInteractionParamsStreaming = CreateModelInteractionParamsStreaming$; export type DeepResearchAgentConfig = DeepResearchAgentConfig$; export type DisconnectEvent = DisconnectEvent$; export type DocumentContent = DocumentContent$; export type DocumentStaticMediaProcessing = DocumentStaticMediaProcessing$; export type DynamicAgentConfig = DynamicAgentConfig$; export interface Environment extends Environment$2 { } export type EnvironmentMode = EnvironmentMode$2; export type Error = Error$; export interface ErrorEvent extends ErrorEvent$ { } export type FileCitation = FileCitation$; export type FileSearchCallStep = FileSearchCallStep$; export type FileSearchResultStep = FileSearchResultStep$; export type Function = Function$; export type FunctionCallStep = FunctionCallStep$; export type FunctionResultStep = FunctionResultStep$; export type GenerationConfig = GenerationConfig$; export type GoogleMapsCallArguments = GoogleMapsCallArguments$; export interface GoogleMapsCallStep extends GoogleMapsCallStep$ { } export interface GoogleMapsResult extends GoogleMapsResult$ { } export interface GoogleMapsResultStep extends GoogleMapsResultStep$ { } export type GoogleSearchCallArguments = GoogleSearchCallArguments$; export interface GoogleSearchCallStep extends GoogleSearchCallStep$ { } export type GoogleSearchResult = GoogleSearchResult$; export interface GoogleSearchResultStep extends GoogleSearchResultStep$ { } export type HarmCategory = HarmCategory$; export type ImageContent = ImageContent$; export type ImageResponseFormat = ImageResponseFormat$; export type InputEvent = InputEvent$; export type Interaction = Interaction$; export type InteractionAuthToken = InteractionAuthToken$; export type InteractionCancelledEvent = InteractionCancelledEvent$; export type InteractionCancelParams = InteractionCancelParams$; export type InteractionCompletedEvent = InteractionCompletedEvent$; export type InteractionConnectedEvent = InteractionConnectedEvent$; export type InteractionCreatedEvent = InteractionCreatedEvent$; export type InteractionCreateParams = InteractionCreateParams$; export type InteractionCreateParamsNonStreaming = InteractionCreateParamsNonStreaming$; export type InteractionCreateParamsStreaming = InteractionCreateParamsStreaming$; export type InteractionDeleteParams = InteractionDeleteParams$; export type InteractionDeleteResponse = InteractionDeleteResponse$; export type InteractionGetParams = InteractionGetParams$; export type InteractionGetParamsNonStreaming = InteractionGetParamsNonStreaming$; export type InteractionGetParamsStreaming = InteractionGetParamsStreaming$; export type InteractionSSEEvent = InteractionSSEEvent$; export type InteractionStatusUpdate = InteractionStatusUpdate$; export interface LiveInteractionCompletedEvent extends LiveInteractionCompletedEvent$ { } export type LiveInteractionCreatedEvent = LiveInteractionCreatedEvent$; export type MCPServerToolCallStep = MCPServerToolCallStep$; export type MCPServerToolResultStep = MCPServerToolResultStep$; export type MediaResolution = MediaResolution$; export type Model = Model$; export type ModelOutputStep = ModelOutputStep$; export type PageProcessingOptions = PageProcessingOptions$; export interface PlaceCitation extends PlaceCitation$ { } export type ProcessingCallStep = ProcessingCallStep$; export type ProcessingResultStep = ProcessingResultStep$; export type RetrievalCallArguments = RetrievalCallArguments$; export interface RetrievalCallDelta extends RetrievalCallDelta$ { } export interface RetrievalCallStep extends RetrievalCallStep$ { } export type RetrievalResultDelta = RetrievalResultDelta$; export type RetrievalResultStep = RetrievalResultStep$; export type SafetySetting = SafetySetting$; export type ServerEvent = ServerEvent$; export type SpeechConfig = SpeechConfig$; export type SpreadsheetProcessingOptions = SpreadsheetProcessingOptions$; export type Step = Step$; export interface StepDelta extends StepDelta$ { } export type StepStart = StepStart$; export type StepStop = StepStop$; export interface SystemInputStep extends SystemInputStep$ { } export type TextContent = TextContent$; export type TextResponseFormat = TextResponseFormat$; export type ThinkingLevel = ThinkingLevel$; export type ThoughtStep = ThoughtStep$; export type Tool = Tool$; export type ToolChoiceConfig = ToolChoiceConfig$; export type ToolChoiceType = ToolChoiceType$; export type ToolSearchCallStep = ToolSearchCallStep$; export type ToolSearchCallStepArguments = ToolSearchCallStepArguments$; export type ToolSearchResultStep = ToolSearchResultStep$; export type TranscriptionConfig = TranscriptionConfig$; export type TranscriptionMode = TranscriptionMode$; export type URLCitation = URLCitation$; export type URLContextCallArguments = URLContextCallArguments$; export interface URLContextCallStep extends URLContextCallStep$ { } export type URLContextResult = URLContextResult$; export interface URLContextResultStep extends URLContextResultStep$ { } export interface Usage extends Usage$ { } export type UserActionInput = UserActionInput$; export type UserInputStep = UserInputStep$; export type VideoConfig = VideoConfig$; export interface VideoContent extends VideoContent$ { } export type VideoResponseFormat = VideoResponseFormat$; export type WebhookConfig = WebhookConfig$; export type WordInfo = WordInfo$; export type WorldPromptContent = WorldPromptContent$; export type WorldReferenceImage = WorldReferenceImage$; export type WorldSetupEvent = WorldSetupEvent$; export namespace Annotation { export type SpeechMetadata = SpeechMetadata$; } export namespace AuthTokens { export type InteractionAuthTokenCreateParams = InteractionAuthTokenCreateParams$; export type InteractionAuthTokenDeleteParams = InteractionAuthTokenDeleteParams$; } export namespace CodeExecutionCallStep { export type Arguments = Arguments$; } export namespace CodeMenderAgentConfig { export interface FindRequest extends FindRequest$ { } export interface FixRequest extends FixRequest$ { } export type SessionConfig = SessionConfig$; export namespace FindRequest { export type SourceFile = SourceFile$; } export namespace FixRequest { export type SourceFile = SourceFile$2; } } export namespace Environment { export interface EnvironmentNetworkEgressAllowlist extends EnvironmentNetworkEgressAllowlist$ { } export type EnvVar = EnvVar$; export type Source = Source$; export namespace EnvironmentNetworkEgressAllowlist { export type AllowlistEntry = AllowlistEntry$; } } export namespace ErrorEvent { export type Error = Error$2; } export namespace GoogleMapsCallStep { export type Arguments = Arguments$2; } export namespace GoogleMapsResult { export interface Place extends Place$ { } export namespace Place { export type ReviewSnippet = ReviewSnippet$; } } export namespace GoogleMapsResultStep { export interface Result extends Result$ { } export namespace Result { export interface Place extends Place$2 { } export namespace Place { export type ReviewSnippet = ReviewSnippet$2; } } } export namespace GoogleSearchCallStep { export type Arguments = Arguments$3; } export namespace GoogleSearchResultStep { export type Result = Result$2; } export namespace InteractionCreateParams { export type CreateAgentInteractionParams = CreateAgentInteractionParams$; export type CreateAgentInteractionParamsNonStreaming = CreateAgentInteractionParamsNonStreaming$2; export type CreateAgentInteractionParamsStreaming = CreateAgentInteractionParamsStreaming$2; export type CreateModelInteractionParams = CreateModelInteractionParams$; export type CreateModelInteractionParamsNonStreaming = CreateModelInteractionParamsNonStreaming$2; export type CreateModelInteractionParamsStreaming = CreateModelInteractionParamsStreaming$2; export type InteractionCreateParamsNonStreaming = InteractionCreateParamsNonStreaming$; export type InteractionCreateParamsStreaming = InteractionCreateParamsStreaming$; } export namespace InteractionGetParams { export type InteractionGetParamsNonStreaming = InteractionGetParamsNonStreaming$; export type InteractionGetParamsStreaming = InteractionGetParamsStreaming$; } export namespace LiveInteractionCompletedEvent { export type Status = Status$; } export namespace PlaceCitation { export type ReviewSnippet = ReviewSnippet$3; } export namespace RetrievalCallDelta { export type Arguments = Arguments$4; } export namespace RetrievalCallStep { export type Arguments = Arguments$5; } export namespace StepDelta { export type ArgumentsDelta = ArgumentsDelta$; export type Audio = Audio$; export type CodeExecutionCall = CodeExecutionCall$; export type CodeExecutionResult = CodeExecutionResult$; export type Document = Document$; export type FileSearchCall = FileSearchCall$; export type FileSearchResult = FileSearchResult$; export type FunctionResult = FunctionResult$; export type GoogleMapsCall = GoogleMapsCall$; export type GoogleMapsResult = GoogleMapsResult$2; export type GoogleSearchCall = GoogleSearchCall$; export type GoogleSearchResult = GoogleSearchResult$2; export type Image = Image$; export type MCPServerToolCall = MCPServerToolCall$; export type MCPServerToolResult = MCPServerToolResult$; export type Metadata = Metadata$; export type ProcessingCall = ProcessingCall$; export type ProcessingResult = ProcessingResult$; export type Text = Text$; export type TextAnnotationDelta = TextAnnotationDelta$; export type ThoughtSignature = ThoughtSignature$; export type ThoughtSummary = ThoughtSummary$; export type ToolSearchCall = ToolSearchCall$; export type ToolSearchResult = ToolSearchResult$; export type URLContextCall = URLContextCall$; export type URLContextResult = URLContextResult$2; export type Video = Video$; } export namespace SystemInputStep { export type CodeExecution = CodeExecution$; export type ComputerUse = ComputerUse$; export type FileSearch = FileSearch$; export type GoogleMaps = GoogleMaps$; export type GoogleSearch = GoogleSearch$; export type MCPServer = MCPServer$; export interface Retrieval extends Retrieval$ { } export type ToolSearch = ToolSearch$; export type URLContext = URLContext$; export namespace Retrieval { export type VertexAISearchConfig = VertexAISearchConfig$; } } export namespace Tool { export type CodeExecution = CodeExecution$2; export type ComputerUse = ComputerUse$2; export type FileSearch = FileSearch$2; export type GoogleMaps = GoogleMaps$2; export type GoogleSearch = GoogleSearch$2; export type MCPServer = MCPServer$2; export interface Retrieval extends Retrieval$2 { } export type ToolSearch = ToolSearch$2; export type URLContext = URLContext$2; export namespace Retrieval { export type VertexAISearchConfig = VertexAISearchConfig$2; } } export namespace TranscriptionMode { export type Smart = Smart$; export type Verbatim = Verbatim$; } export namespace URLContextCallStep { export type Arguments = Arguments$6; } export namespace URLContextResultStep { export type Result = Result$3; } export namespace Usage { export type CachedTokensByModality = CachedTokensByModality$; export type GroundingToolCount = GroundingToolCount$; export type InputTokensByModality = InputTokensByModality$; export type OutputTokensByModality = OutputTokensByModality$; export type ToolUseTokensByModality = ToolUseTokensByModality$; } export namespace VideoContent { export type Static = Static$; } } declare namespace interactions { export { AgentOption, AllowedTools, Transform, AllowlistEntry, Annotation, AntigravityAgentConfig, ArgumentsDelta, AudioContentMimeType, AudioProcessingEnum, AudioProcessing, AudioContent, AudioDeltaMimeType, AudioDelta, AudioMediaProcessing, AudioResponseFormatDelivery, AudioResponseFormatMimeType, AudioResponseFormat_2 as AudioResponseFormat, AudioStaticMediaProcessing, CancelInteractionEvent, ClientEventBatch, ClientEventList, ClientEvent, Language_2 as Language, CodeExecutionCallArguments, CodeExecutionCallDelta, CodeExecutionCallStep, CodeExecutionResultDelta, CodeExecutionResultStepResult, CodeExecutionResultStep, CodeExecution, CodeMenderAgentConfig, CompleteInteractionEvent, DisabledSafetyPolicy, EnvironmentEnum, ComputerUse_2 as ComputerUse, ConnectInteractionEvent, Content_2 as Content, CreateAgentInteractionAgentConfig, CreateAgentInteractionEnvironment, CreateAgentInteractionResponseFormat, CreateAgentInteraction, CreateInteractionEvent, CreateModelInteractionEnvironment, CreateModelInteractionResponseFormat, CreateModelInteraction, Visualization, DeepResearchAgentConfig, DisconnectEvent, DocumentContentMimeType, DocumentProcessingEnum, DocumentProcessing, DocumentContent, DocumentDeltaMimeType, DocumentDelta, DocumentMediaProcessing, DocumentStaticMediaProcessing, DynamicAgentConfig, Empty, EnvVar, EnvironmentMode, Disabled, Allowlist, EnvironmentNetworkEgressAllowlist, Env, NetworkEnum, Network, Environment_2 as Environment, ErrorEvent_2 as ErrorEvent, ErrorT, ExaAISearchConfig, FileCitation, FileContent, FileSearchCallDelta, FileSearchCallStep, FileSearchResultDelta, FileSearchResultStep, FileSearchResult, FileSearch_2 as FileSearch, Filter, Mode, FindRequest, FixRequest, FunctionCallStep, FunctionResultDeltaResult, FunctionResultDeltaResultUnion, FunctionResultDelta, FunctionResultStepResult, FunctionResultStepResultUnion, FunctionResultStep, FunctionResultSubcontent, FunctionT, SpeechConfigUnion_2 as SpeechConfigUnion, ToolChoice, GenerationConfig_2 as GenerationConfig, GoogleMapsCallArguments, GoogleMapsCallDelta, GoogleMapsCallStep, GoogleMapsResultDelta, GoogleMapsResultPlaces, GoogleMapsResultStep, GoogleMapsResult, GoogleMaps_2 as GoogleMaps, GoogleSearchCallArguments, GoogleSearchCallDelta, GoogleSearchCallStepSearchType, GoogleSearchCallStep, GoogleSearchResultDelta, GoogleSearchResultStep, GoogleSearchResult, GoogleSearchSearchType, GoogleSearch_2 as GoogleSearch, GroundingToolCountType, GroundingToolCount, HarmCategory_2 as HarmCategory, HybridSearch, ImageConfigAspectRatio, ImageConfigImageSize, ImageConfig_2 as ImageConfig, ImageContentMimeType, ImageContent, ImageDeltaMimeType, ImageDelta, ImageResponseFormatAspectRatio, ImageResponseFormatDelivery, ImageResponseFormatImageSize, ImageResponseFormatMimeType, ImageResponseFormat_2 as ImageResponseFormat, InputEvent_2 as InputEvent, InteractionAuthTokenCreateParams, InteractionAuthToken, InteractionCancelledEvent, InteractionCompletedEvent, InteractionConnectedEvent, InteractionCreatedEvent, InteractionSseEventInteractionStatus, InteractionSseEventInteraction, InteractionSSEEvent, InteractionSSEStreamEvent, InteractionStatusUpdateStatus, InteractionStatusUpdate, InteractionAgentConfig, InteractionEnvironment, InteractionResponseFormat, InteractionStatus_2 as InteractionStatus, Interaction, InteractionsInput, LiveInteractionCompletedEvent, LiveInteractionCreatedEvent, MCPServerToolCallDelta, MCPServerToolCallStep, MCPServerToolResultDeltaResult, MCPServerToolResultDeltaResultUnion, MCPServerToolResultDelta, MCPServerToolResultStepResult, MCPServerToolResultStepResultUnion, MCPServerToolResultStep, MCPServer, MediaProcessing_2 as MediaProcessing, MediaResolution_2 as MediaResolution, ModalityTokens, ModelOutputStep, Model_2 as Model, PageProcessingOptionsContentLayer, PageProcessingOptions, ParallelAISearchConfig, PlaceCitation, ProcessingCallDelta, ProcessingCallStep, ProcessingResultDelta, ProcessingResultStep, RagResource, RagRetrievalConfig_2 as RagRetrievalConfig, RagStoreConfig, RankService, Ranking, ResponseFormat_2 as ResponseFormat, ResponseModality, RetrievalCallArguments, RetrievalCallDeltaRetrievalType, RetrievalCallDelta, RetrievalCallStepRetrievalType, RetrievalCallStep, RetrievalResultDelta, RetrievalResultStep, RetrievalRetrievalType, Retrieval_2 as Retrieval, ReviewSnippet, Method, Threshold, SafetySetting_2 as SafetySetting, ServerEvent, ServiceTier_2 as ServiceTier, SessionConfig, SmartTranscriptionMode, SourceType, Source, TextNormalization_2 as TextNormalization, SpeakerConfig, SpeechAnnotation, SpeechConfig_2 as SpeechConfig, SpreadsheetProcessingOptionsContentLayer, SpreadsheetProcessingOptions, StaticMediaProcessingContentLayer, StaticMediaProcessing, Status, StepDeltaData, StepDeltaMetadata, StepDelta, StepStart, StepStop, Step, SystemInputStep, TextAnnotationDelta, TextContent, TextDelta, TextResponseFormatMimeType, TextResponseFormat_2 as TextResponseFormat, ThinkingLevel_2 as ThinkingLevel, ThinkingSummaries, ThoughtSignatureDelta, ThoughtStep, ThoughtSummaryContent, ThoughtSummaryDelta, ToolChoiceConfig, ToolChoiceType, ToolSearchCallDelta, ToolSearchCallStepArguments, ToolSearchCallStep, ToolSearchResultDelta, ToolSearchResultStep, Execution, ToolSearch, Tool_2 as Tool, TranscriptionConfigModeEnum, TranscriptionConfigMode, TranscriptionConfig, TranscriptionMode, URLCitation, URLContextCallArguments, URLContextCallDelta, URLContextCallStep, URLContextResultDelta, URLContextResultStep, URLContextResultStatus, URLContextResult, URLContext, Usage, UserActionType, UserActionKey, UserActionTarget, UserActionInput, UserInputStep, VerbatimTranscriptionMode, VertexAISearchConfig, Task, VideoConfig, VideoContentMimeType, ProcessingEnum, Processing, VideoContent, VideoDeltaMimeType, VideoDelta, VideoResponseFormatAspectRatio, VideoResponseFormatDelivery, Resolution, VideoResponseFormat_2 as VideoResponseFormat, WebhookConfig_2 as WebhookConfig, WordInfo_2 as WordInfo, WorldPromptContent, WorldReferenceImage, WorldPrompt, WorldSetupEvent } } declare class Interactions_2 extends ClientSDK { private _auth_tokens?; get auth_tokens(): AuthTokens; /** * Creates a new interaction. */ create(params: CreateAgentInteractionParamsNonStreaming, options?: RequestOptions): APIPromise; create(params: CreateModelInteractionParamsNonStreaming, options?: RequestOptions): APIPromise; create(params: CreateAgentInteractionParamsStreaming, options?: RequestOptions): APIPromise>; create(params: CreateModelInteractionParamsStreaming, options?: RequestOptions): APIPromise>; create(params: CreateInteractionParamsNonStreaming, options?: RequestOptions): APIPromise; create(params: CreateInteractionParamsStreaming, options?: RequestOptions): APIPromise>; create(params: CreateInteractionParams, options?: RequestOptions): APIPromise; /** * Deletes the interaction by id. */ delete(id: string, params?: DeleteInteractionParams, options?: Omit): APIPromise; /** * Retrieves the full details of a single interaction based on its * `Interaction.id`. */ get(id: string, params?: GetInteractionByIdParamsNonStreaming, options?: Omit): APIPromise; get(id: string, params: GetInteractionByIdParamsStreaming, options?: Omit): APIPromise>; get(id: string, params?: GetInteractionByIdParams, options?: Omit): APIPromise; /** * Cancels an interaction by id. This only applies to background interactions * that are still running. */ cancel(id: string, params?: CancelInteractionByIdParams, options?: Omit): APIPromise; } /** * The input for the interaction. */ declare type InteractionsInput = Content_2 | Array | Array | string; declare type InteractionSSEEvent$ = InteractionSSEEvent; declare type InteractionSSEEvent = ErrorEvent_2 | InteractionCompletedEvent | InteractionCreatedEvent | InteractionStatusUpdate | StepDelta | StepStart | StepStop; /** * Partial interaction resource emitted by interaction lifecycle SSE events. * * @remarks * Streaming lifecycle payloads may omit fields that are only available on * full non-streaming Interaction responses. */ declare type InteractionSseEventInteraction = { /** * The agent to interact with. */ agent?: string | undefined; /** * Output only. Opaque token to resume a long decode when status is incomplete. */ continuation_token?: string | undefined; /** * Output only. The time at which the response was created in ISO 8601 format. */ created?: string | undefined; /** * Required. Output only. A unique identifier for the interaction completion. */ id: string; /** * The model that will complete your prompt. */ model?: string | undefined; /** * Output only. The resource type. */ object?: string | undefined; service_tier?: ServiceTier_2 | undefined; /** * Required. Output only. The status of the interaction. */ status: InteractionSseEventInteractionStatus; /** * Output only. The steps that make up the interaction, if included in this event. */ steps?: Array | undefined; /** * Output only. The time at which the response was last updated in ISO 8601 format. */ updated?: string | undefined; /** * Statistics on the interaction request's token usage. */ usage?: Usage | undefined; }; /** * Required. Output only. The status of the interaction. */ declare type InteractionSseEventInteractionStatus = "in_progress" | "requires_action" | "completed" | "failed" | "cancelled" | "incomplete" | "budget_exceeded" | "queued" | "idle" | "requires_continuation" | (string & {}); declare type InteractionSSEStreamEvent = { data: InteractionSSEEvent; }; /** The different activity states of the live session. */ export declare enum InteractionStatus { /** * Unspecified interaction status. */ INTERACTION_STATUS_UNSPECIFIED = "INTERACTION_STATUS_UNSPECIFIED", /** * The server is still actively processing user input or running background reasoning. More model output may follow. */ IN_PROGRESS = "IN_PROGRESS", /** * Deprecated: Use IDLE instead. */ REQUIRES_ACTION = "REQUIRES_ACTION", /** * The server has completed all processing and background reasoning. */ IDLE = "IDLE" } /** * Required. Output only. The status of the interaction. */ declare type InteractionStatus_2 = "in_progress" | "requires_action" | "completed" | "failed" | "cancelled" | "incomplete" | "budget_exceeded" | "queued" | "idle" | "requires_continuation" | (string & {}); declare type InteractionStatusUpdate$ = InteractionStatusUpdate; declare type InteractionStatusUpdate = { /** * An optional opaque continuation token used to resume decoding from the * * @remarks * latest checkpoint after a disconnected stream. */ continuation_token?: string | undefined; /** * The event_id token to be used to resume the interaction stream, from * * @remarks * this event. */ event_id?: string | undefined; event_type: "interaction.status_update"; interaction_id: string; status: InteractionStatusUpdateStatus; /** * Statistics on the interaction request's token usage. */ usage?: Usage | undefined; }; declare type InteractionStatusUpdateStatus = "in_progress" | "requires_action" | "completed" | "failed" | "cancelled" | "incomplete" | "budget_exceeded" | "queued" | "idle" | "requires_continuation" | (string & {}); /** * An interaction connection over WebRTC. * * Experimental: Live Interactions SDK support is experimental and may change * in future versions. * * @experimental */ export declare type InteractionWebRTCConnection = InteractionWebRTCConnection_2; export declare const InteractionWebRTCConnection: new (id: string, transport: InteractionWebRTCTransport) => InteractionWebRTCConnection; /** * An interaction connection over WebRTC. * * Experimental: Live Interactions SDK support is experimental and may change * in future versions. * * @experimental */ declare class InteractionWebRTCConnection_2, TServerEvent = Record> extends InteractionBaseConnection { /** Active WebRTC transport for this connection. */ readonly transport: InteractionWebRTCTransport; /** @internal */ constructor(id: string, /** Active WebRTC transport for this connection. */ transport: InteractionWebRTCTransport); protected newConnectionError(options: { message: string; closeCode?: number | undefined; httpStatus?: number | undefined; serverCode?: string | undefined; }): APIConnectionError; protected isNormalReconnectionClose(code: number): boolean; } /** * Experimental WebRTC transport for Live Interactions. * * Experimental: Live Interactions SDK support is experimental and may change * in future versions. * * Negotiates a WebRTC session via `POST /{api_version}/interactions/{id}:webrtc` * with `{ offer_sdp }` and exchanges JSON `ClientEvent` / * `ServerEvent` frames over the `"events"` `RTCDataChannel` while * streaming audio and video over native `RTCPeerConnection` media tracks. * * @experimental */ export declare class InteractionWebRTCTransport { private _peerConnection?; private _dataChannel?; /** Active `RTCPeerConnection` for the current session, if connected. */ get peerConnection(): WebRTCPeerConnection | undefined; /** Active `"events"` `RTCDataChannel` for the current session, if open. */ get dataChannel(): WebRTCDataChannel | undefined; private _mediaStream; private _videoElement; private _audioElement; private _remoteMediaStream?; private _remoteAudioStream?; private _remoteVideoStream?; private _remoteTracks; private _audioEnabled; private _videoEnabled; private _audioMuteExplicitlySet; private _videoMuteExplicitlySet; private onPeerConnectionCallback?; private readonly rtcConfiguration?; private readonly peerConnectionFactory?; private audioSenders; private videoSenders; private connectGeneration; private activeAttemptCleanup?; /** Creates a new `InteractionWebRTCTransport` instance. */ constructor(options?: InteractionWebRTCTransportOptions); private computeInitialEnabled; /** Local `MediaStream` attached to this transport, or `null` if none. */ get localMediaStream(): WebRTCMediaStream | null; /** Combined remote `MediaStream` received from the server, if any tracks have arrived. */ get remoteMediaStream(): WebRTCMediaStream | undefined; /** Returns whether local audio tracks are currently enabled. */ isAudioEnabled(): boolean; /** Returns whether local video tracks are currently enabled. */ isVideoEnabled(): boolean; /** * Attaches a `