@google/genai 1.34.0 → 1.35.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/genai.d.ts +53 -69
- package/dist/index.cjs +252 -251
- package/dist/index.mjs +253 -252
- package/dist/index.mjs.map +1 -1
- package/dist/node/index.cjs +252 -251
- package/dist/node/index.mjs +253 -252
- package/dist/node/index.mjs.map +1 -1
- package/dist/node/node.d.ts +53 -69
- package/dist/web/index.mjs +253 -252
- package/dist/web/index.mjs.map +1 -1
- package/dist/web/web.d.ts +53 -69
- package/package.json +1 -1
package/dist/node/node.d.ts
CHANGED
|
@@ -581,7 +581,7 @@ declare interface BaseCreateAgentInteractionParams {
|
|
|
581
581
|
/**
|
|
582
582
|
* Body param: The inputs for the interaction.
|
|
583
583
|
*/
|
|
584
|
-
input: string | Array<
|
|
584
|
+
input: string | Array<Content_2> | Array<Turn> | TextContent | ImageContent | AudioContent | DocumentContent | VideoContent | ThoughtContent | FunctionCallContent | FunctionResultContent | CodeExecutionCallContent | CodeExecutionResultContent | URLContextCallContent | URLContextResultContent | GoogleSearchCallContent | GoogleSearchResultContent | MCPServerToolCallContent | MCPServerToolResultContent | FileSearchResultContent;
|
|
585
585
|
/**
|
|
586
586
|
* Path param: Which version of the API to use.
|
|
587
587
|
*/
|
|
@@ -633,7 +633,7 @@ declare interface BaseCreateModelInteractionParams {
|
|
|
633
633
|
/**
|
|
634
634
|
* Body param: The inputs for the interaction.
|
|
635
635
|
*/
|
|
636
|
-
input: string | Array<
|
|
636
|
+
input: string | Array<Content_2> | Array<Turn> | TextContent | ImageContent | AudioContent | DocumentContent | VideoContent | ThoughtContent | FunctionCallContent | FunctionResultContent | CodeExecutionCallContent | CodeExecutionResultContent | URLContextCallContent | URLContextResultContent | GoogleSearchCallContent | GoogleSearchResultContent | MCPServerToolCallContent | MCPServerToolResultContent | FileSearchResultContent;
|
|
637
637
|
/**
|
|
638
638
|
* Body param: The name of the `Model` used for generating the interaction.
|
|
639
639
|
*/
|
|
@@ -1045,7 +1045,7 @@ export declare interface BatchJobSource {
|
|
|
1045
1045
|
|
|
1046
1046
|
export declare type BatchJobSourceUnion = BatchJobSource | InlinedRequest[] | string;
|
|
1047
1047
|
|
|
1048
|
-
/**
|
|
1048
|
+
/** Specifies the function Behavior. Currently only supported by the BidiGenerateContent method. This enum is not supported in Vertex AI. */
|
|
1049
1049
|
export declare enum Behavior {
|
|
1050
1050
|
/**
|
|
1051
1051
|
* This value is unused.
|
|
@@ -1717,11 +1717,15 @@ export declare interface Content {
|
|
|
1717
1717
|
role?: string;
|
|
1718
1718
|
}
|
|
1719
1719
|
|
|
1720
|
+
/**
|
|
1721
|
+
* The content of the response.
|
|
1722
|
+
*/
|
|
1723
|
+
declare type Content_2 = TextContent | ImageContent | AudioContent | DocumentContent | VideoContent | ThoughtContent | FunctionCallContent | FunctionResultContent | CodeExecutionCallContent | CodeExecutionResultContent | URLContextCallContent | URLContextResultContent | GoogleSearchCallContent | GoogleSearchResultContent | MCPServerToolCallContent | MCPServerToolResultContent | FileSearchResultContent;
|
|
1724
|
+
|
|
1720
1725
|
declare interface ContentDelta {
|
|
1721
1726
|
delta?: ContentDelta.TextDelta | ContentDelta.ImageDelta | ContentDelta.AudioDelta | ContentDelta.DocumentDelta | ContentDelta.VideoDelta | ContentDelta.ThoughtSummaryDelta | ContentDelta.ThoughtSignatureDelta | ContentDelta.FunctionCallDelta | ContentDelta.FunctionResultDelta | ContentDelta.CodeExecutionCallDelta | ContentDelta.CodeExecutionResultDelta | ContentDelta.URLContextCallDelta | ContentDelta.URLContextResultDelta | ContentDelta.GoogleSearchCallDelta | ContentDelta.GoogleSearchResultDelta | ContentDelta.MCPServerToolCallDelta | ContentDelta.MCPServerToolResultDelta | ContentDelta.FileSearchResultDelta;
|
|
1722
1727
|
/**
|
|
1723
|
-
* The event_id token to be used to resume the interaction stream, from
|
|
1724
|
-
* this event.
|
|
1728
|
+
* The event_id token to be used to resume the interaction stream, from this event.
|
|
1725
1729
|
*/
|
|
1726
1730
|
event_id?: string;
|
|
1727
1731
|
event_type?: 'content.delta';
|
|
@@ -1986,10 +1990,9 @@ declare interface ContentStart {
|
|
|
1986
1990
|
/**
|
|
1987
1991
|
* The content of the response.
|
|
1988
1992
|
*/
|
|
1989
|
-
content?:
|
|
1993
|
+
content?: Content_2;
|
|
1990
1994
|
/**
|
|
1991
|
-
* The event_id token to be used to resume the interaction stream, from
|
|
1992
|
-
* this event.
|
|
1995
|
+
* The event_id token to be used to resume the interaction stream, from this event.
|
|
1993
1996
|
*/
|
|
1994
1997
|
event_id?: string;
|
|
1995
1998
|
event_type?: 'content.start';
|
|
@@ -1998,8 +2001,7 @@ declare interface ContentStart {
|
|
|
1998
2001
|
|
|
1999
2002
|
declare interface ContentStop {
|
|
2000
2003
|
/**
|
|
2001
|
-
* The event_id token to be used to resume the interaction stream, from
|
|
2002
|
-
* this event.
|
|
2004
|
+
* The event_id token to be used to resume the interaction stream, from this event.
|
|
2003
2005
|
*/
|
|
2004
2006
|
event_id?: string;
|
|
2005
2007
|
event_type?: 'content.stop';
|
|
@@ -2856,13 +2858,13 @@ declare interface DynamicAgentConfig {
|
|
|
2856
2858
|
|
|
2857
2859
|
/** Describes the options to customize dynamic retrieval. */
|
|
2858
2860
|
export declare interface DynamicRetrievalConfig {
|
|
2859
|
-
/** The mode of the predictor to be used in dynamic retrieval. */
|
|
2860
|
-
mode?: DynamicRetrievalConfigMode;
|
|
2861
2861
|
/** Optional. The threshold to be used in dynamic retrieval. If not set, a system default value is used. */
|
|
2862
2862
|
dynamicThreshold?: number;
|
|
2863
|
+
/** The mode of the predictor to be used in dynamic retrieval. */
|
|
2864
|
+
mode?: DynamicRetrievalConfigMode;
|
|
2863
2865
|
}
|
|
2864
2866
|
|
|
2865
|
-
/**
|
|
2867
|
+
/** The mode of the predictor to be used in dynamic retrieval. */
|
|
2866
2868
|
export declare enum DynamicRetrievalConfigMode {
|
|
2867
2869
|
/**
|
|
2868
2870
|
* Always trigger retrieval.
|
|
@@ -3113,8 +3115,7 @@ declare interface ErrorEvent_2 {
|
|
|
3113
3115
|
*/
|
|
3114
3116
|
error?: ErrorEvent_2.Error;
|
|
3115
3117
|
/**
|
|
3116
|
-
* The event_id token to be used to resume the interaction stream, from
|
|
3117
|
-
* this event.
|
|
3118
|
+
* The event_id token to be used to resume the interaction stream, from this event.
|
|
3118
3119
|
*/
|
|
3119
3120
|
event_id?: string;
|
|
3120
3121
|
event_type?: 'error';
|
|
@@ -3543,7 +3544,8 @@ declare class FileSearchStores extends BaseModule {
|
|
|
3543
3544
|
export declare enum FileSource {
|
|
3544
3545
|
SOURCE_UNSPECIFIED = "SOURCE_UNSPECIFIED",
|
|
3545
3546
|
UPLOADED = "UPLOADED",
|
|
3546
|
-
GENERATED = "GENERATED"
|
|
3547
|
+
GENERATED = "GENERATED",
|
|
3548
|
+
REGISTERED = "REGISTERED"
|
|
3547
3549
|
}
|
|
3548
3550
|
|
|
3549
3551
|
/**
|
|
@@ -3721,18 +3723,18 @@ declare interface FunctionCallContent {
|
|
|
3721
3723
|
|
|
3722
3724
|
/** Function calling config. */
|
|
3723
3725
|
export declare interface FunctionCallingConfig {
|
|
3724
|
-
/** Optional. Function calling mode. */
|
|
3725
|
-
mode?: FunctionCallingConfigMode;
|
|
3726
3726
|
/** 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. */
|
|
3727
3727
|
allowedFunctionNames?: string[];
|
|
3728
|
+
/** Optional. Function calling mode. */
|
|
3729
|
+
mode?: FunctionCallingConfigMode;
|
|
3728
3730
|
/** 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. */
|
|
3729
3731
|
streamFunctionCallArguments?: boolean;
|
|
3730
3732
|
}
|
|
3731
3733
|
|
|
3732
|
-
/**
|
|
3734
|
+
/** Function calling mode. */
|
|
3733
3735
|
export declare enum FunctionCallingConfigMode {
|
|
3734
3736
|
/**
|
|
3735
|
-
*
|
|
3737
|
+
* Unspecified function calling mode. This value should not be used.
|
|
3736
3738
|
*/
|
|
3737
3739
|
MODE_UNSPECIFIED = "MODE_UNSPECIFIED",
|
|
3738
3740
|
/**
|
|
@@ -3748,18 +3750,13 @@ export declare enum FunctionCallingConfigMode {
|
|
|
3748
3750
|
*/
|
|
3749
3751
|
NONE = "NONE",
|
|
3750
3752
|
/**
|
|
3751
|
-
* Model
|
|
3753
|
+
* 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".
|
|
3752
3754
|
*/
|
|
3753
3755
|
VALIDATED = "VALIDATED"
|
|
3754
3756
|
}
|
|
3755
3757
|
|
|
3756
|
-
/**
|
|
3757
|
-
|
|
3758
|
-
The inputs are based on `OpenAPI 3.0 specifications
|
|
3759
|
-
<https://spec.openapis.org/oas/v3.0.3>`_. */
|
|
3758
|
+
/** 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. */
|
|
3760
3759
|
export declare interface FunctionDeclaration {
|
|
3761
|
-
/** Defines the function behavior. */
|
|
3762
|
-
behavior?: Behavior;
|
|
3763
3760
|
/** Optional. Description and purpose of the function. Model uses it to decide how and whether to call the function. */
|
|
3764
3761
|
description?: string;
|
|
3765
3762
|
/** 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 and dashes, with a maximum length of 64. */
|
|
@@ -3772,6 +3769,8 @@ export declare interface FunctionDeclaration {
|
|
|
3772
3769
|
response?: Schema;
|
|
3773
3770
|
/** 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`. */
|
|
3774
3771
|
responseJsonSchema?: unknown;
|
|
3772
|
+
/** Optional. Specifies the function Behavior. Currently only supported by the BidiGenerateContent method. This field is not supported in Vertex AI. */
|
|
3773
|
+
behavior?: Behavior;
|
|
3775
3774
|
}
|
|
3776
3775
|
|
|
3777
3776
|
/** A function response. */
|
|
@@ -5433,6 +5432,9 @@ export declare interface ImageConfig {
|
|
|
5433
5432
|
values are `1K`, `2K`, `4K`. If not specified, the model will use default
|
|
5434
5433
|
value `1K`. */
|
|
5435
5434
|
imageSize?: string;
|
|
5435
|
+
/** Controls the generation of people. Supported values are:
|
|
5436
|
+
ALLOW_ALL, ALLOW_ADULT, ALLOW_NONE. */
|
|
5437
|
+
personGeneration?: string;
|
|
5436
5438
|
/** MIME type of the generated image. This field is not
|
|
5437
5439
|
supported in Gemini API. */
|
|
5438
5440
|
outputMimeType?: string;
|
|
@@ -5617,14 +5619,10 @@ declare interface Interaction {
|
|
|
5617
5619
|
* The name of the `Model` used for generating the interaction.
|
|
5618
5620
|
*/
|
|
5619
5621
|
model?: Model_2;
|
|
5620
|
-
/**
|
|
5621
|
-
* Output only. The object type of the interaction. Always set to `interaction`.
|
|
5622
|
-
*/
|
|
5623
|
-
object?: 'interaction';
|
|
5624
5622
|
/**
|
|
5625
5623
|
* Output only. Responses from the model.
|
|
5626
5624
|
*/
|
|
5627
|
-
outputs?: Array<
|
|
5625
|
+
outputs?: Array<Content_2>;
|
|
5628
5626
|
/**
|
|
5629
5627
|
* The ID of the previous interaction, if any.
|
|
5630
5628
|
*/
|
|
@@ -5664,8 +5662,7 @@ declare type InteractionDeleteResponse = unknown;
|
|
|
5664
5662
|
|
|
5665
5663
|
declare interface InteractionEvent {
|
|
5666
5664
|
/**
|
|
5667
|
-
* The event_id token to be used to resume the interaction stream, from
|
|
5668
|
-
* this event.
|
|
5665
|
+
* The event_id token to be used to resume the interaction stream, from this event.
|
|
5669
5666
|
*/
|
|
5670
5667
|
event_id?: string;
|
|
5671
5668
|
event_type?: 'interaction.start' | 'interaction.complete';
|
|
@@ -5715,7 +5712,7 @@ export declare class Interactions extends BaseInteractions {
|
|
|
5715
5712
|
}
|
|
5716
5713
|
|
|
5717
5714
|
export declare namespace Interactions {
|
|
5718
|
-
export { type AllowedTools as AllowedTools, type Annotation as Annotation, type AudioContent as AudioContent, type AudioMimeType as AudioMimeType, type CodeExecutionCallArguments as CodeExecutionCallArguments, type CodeExecutionCallContent as CodeExecutionCallContent, type CodeExecutionResultContent as CodeExecutionResultContent, type ContentDelta as ContentDelta, type ContentStart as ContentStart, type ContentStop as ContentStop, type DeepResearchAgentConfig as DeepResearchAgentConfig, type DocumentContent as DocumentContent, type DocumentMimeType as DocumentMimeType, type DynamicAgentConfig as DynamicAgentConfig, type ErrorEvent_2 as ErrorEvent, type FileSearchResultContent as FileSearchResultContent, type Function_2 as Function, type FunctionCallContent as FunctionCallContent, type FunctionResultContent as FunctionResultContent, type GenerationConfig_2 as GenerationConfig, type GoogleSearchCallArguments as GoogleSearchCallArguments, type GoogleSearchCallContent as GoogleSearchCallContent, type GoogleSearchResult as GoogleSearchResult, type GoogleSearchResultContent as GoogleSearchResultContent, type ImageContent as ImageContent, type ImageMimeType as ImageMimeType, type Interaction as Interaction, type InteractionEvent as InteractionEvent, type InteractionSSEEvent as InteractionSSEEvent, type InteractionStatusUpdate as InteractionStatusUpdate, type MCPServerToolCallContent as MCPServerToolCallContent, type MCPServerToolResultContent as MCPServerToolResultContent, type Model_2 as Model, type SpeechConfig_2 as SpeechConfig, type TextContent as TextContent, type ThinkingLevel_2 as ThinkingLevel, type ThoughtContent as ThoughtContent, type Tool_2 as Tool, type ToolChoice as ToolChoice, type ToolChoiceConfig as ToolChoiceConfig, type ToolChoiceType as ToolChoiceType, type Turn as Turn, type URLContextCallArguments as URLContextCallArguments, type URLContextCallContent as URLContextCallContent, type URLContextResult as URLContextResult, type URLContextResultContent as URLContextResultContent, type Usage as Usage, type VideoContent as VideoContent, type VideoMimeType as VideoMimeType, type InteractionDeleteResponse as InteractionDeleteResponse, type InteractionCreateParams as InteractionCreateParams, type CreateModelInteractionParamsNonStreaming as CreateModelInteractionParamsNonStreaming, type CreateModelInteractionParamsStreaming as CreateModelInteractionParamsStreaming, type CreateAgentInteractionParamsNonStreaming as CreateAgentInteractionParamsNonStreaming, type CreateAgentInteractionParamsStreaming as CreateAgentInteractionParamsStreaming, type InteractionDeleteParams as InteractionDeleteParams, type InteractionCancelParams as InteractionCancelParams, type InteractionGetParams as InteractionGetParams, type InteractionGetParamsNonStreaming as InteractionGetParamsNonStreaming, type InteractionGetParamsStreaming as InteractionGetParamsStreaming, };
|
|
5715
|
+
export { type AllowedTools as AllowedTools, type Annotation as Annotation, type AudioContent as AudioContent, type AudioMimeType as AudioMimeType, type CodeExecutionCallArguments as CodeExecutionCallArguments, type CodeExecutionCallContent as CodeExecutionCallContent, type CodeExecutionResultContent as CodeExecutionResultContent, type Content_2 as Content, type ContentDelta as ContentDelta, type ContentStart as ContentStart, type ContentStop as ContentStop, type DeepResearchAgentConfig as DeepResearchAgentConfig, type DocumentContent as DocumentContent, type DocumentMimeType as DocumentMimeType, type DynamicAgentConfig as DynamicAgentConfig, type ErrorEvent_2 as ErrorEvent, type FileSearchResultContent as FileSearchResultContent, type Function_2 as Function, type FunctionCallContent as FunctionCallContent, type FunctionResultContent as FunctionResultContent, type GenerationConfig_2 as GenerationConfig, type GoogleSearchCallArguments as GoogleSearchCallArguments, type GoogleSearchCallContent as GoogleSearchCallContent, type GoogleSearchResult as GoogleSearchResult, type GoogleSearchResultContent as GoogleSearchResultContent, type ImageContent as ImageContent, type ImageMimeType as ImageMimeType, type Interaction as Interaction, type InteractionEvent as InteractionEvent, type InteractionSSEEvent as InteractionSSEEvent, type InteractionStatusUpdate as InteractionStatusUpdate, type MCPServerToolCallContent as MCPServerToolCallContent, type MCPServerToolResultContent as MCPServerToolResultContent, type Model_2 as Model, type SpeechConfig_2 as SpeechConfig, type TextContent as TextContent, type ThinkingLevel_2 as ThinkingLevel, type ThoughtContent as ThoughtContent, type Tool_2 as Tool, type ToolChoice as ToolChoice, type ToolChoiceConfig as ToolChoiceConfig, type ToolChoiceType as ToolChoiceType, type Turn as Turn, type URLContextCallArguments as URLContextCallArguments, type URLContextCallContent as URLContextCallContent, type URLContextResult as URLContextResult, type URLContextResultContent as URLContextResultContent, type Usage as Usage, type VideoContent as VideoContent, type VideoMimeType as VideoMimeType, type InteractionDeleteResponse as InteractionDeleteResponse, type InteractionCreateParams as InteractionCreateParams, type CreateModelInteractionParamsNonStreaming as CreateModelInteractionParamsNonStreaming, type CreateModelInteractionParamsStreaming as CreateModelInteractionParamsStreaming, type CreateAgentInteractionParamsNonStreaming as CreateAgentInteractionParamsNonStreaming, type CreateAgentInteractionParamsStreaming as CreateAgentInteractionParamsStreaming, type InteractionDeleteParams as InteractionDeleteParams, type InteractionCancelParams as InteractionCancelParams, type InteractionGetParams as InteractionGetParams, type InteractionGetParamsNonStreaming as InteractionGetParamsNonStreaming, type InteractionGetParamsStreaming as InteractionGetParamsStreaming, };
|
|
5719
5716
|
}
|
|
5720
5717
|
|
|
5721
5718
|
declare namespace InteractionsAPI {
|
|
@@ -5729,6 +5726,7 @@ declare namespace InteractionsAPI {
|
|
|
5729
5726
|
CodeExecutionCallArguments,
|
|
5730
5727
|
CodeExecutionCallContent,
|
|
5731
5728
|
CodeExecutionResultContent,
|
|
5729
|
+
Content_2 as Content,
|
|
5732
5730
|
ContentDelta,
|
|
5733
5731
|
ContentStart,
|
|
5734
5732
|
ContentStop,
|
|
@@ -5792,8 +5790,7 @@ declare type InteractionSSEEvent = InteractionEvent | InteractionStatusUpdate |
|
|
|
5792
5790
|
|
|
5793
5791
|
declare interface InteractionStatusUpdate {
|
|
5794
5792
|
/**
|
|
5795
|
-
* The event_id token to be used to resume the interaction stream, from
|
|
5796
|
-
* this event.
|
|
5793
|
+
* The event_id token to be used to resume the interaction stream, from this event.
|
|
5797
5794
|
*/
|
|
5798
5795
|
event_id?: string;
|
|
5799
5796
|
event_type?: 'interaction.status_update';
|
|
@@ -7108,18 +7105,6 @@ export declare interface ModalityTokenCount {
|
|
|
7108
7105
|
tokenCount?: number;
|
|
7109
7106
|
}
|
|
7110
7107
|
|
|
7111
|
-
/** The mode of the predictor to be used in dynamic retrieval. */
|
|
7112
|
-
export declare enum Mode {
|
|
7113
|
-
/**
|
|
7114
|
-
* Always trigger retrieval.
|
|
7115
|
-
*/
|
|
7116
|
-
MODE_UNSPECIFIED = "MODE_UNSPECIFIED",
|
|
7117
|
-
/**
|
|
7118
|
-
* Run retrieval only when system decides it is necessary.
|
|
7119
|
-
*/
|
|
7120
|
-
MODE_DYNAMIC = "MODE_DYNAMIC"
|
|
7121
|
-
}
|
|
7122
|
-
|
|
7123
7108
|
/** A trained machine learning model. */
|
|
7124
7109
|
export declare interface Model {
|
|
7125
7110
|
/** Resource name of the model. */
|
|
@@ -7178,7 +7163,7 @@ export declare interface Model {
|
|
|
7178
7163
|
/**
|
|
7179
7164
|
* The model that will complete your prompt.\n\nSee [models](https://ai.google.dev/gemini-api/docs/models) for additional details.
|
|
7180
7165
|
*/
|
|
7181
|
-
declare type Model_2 = 'gemini-2.5-pro' | 'gemini-2.5-flash' | 'gemini-2.5-flash-preview-09-2025' | 'gemini-2.5-flash-lite' | 'gemini-2.5-flash-lite-preview-09-2025' | 'gemini-2.5-flash-preview-native-audio-dialog' | 'gemini-2.5-flash-image-preview' | 'gemini-2.5-pro-preview-tts' | 'gemini-3-pro-preview' | (string & {});
|
|
7166
|
+
declare type Model_2 = 'gemini-2.5-pro' | 'gemini-2.5-flash' | 'gemini-2.5-flash-preview-09-2025' | 'gemini-2.5-flash-lite' | 'gemini-2.5-flash-lite-preview-09-2025' | 'gemini-2.5-flash-preview-native-audio-dialog' | 'gemini-2.5-flash-image-preview' | 'gemini-2.5-pro-preview-tts' | 'gemini-3-pro-preview' | 'gemini-3-flash-preview' | (string & {});
|
|
7182
7167
|
|
|
7183
7168
|
export declare class Models extends BaseModule {
|
|
7184
7169
|
private readonly apiClient;
|
|
@@ -7290,7 +7275,7 @@ export declare class Models extends BaseModule {
|
|
|
7290
7275
|
* @example
|
|
7291
7276
|
* ```ts
|
|
7292
7277
|
* const response = await client.models.generateImages({
|
|
7293
|
-
* model: 'imagen-
|
|
7278
|
+
* model: 'imagen-4.0-generate-001',
|
|
7294
7279
|
* prompt: 'Robot holding a red skateboard',
|
|
7295
7280
|
* config: {
|
|
7296
7281
|
* numberOfImages: 1,
|
|
@@ -7333,7 +7318,7 @@ export declare class Models extends BaseModule {
|
|
|
7333
7318
|
* @example
|
|
7334
7319
|
* ```ts
|
|
7335
7320
|
* const response = await client.models.upscaleImage({
|
|
7336
|
-
* model: 'imagen-
|
|
7321
|
+
* model: 'imagen-4.0-upscale-preview',
|
|
7337
7322
|
* image: image,
|
|
7338
7323
|
* upscaleFactor: 'x2',
|
|
7339
7324
|
* config: {
|
|
@@ -7432,7 +7417,7 @@ export declare class Models extends BaseModule {
|
|
|
7432
7417
|
* console.log(response1?.generatedImages?.[0]?.image?.imageBytes);
|
|
7433
7418
|
*
|
|
7434
7419
|
* const response2 = await ai.models.recontextImage({
|
|
7435
|
-
* model: 'virtual-try-on-
|
|
7420
|
+
* model: 'virtual-try-on-001',
|
|
7436
7421
|
* source: {
|
|
7437
7422
|
* personImage: personImage,
|
|
7438
7423
|
* productImages: [productImage],
|
|
@@ -9287,12 +9272,8 @@ export declare interface TokensInfo {
|
|
|
9287
9272
|
|
|
9288
9273
|
/** Tool details of a tool that the model may use to generate a response. */
|
|
9289
9274
|
export declare interface Tool {
|
|
9290
|
-
/** List of function declarations that the tool supports. */
|
|
9291
|
-
functionDeclarations?: FunctionDeclaration[];
|
|
9292
9275
|
/** Optional. Retrieval tool type. System will always execute the provided retrieval tool(s) to get external knowledge to answer the prompt. Retrieval results are presented to the model for generation. This field is not supported in Gemini API. */
|
|
9293
9276
|
retrieval?: Retrieval;
|
|
9294
|
-
/** Optional. Specialized retrieval tool that is powered by Google Search. */
|
|
9295
|
-
googleSearchRetrieval?: GoogleSearchRetrieval;
|
|
9296
9277
|
/** Optional. Tool to support the model interacting directly with the
|
|
9297
9278
|
computer. If enabled, it automatically populates computer-use specific
|
|
9298
9279
|
Function Declarations. */
|
|
@@ -9303,10 +9284,14 @@ export declare interface Tool {
|
|
|
9303
9284
|
codeExecution?: ToolCodeExecution;
|
|
9304
9285
|
/** Optional. Tool to support searching public web data, powered by Vertex AI Search and Sec4 compliance. This field is not supported in Gemini API. */
|
|
9305
9286
|
enterpriseWebSearch?: EnterpriseWebSearch;
|
|
9287
|
+
/** Optional. Function tool type. One or more function declarations to be passed to the model along with the current user query. Model may decide to call a subset of these functions by populating FunctionCall in the response. User should provide a FunctionResponse for each function call in the next turn. Based on the function responses, Model will generate the final response back to the user. Maximum 512 function declarations can be provided. */
|
|
9288
|
+
functionDeclarations?: FunctionDeclaration[];
|
|
9306
9289
|
/** Optional. GoogleMaps tool type. Tool to support Google Maps in Model. */
|
|
9307
9290
|
googleMaps?: GoogleMaps;
|
|
9308
9291
|
/** Optional. GoogleSearch tool type. Tool to support Google Search in Model. Powered by Google. */
|
|
9309
9292
|
googleSearch?: GoogleSearch;
|
|
9293
|
+
/** Optional. Specialized retrieval tool that is powered by Google Search. */
|
|
9294
|
+
googleSearchRetrieval?: GoogleSearchRetrieval;
|
|
9310
9295
|
/** Optional. Tool to support URL context retrieval. */
|
|
9311
9296
|
urlContext?: UrlContext;
|
|
9312
9297
|
}
|
|
@@ -9416,10 +9401,10 @@ export declare interface ToolCodeExecution {
|
|
|
9416
9401
|
|
|
9417
9402
|
This config is shared for all tools provided in the request. */
|
|
9418
9403
|
export declare interface ToolConfig {
|
|
9419
|
-
/** Optional. Function calling config. */
|
|
9420
|
-
functionCallingConfig?: FunctionCallingConfig;
|
|
9421
9404
|
/** Optional. Retrieval config. */
|
|
9422
9405
|
retrievalConfig?: RetrievalConfig;
|
|
9406
|
+
/** Optional. Function calling config. */
|
|
9407
|
+
functionCallingConfig?: FunctionCallingConfig;
|
|
9423
9408
|
}
|
|
9424
9409
|
|
|
9425
9410
|
export declare type ToolListUnion = ToolUnion[];
|
|
@@ -9709,7 +9694,7 @@ declare interface Turn {
|
|
|
9709
9694
|
/**
|
|
9710
9695
|
* The content of the turn.
|
|
9711
9696
|
*/
|
|
9712
|
-
content?: string | Array<
|
|
9697
|
+
content?: string | Array<Content_2>;
|
|
9713
9698
|
/**
|
|
9714
9699
|
* The originator of this turn. Must be user for input or model for
|
|
9715
9700
|
* model output.
|
|
@@ -9806,11 +9791,13 @@ declare namespace types {
|
|
|
9806
9791
|
Language,
|
|
9807
9792
|
FunctionResponseScheduling,
|
|
9808
9793
|
Type,
|
|
9809
|
-
Mode,
|
|
9810
9794
|
ApiSpec,
|
|
9811
9795
|
AuthType,
|
|
9812
9796
|
HttpElementLocation,
|
|
9813
9797
|
PhishBlockThreshold,
|
|
9798
|
+
Behavior,
|
|
9799
|
+
DynamicRetrievalConfigMode,
|
|
9800
|
+
FunctionCallingConfigMode,
|
|
9814
9801
|
ThinkingLevel,
|
|
9815
9802
|
HarmCategory,
|
|
9816
9803
|
HarmBlockMethod,
|
|
@@ -9829,10 +9816,7 @@ declare namespace types {
|
|
|
9829
9816
|
TuningTask,
|
|
9830
9817
|
PartMediaResolutionLevel,
|
|
9831
9818
|
FeatureSelectionPreference,
|
|
9832
|
-
Behavior,
|
|
9833
|
-
DynamicRetrievalConfigMode,
|
|
9834
9819
|
Environment,
|
|
9835
|
-
FunctionCallingConfigMode,
|
|
9836
9820
|
SafetyFilterLevel,
|
|
9837
9821
|
PersonGeneration,
|
|
9838
9822
|
ImagePromptLanguage,
|
|
@@ -9875,9 +9859,6 @@ declare namespace types {
|
|
|
9875
9859
|
HttpOptions,
|
|
9876
9860
|
Schema,
|
|
9877
9861
|
ModelSelectionConfig,
|
|
9878
|
-
FunctionDeclaration,
|
|
9879
|
-
DynamicRetrievalConfig,
|
|
9880
|
-
GoogleSearchRetrieval,
|
|
9881
9862
|
ComputerUse,
|
|
9882
9863
|
FileSearch,
|
|
9883
9864
|
ApiAuthApiKeyConfig,
|
|
@@ -9904,14 +9885,17 @@ declare namespace types {
|
|
|
9904
9885
|
Retrieval,
|
|
9905
9886
|
ToolCodeExecution,
|
|
9906
9887
|
EnterpriseWebSearch,
|
|
9888
|
+
FunctionDeclaration,
|
|
9907
9889
|
GoogleMaps,
|
|
9908
9890
|
Interval,
|
|
9909
9891
|
GoogleSearch,
|
|
9892
|
+
DynamicRetrievalConfig,
|
|
9893
|
+
GoogleSearchRetrieval,
|
|
9910
9894
|
UrlContext,
|
|
9911
9895
|
Tool,
|
|
9912
|
-
FunctionCallingConfig,
|
|
9913
9896
|
LatLng,
|
|
9914
9897
|
RetrievalConfig,
|
|
9898
|
+
FunctionCallingConfig,
|
|
9915
9899
|
ToolConfig,
|
|
9916
9900
|
ReplicatedVoiceConfig,
|
|
9917
9901
|
PrebuiltVoiceConfig,
|
|
@@ -10654,7 +10638,7 @@ declare interface Usage {
|
|
|
10654
10638
|
/**
|
|
10655
10639
|
* Number of tokens of thoughts for thinking models.
|
|
10656
10640
|
*/
|
|
10657
|
-
|
|
10641
|
+
total_thought_tokens?: number;
|
|
10658
10642
|
/**
|
|
10659
10643
|
* Total token count for the interaction request (prompt + responses + other
|
|
10660
10644
|
* internal tokens).
|