@google/genai 1.37.0 → 1.39.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 +195 -50
- package/dist/index.cjs +443 -169
- package/dist/index.mjs +443 -170
- package/dist/index.mjs.map +1 -1
- package/dist/node/index.cjs +489 -170
- package/dist/node/index.mjs +489 -171
- package/dist/node/index.mjs.map +1 -1
- package/dist/node/node.d.ts +195 -50
- package/dist/tokenizer/node.cjs +16 -0
- package/dist/tokenizer/node.d.ts +14 -0
- package/dist/tokenizer/node.mjs +16 -0
- package/dist/tokenizer/node.mjs.map +1 -1
- package/dist/web/index.mjs +443 -170
- package/dist/web/index.mjs.map +1 -1
- package/dist/web/web.d.ts +195 -50
- package/package.json +1 -1
package/dist/node/node.d.ts
CHANGED
|
@@ -121,25 +121,12 @@ export declare interface ApiAuthApiKeyConfig {
|
|
|
121
121
|
*/
|
|
122
122
|
declare class ApiClient implements GeminiNextGenAPIClientAdapter {
|
|
123
123
|
readonly clientOptions: ApiClientInitOptions;
|
|
124
|
+
private readonly customBaseUrl?;
|
|
124
125
|
constructor(opts: ApiClientInitOptions);
|
|
125
|
-
/**
|
|
126
|
-
* Determines the base URL for Vertex AI based on project and location.
|
|
127
|
-
* Uses the global endpoint if location is 'global' or if project/location
|
|
128
|
-
* are not specified (implying API key usage).
|
|
129
|
-
* @private
|
|
130
|
-
*/
|
|
131
|
-
private baseUrlFromProjectLocation;
|
|
132
|
-
/**
|
|
133
|
-
* Normalizes authentication parameters for Vertex AI.
|
|
134
|
-
* If project and location are provided, API key is cleared.
|
|
135
|
-
* If project and location are not provided (implying API key usage),
|
|
136
|
-
* project and location are cleared.
|
|
137
|
-
* @private
|
|
138
|
-
*/
|
|
139
|
-
private normalizeAuthParameters;
|
|
140
126
|
isVertexAI(): boolean;
|
|
141
127
|
getProject(): string | undefined;
|
|
142
128
|
getLocation(): string | undefined;
|
|
129
|
+
getCustomBaseUrl(): string | undefined;
|
|
143
130
|
getAuthHeaders(): Promise<Headers>;
|
|
144
131
|
getApiVersion(): string;
|
|
145
132
|
getBaseUrl(): string;
|
|
@@ -580,6 +567,10 @@ declare class BadRequestError extends APIError<400, Headers> {
|
|
|
580
567
|
}
|
|
581
568
|
|
|
582
569
|
declare interface BaseCreateAgentInteractionParams {
|
|
570
|
+
/**
|
|
571
|
+
* Path param: Which version of the API to use.
|
|
572
|
+
*/
|
|
573
|
+
api_version?: string;
|
|
583
574
|
/**
|
|
584
575
|
* Body param: The name of the `Agent` used for generating the interaction.
|
|
585
576
|
*/
|
|
@@ -588,16 +579,12 @@ declare interface BaseCreateAgentInteractionParams {
|
|
|
588
579
|
* Body param: The inputs for the interaction.
|
|
589
580
|
*/
|
|
590
581
|
input: string | Array<Content_2> | Array<Turn> | TextContent | ImageContent | AudioContent | DocumentContent | VideoContent | ThoughtContent | FunctionCallContent | FunctionResultContent | CodeExecutionCallContent | CodeExecutionResultContent | URLContextCallContent | URLContextResultContent | GoogleSearchCallContent | GoogleSearchResultContent | MCPServerToolCallContent | MCPServerToolResultContent | FileSearchCallContent | FileSearchResultContent;
|
|
591
|
-
/**
|
|
592
|
-
* Path param: Which version of the API to use.
|
|
593
|
-
*/
|
|
594
|
-
api_version?: string;
|
|
595
582
|
/**
|
|
596
583
|
* Body param: Configuration for the agent.
|
|
597
584
|
*/
|
|
598
585
|
agent_config?: DynamicAgentConfig | DeepResearchAgentConfig;
|
|
599
586
|
/**
|
|
600
|
-
* Body param: Whether to run the model interaction in the background.
|
|
587
|
+
* Body param: Input only. Whether to run the model interaction in the background.
|
|
601
588
|
*/
|
|
602
589
|
background?: boolean;
|
|
603
590
|
/**
|
|
@@ -636,6 +623,10 @@ declare interface BaseCreateAgentInteractionParams {
|
|
|
636
623
|
}
|
|
637
624
|
|
|
638
625
|
declare interface BaseCreateModelInteractionParams {
|
|
626
|
+
/**
|
|
627
|
+
* Path param: Which version of the API to use.
|
|
628
|
+
*/
|
|
629
|
+
api_version?: string;
|
|
639
630
|
/**
|
|
640
631
|
* Body param: The inputs for the interaction.
|
|
641
632
|
*/
|
|
@@ -645,11 +636,7 @@ declare interface BaseCreateModelInteractionParams {
|
|
|
645
636
|
*/
|
|
646
637
|
model: Model_2;
|
|
647
638
|
/**
|
|
648
|
-
*
|
|
649
|
-
*/
|
|
650
|
-
api_version?: string;
|
|
651
|
-
/**
|
|
652
|
-
* Body param: Whether to run the model interaction in the background.
|
|
639
|
+
* Body param: Input only. Whether to run the model interaction in the background.
|
|
653
640
|
*/
|
|
654
641
|
background?: boolean;
|
|
655
642
|
/**
|
|
@@ -788,6 +775,7 @@ declare class BaseInteractions extends APIResource {
|
|
|
788
775
|
* @example
|
|
789
776
|
* ```ts
|
|
790
777
|
* const interaction = await client.interactions.create({
|
|
778
|
+
* api_version: 'api_version',
|
|
791
779
|
* input: 'string',
|
|
792
780
|
* model: 'gemini-2.5-pro',
|
|
793
781
|
* });
|
|
@@ -803,7 +791,9 @@ declare class BaseInteractions extends APIResource {
|
|
|
803
791
|
*
|
|
804
792
|
* @example
|
|
805
793
|
* ```ts
|
|
806
|
-
* const interaction = await client.interactions.delete('id'
|
|
794
|
+
* const interaction = await client.interactions.delete('id', {
|
|
795
|
+
* api_version: 'api_version',
|
|
796
|
+
* });
|
|
807
797
|
* ```
|
|
808
798
|
*/
|
|
809
799
|
delete(id: string, params?: InteractionDeleteParams | null | undefined, options?: RequestOptions): APIPromise<unknown>;
|
|
@@ -812,7 +802,9 @@ declare class BaseInteractions extends APIResource {
|
|
|
812
802
|
*
|
|
813
803
|
* @example
|
|
814
804
|
* ```ts
|
|
815
|
-
* const interaction = await client.interactions.cancel('id'
|
|
805
|
+
* const interaction = await client.interactions.cancel('id', {
|
|
806
|
+
* api_version: 'api_version',
|
|
807
|
+
* });
|
|
816
808
|
* ```
|
|
817
809
|
*/
|
|
818
810
|
cancel(id: string, params?: InteractionCancelParams | null | undefined, options?: RequestOptions): APIPromise<Interaction>;
|
|
@@ -821,7 +813,9 @@ declare class BaseInteractions extends APIResource {
|
|
|
821
813
|
*
|
|
822
814
|
* @example
|
|
823
815
|
* ```ts
|
|
824
|
-
* const interaction = await client.interactions.get('id'
|
|
816
|
+
* const interaction = await client.interactions.get('id', {
|
|
817
|
+
* api_version: 'api_version',
|
|
818
|
+
* });
|
|
825
819
|
* ```
|
|
826
820
|
*/
|
|
827
821
|
get(id: string, params?: InteractionGetParamsNonStreaming, options?: RequestOptions): APIPromise<Interaction>;
|
|
@@ -1837,7 +1831,7 @@ declare namespace ContentDelta {
|
|
|
1837
1831
|
}
|
|
1838
1832
|
namespace FunctionResultDelta {
|
|
1839
1833
|
interface Items {
|
|
1840
|
-
items?: Array<
|
|
1834
|
+
items?: Array<InteractionsAPI.TextContent | InteractionsAPI.ImageContent | unknown>;
|
|
1841
1835
|
}
|
|
1842
1836
|
}
|
|
1843
1837
|
interface CodeExecutionCallDelta {
|
|
@@ -2452,7 +2446,7 @@ export declare interface CreateTuningJobConfig {
|
|
|
2452
2446
|
be charged usage for any applicable operations.
|
|
2453
2447
|
*/
|
|
2454
2448
|
abortSignal?: AbortSignal;
|
|
2455
|
-
/** The method to use for tuning (SUPERVISED_FINE_TUNING or PREFERENCE_TUNING). If not set, the default method (SFT) will be used. */
|
|
2449
|
+
/** The method to use for tuning (SUPERVISED_FINE_TUNING or PREFERENCE_TUNING or DISTILLATION). If not set, the default method (SFT) will be used. */
|
|
2456
2450
|
method?: TuningMethod;
|
|
2457
2451
|
/** Validation dataset for tuning. The dataset must be formatted as a JSONL file. */
|
|
2458
2452
|
validationDataset?: TuningValidationDataset;
|
|
@@ -2462,7 +2456,7 @@ export declare interface CreateTuningJobConfig {
|
|
|
2462
2456
|
description?: string;
|
|
2463
2457
|
/** Number of complete passes the model makes over the entire training dataset during training. */
|
|
2464
2458
|
epochCount?: number;
|
|
2465
|
-
/** Multiplier for adjusting the default learning rate. */
|
|
2459
|
+
/** Multiplier for adjusting the default learning rate. 1P models only. Mutually exclusive with learning_rate. */
|
|
2466
2460
|
learningRateMultiplier?: number;
|
|
2467
2461
|
/** If set to true, disable intermediate checkpoints and only the last checkpoint will be exported. Otherwise, enable intermediate checkpoints. */
|
|
2468
2462
|
exportLastCheckpointOnly?: boolean;
|
|
@@ -2470,14 +2464,26 @@ export declare interface CreateTuningJobConfig {
|
|
|
2470
2464
|
preTunedModelCheckpointId?: string;
|
|
2471
2465
|
/** Adapter size for tuning. */
|
|
2472
2466
|
adapterSize?: AdapterSize;
|
|
2473
|
-
/**
|
|
2467
|
+
/** Tuning mode for SFT tuning. */
|
|
2468
|
+
tuningMode?: TuningMode;
|
|
2469
|
+
/** Custom base model for tuning. This is only supported for OSS models in Vertex. */
|
|
2470
|
+
customBaseModel?: string;
|
|
2471
|
+
/** The batch size hyperparameter for tuning. This is only supported for OSS models in Vertex. */
|
|
2474
2472
|
batchSize?: number;
|
|
2475
|
-
/** The learning rate
|
|
2473
|
+
/** The learning rate for tuning. OSS models only. Mutually exclusive with learning_rate_multiplier. */
|
|
2476
2474
|
learningRate?: number;
|
|
2477
2475
|
/** 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. */
|
|
2478
2476
|
labels?: Record<string, string>;
|
|
2479
2477
|
/** Weight for KL Divergence regularization, Preference Optimization tuning only. */
|
|
2480
2478
|
beta?: number;
|
|
2479
|
+
/** The base teacher model that is being distilled. Distillation only. */
|
|
2480
|
+
baseTeacherModel?: string;
|
|
2481
|
+
/** The resource name of the Tuned teacher model. Distillation only. */
|
|
2482
|
+
tunedTeacherModelSource?: string;
|
|
2483
|
+
/** Multiplier for adjusting the weight of the SFT loss. Distillation only. */
|
|
2484
|
+
sftLossWeightMultiplier?: number;
|
|
2485
|
+
/** The Google Cloud Storage location where the tuning job outputs are written. */
|
|
2486
|
+
outputUri?: string;
|
|
2481
2487
|
}
|
|
2482
2488
|
|
|
2483
2489
|
/** Fine-tuning job creation parameters - optional fields. */
|
|
@@ -2752,6 +2758,36 @@ export declare interface DistillationDataStats {
|
|
|
2752
2758
|
trainingDatasetStats?: DatasetStats;
|
|
2753
2759
|
}
|
|
2754
2760
|
|
|
2761
|
+
/** Hyperparameters for Distillation. This data type is not supported in Gemini API. */
|
|
2762
|
+
export declare interface DistillationHyperParameters {
|
|
2763
|
+
/** Optional. Adapter size for distillation. */
|
|
2764
|
+
adapterSize?: AdapterSize;
|
|
2765
|
+
/** Optional. Number of complete passes the model makes over the entire training dataset during training. */
|
|
2766
|
+
epochCount?: string;
|
|
2767
|
+
/** Optional. Multiplier for adjusting the default learning rate. */
|
|
2768
|
+
learningRateMultiplier?: number;
|
|
2769
|
+
}
|
|
2770
|
+
|
|
2771
|
+
/** Distillation tuning spec for tuning. */
|
|
2772
|
+
export declare interface DistillationSpec {
|
|
2773
|
+
/** The GCS URI of the prompt dataset to use during distillation. */
|
|
2774
|
+
promptDatasetUri?: string;
|
|
2775
|
+
/** 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). */
|
|
2776
|
+
baseTeacherModel?: string;
|
|
2777
|
+
/** Optional. Hyperparameters for Distillation. */
|
|
2778
|
+
hyperParameters?: DistillationHyperParameters;
|
|
2779
|
+
/** 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. */
|
|
2780
|
+
pipelineRootDirectory?: string;
|
|
2781
|
+
/** The student model that is being tuned, e.g., "google/gemma-2b-1.1-it". Deprecated. Use base_model instead. */
|
|
2782
|
+
studentModel?: string;
|
|
2783
|
+
/** Deprecated. Cloud Storage path to file containing training dataset for tuning. The dataset must be formatted as a JSONL file. */
|
|
2784
|
+
trainingDatasetUri?: string;
|
|
2785
|
+
/** The resource name of the Tuned teacher model. Format: `projects/{project}/locations/{location}/models/{model}`. */
|
|
2786
|
+
tunedTeacherModelSource?: string;
|
|
2787
|
+
/** Optional. Cloud Storage path to file containing validation dataset for tuning. The dataset must be formatted as a JSONL file. */
|
|
2788
|
+
validationDatasetUri?: string;
|
|
2789
|
+
}
|
|
2790
|
+
|
|
2755
2791
|
/** A Document is a collection of Chunks. */
|
|
2756
2792
|
declare interface Document_2 {
|
|
2757
2793
|
/** The resource name of the Document.
|
|
@@ -3385,6 +3421,12 @@ export declare class Files extends BaseModule {
|
|
|
3385
3421
|
* ```
|
|
3386
3422
|
*/
|
|
3387
3423
|
download(params: types.DownloadFileParameters): Promise<void>;
|
|
3424
|
+
/**
|
|
3425
|
+
* Registers Google Cloud Storage files for use with the API.
|
|
3426
|
+
* This method is only available in Node.js environments.
|
|
3427
|
+
*/
|
|
3428
|
+
registerFiles(params: types.RegisterFilesParameters): Promise<types.RegisterFilesResponse>;
|
|
3429
|
+
protected _registerFiles(params: types.InternalRegisterFilesParameters): Promise<types.RegisterFilesResponse>;
|
|
3388
3430
|
private listInternal;
|
|
3389
3431
|
private createInternal;
|
|
3390
3432
|
/**
|
|
@@ -3417,6 +3459,7 @@ export declare class Files extends BaseModule {
|
|
|
3417
3459
|
* ```
|
|
3418
3460
|
*/
|
|
3419
3461
|
delete(params: types.DeleteFileParameters): Promise<types.DeleteFileResponse>;
|
|
3462
|
+
private registerFilesInternal;
|
|
3420
3463
|
}
|
|
3421
3464
|
|
|
3422
3465
|
/** Tool to retrieve knowledge from the File Search Stores. */
|
|
@@ -3919,7 +3962,7 @@ declare interface FunctionResultContent {
|
|
|
3919
3962
|
|
|
3920
3963
|
declare namespace FunctionResultContent {
|
|
3921
3964
|
interface Items {
|
|
3922
|
-
items?: Array<
|
|
3965
|
+
items?: Array<InteractionsAPI.TextContent | InteractionsAPI.ImageContent | unknown>;
|
|
3923
3966
|
}
|
|
3924
3967
|
}
|
|
3925
3968
|
|
|
@@ -4115,6 +4158,10 @@ export declare interface GenerateContentConfig {
|
|
|
4115
4158
|
models. This field is not supported in Vertex AI.
|
|
4116
4159
|
*/
|
|
4117
4160
|
enableEnhancedCivicAnswers?: boolean;
|
|
4161
|
+
/** Settings for prompt and response sanitization using the Model Armor
|
|
4162
|
+
service. If supplied, safety_settings must not be supplied.
|
|
4163
|
+
*/
|
|
4164
|
+
modelArmorConfig?: ModelArmorConfig;
|
|
4118
4165
|
}
|
|
4119
4166
|
|
|
4120
4167
|
/** Config for models.generate_content parameters. */
|
|
@@ -5381,6 +5428,8 @@ declare type HTTPMethod = 'get' | 'post' | 'put' | 'patch' | 'delete';
|
|
|
5381
5428
|
export declare interface HttpOptions {
|
|
5382
5429
|
/** The base URL for the AI platform service endpoint. */
|
|
5383
5430
|
baseUrl?: string;
|
|
5431
|
+
/** The resource scope used to constructing the resource name when base_url is set */
|
|
5432
|
+
baseUrlResourceScope?: ResourceScope;
|
|
5384
5433
|
/** Specifies the version of the API to use. */
|
|
5385
5434
|
apiVersion?: string;
|
|
5386
5435
|
/** Additional HTTP headers to be sent with the request. */
|
|
@@ -5649,6 +5698,8 @@ export declare class InlinedResponse {
|
|
|
5649
5698
|
/** The response to the request.
|
|
5650
5699
|
*/
|
|
5651
5700
|
response?: GenerateContentResponse;
|
|
5701
|
+
/** The metadata to be associated with the request. */
|
|
5702
|
+
metadata?: Record<string, string>;
|
|
5652
5703
|
/** The error encountered while processing the request.
|
|
5653
5704
|
*/
|
|
5654
5705
|
error?: JobError;
|
|
@@ -5709,6 +5760,18 @@ declare interface InteractionCancelParams {
|
|
|
5709
5760
|
api_version?: string;
|
|
5710
5761
|
}
|
|
5711
5762
|
|
|
5763
|
+
declare interface InteractionCompleteEvent {
|
|
5764
|
+
/**
|
|
5765
|
+
* The event_id token to be used to resume the interaction stream, from this event.
|
|
5766
|
+
*/
|
|
5767
|
+
event_id?: string;
|
|
5768
|
+
event_type?: 'interaction.complete';
|
|
5769
|
+
/**
|
|
5770
|
+
* The Interaction resource.
|
|
5771
|
+
*/
|
|
5772
|
+
interaction?: Interaction;
|
|
5773
|
+
}
|
|
5774
|
+
|
|
5712
5775
|
declare type InteractionCreateParams = CreateModelInteractionParamsNonStreaming | CreateModelInteractionParamsStreaming | CreateAgentInteractionParamsNonStreaming | CreateAgentInteractionParamsStreaming;
|
|
5713
5776
|
|
|
5714
5777
|
declare interface InteractionDeleteParams {
|
|
@@ -5720,18 +5783,6 @@ declare interface InteractionDeleteParams {
|
|
|
5720
5783
|
|
|
5721
5784
|
declare type InteractionDeleteResponse = unknown;
|
|
5722
5785
|
|
|
5723
|
-
declare interface InteractionEvent {
|
|
5724
|
-
/**
|
|
5725
|
-
* The event_id token to be used to resume the interaction stream, from this event.
|
|
5726
|
-
*/
|
|
5727
|
-
event_id?: string;
|
|
5728
|
-
event_type?: 'interaction.start' | 'interaction.complete';
|
|
5729
|
-
/**
|
|
5730
|
-
* The Interaction resource.
|
|
5731
|
-
*/
|
|
5732
|
-
interaction?: Interaction;
|
|
5733
|
-
}
|
|
5734
|
-
|
|
5735
5786
|
declare type InteractionGetParams = InteractionGetParamsNonStreaming | InteractionGetParamsStreaming;
|
|
5736
5787
|
|
|
5737
5788
|
declare namespace InteractionGetParams {
|
|
@@ -5744,6 +5795,10 @@ declare interface InteractionGetParamsBase {
|
|
|
5744
5795
|
* Path param: Which version of the API to use.
|
|
5745
5796
|
*/
|
|
5746
5797
|
api_version?: string;
|
|
5798
|
+
/**
|
|
5799
|
+
* Query param: If set to true, includes the input in the response.
|
|
5800
|
+
*/
|
|
5801
|
+
include_input?: boolean;
|
|
5747
5802
|
/**
|
|
5748
5803
|
* Query param: Optional. If set, resumes the interaction stream from the next chunk after the event marked by the event id. Can only be used if `stream` is true.
|
|
5749
5804
|
*/
|
|
@@ -5772,7 +5827,7 @@ export declare class Interactions extends BaseInteractions {
|
|
|
5772
5827
|
}
|
|
5773
5828
|
|
|
5774
5829
|
export declare namespace Interactions {
|
|
5775
|
-
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 FileSearchCallContent as FileSearchCallContent, 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 ImageConfig_2 as ImageConfig, type ImageContent as ImageContent, type ImageMimeType as ImageMimeType, type Interaction as Interaction, type
|
|
5830
|
+
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 FileSearchCallContent as FileSearchCallContent, 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 ImageConfig_2 as ImageConfig, type ImageContent as ImageContent, type ImageMimeType as ImageMimeType, type Interaction as Interaction, type InteractionCompleteEvent as InteractionCompleteEvent, type InteractionSSEEvent as InteractionSSEEvent, type InteractionStartEvent as InteractionStartEvent, 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, };
|
|
5776
5831
|
}
|
|
5777
5832
|
|
|
5778
5833
|
declare namespace InteractionsAPI {
|
|
@@ -5809,8 +5864,9 @@ declare namespace InteractionsAPI {
|
|
|
5809
5864
|
ImageContent,
|
|
5810
5865
|
ImageMimeType,
|
|
5811
5866
|
Interaction,
|
|
5812
|
-
|
|
5867
|
+
InteractionCompleteEvent,
|
|
5813
5868
|
InteractionSSEEvent,
|
|
5869
|
+
InteractionStartEvent,
|
|
5814
5870
|
InteractionStatusUpdate,
|
|
5815
5871
|
MCPServerToolCallContent,
|
|
5816
5872
|
MCPServerToolResultContent,
|
|
@@ -5848,7 +5904,19 @@ declare namespace InteractionsAPI {
|
|
|
5848
5904
|
}
|
|
5849
5905
|
}
|
|
5850
5906
|
|
|
5851
|
-
declare type InteractionSSEEvent =
|
|
5907
|
+
declare type InteractionSSEEvent = InteractionStartEvent | InteractionCompleteEvent | InteractionStatusUpdate | ContentStart | ContentDelta | ContentStop | ErrorEvent_2;
|
|
5908
|
+
|
|
5909
|
+
declare interface InteractionStartEvent {
|
|
5910
|
+
/**
|
|
5911
|
+
* The event_id token to be used to resume the interaction stream, from this event.
|
|
5912
|
+
*/
|
|
5913
|
+
event_id?: string;
|
|
5914
|
+
event_type?: 'interaction.start';
|
|
5915
|
+
/**
|
|
5916
|
+
* The Interaction resource.
|
|
5917
|
+
*/
|
|
5918
|
+
interaction?: Interaction;
|
|
5919
|
+
}
|
|
5852
5920
|
|
|
5853
5921
|
declare interface InteractionStatusUpdate {
|
|
5854
5922
|
/**
|
|
@@ -5860,6 +5928,14 @@ declare interface InteractionStatusUpdate {
|
|
|
5860
5928
|
status?: 'in_progress' | 'requires_action' | 'completed' | 'failed' | 'cancelled';
|
|
5861
5929
|
}
|
|
5862
5930
|
|
|
5931
|
+
/** Parameters for the private _Register method. */
|
|
5932
|
+
export declare interface InternalRegisterFilesParameters {
|
|
5933
|
+
/** The Google Cloud Storage URIs to register. Example: `gs://bucket/object`. */
|
|
5934
|
+
uris: string[];
|
|
5935
|
+
/** Used to override the default configuration. */
|
|
5936
|
+
config?: RegisterFilesConfig;
|
|
5937
|
+
}
|
|
5938
|
+
|
|
5863
5939
|
declare class InternalServerError extends APIError<number, Headers> {
|
|
5864
5940
|
}
|
|
5865
5941
|
|
|
@@ -7229,6 +7305,14 @@ export declare interface Model {
|
|
|
7229
7305
|
*/
|
|
7230
7306
|
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 & {});
|
|
7231
7307
|
|
|
7308
|
+
/** Configuration for Model Armor integrations of prompt and responses. This data type is not supported in Gemini API. */
|
|
7309
|
+
export declare interface ModelArmorConfig {
|
|
7310
|
+
/** Optional. The name of the Model Armor template to use for prompt sanitization. */
|
|
7311
|
+
promptTemplateName?: string;
|
|
7312
|
+
/** Optional. The name of the Model Armor template to use for response sanitization. */
|
|
7313
|
+
responseTemplateName?: string;
|
|
7314
|
+
}
|
|
7315
|
+
|
|
7232
7316
|
export declare class Models extends BaseModule {
|
|
7233
7317
|
private readonly apiClient;
|
|
7234
7318
|
constructor(apiClient: ApiClient);
|
|
@@ -8310,6 +8394,41 @@ declare interface ReferenceImageAPIInternal {
|
|
|
8310
8394
|
subjectImageConfig?: types.SubjectReferenceConfig;
|
|
8311
8395
|
}
|
|
8312
8396
|
|
|
8397
|
+
/** Used to override the default configuration. */
|
|
8398
|
+
export declare interface RegisterFilesConfig {
|
|
8399
|
+
/** Used to override HTTP request options. */
|
|
8400
|
+
httpOptions?: HttpOptions;
|
|
8401
|
+
/** Abort signal which can be used to cancel the request.
|
|
8402
|
+
|
|
8403
|
+
NOTE: AbortSignal is a client-only operation. Using it to cancel an
|
|
8404
|
+
operation will not cancel the request in the service. You will still
|
|
8405
|
+
be charged usage for any applicable operations.
|
|
8406
|
+
*/
|
|
8407
|
+
abortSignal?: AbortSignal;
|
|
8408
|
+
}
|
|
8409
|
+
|
|
8410
|
+
/** Generates the parameters for the private registerFiles method. */
|
|
8411
|
+
export declare interface RegisterFilesParameters {
|
|
8412
|
+
/**
|
|
8413
|
+
* The authentication object.
|
|
8414
|
+
*/
|
|
8415
|
+
auth?: any;
|
|
8416
|
+
/**
|
|
8417
|
+
* The Google Cloud Storage URIs to register. Example: `gs://bucket/object`.
|
|
8418
|
+
*/
|
|
8419
|
+
uris: string[];
|
|
8420
|
+
/** Used to override the default configuration. */
|
|
8421
|
+
config?: RegisterFilesConfig;
|
|
8422
|
+
}
|
|
8423
|
+
|
|
8424
|
+
/** Response for the _register file method. */
|
|
8425
|
+
export declare class RegisterFilesResponse {
|
|
8426
|
+
/** Used to retain the full HTTP response. */
|
|
8427
|
+
sdkHttpResponse?: HttpResponse;
|
|
8428
|
+
/** The registered files. */
|
|
8429
|
+
files?: File_2[];
|
|
8430
|
+
}
|
|
8431
|
+
|
|
8313
8432
|
/** Represents a recorded session. */
|
|
8314
8433
|
export declare interface ReplayFile {
|
|
8315
8434
|
replayId?: string;
|
|
@@ -8425,6 +8544,18 @@ declare type RequestOptions = {
|
|
|
8425
8544
|
__streamClass?: typeof Stream;
|
|
8426
8545
|
};
|
|
8427
8546
|
|
|
8547
|
+
/** Resource scope. */
|
|
8548
|
+
export declare enum ResourceScope {
|
|
8549
|
+
/**
|
|
8550
|
+
* When setting base_url, this value configures resource scope to be the collection.
|
|
8551
|
+
The resource name will not include api version, project, or location.
|
|
8552
|
+
For example, if base_url is set to "https://aiplatform.googleapis.com",
|
|
8553
|
+
then the resource name for a Model would be
|
|
8554
|
+
"https://aiplatform.googleapis.com/publishers/google/models/gemini-3-pro-preview
|
|
8555
|
+
*/
|
|
8556
|
+
COLLECTION = "COLLECTION"
|
|
8557
|
+
}
|
|
8558
|
+
|
|
8428
8559
|
/** Defines a retrieval tool that model can call to access external knowledge. This data type is not supported in Gemini API. */
|
|
8429
8560
|
export declare interface Retrieval {
|
|
8430
8561
|
/** Optional. Deprecated. This option is no longer supported. */
|
|
@@ -9605,6 +9736,8 @@ export declare interface TuningJob {
|
|
|
9605
9736
|
supervisedTuningSpec?: SupervisedTuningSpec;
|
|
9606
9737
|
/** Tuning Spec for Preference Optimization. */
|
|
9607
9738
|
preferenceOptimizationSpec?: PreferenceOptimizationSpec;
|
|
9739
|
+
/** Tuning Spec for Distillation. */
|
|
9740
|
+
distillationSpec?: DistillationSpec;
|
|
9608
9741
|
/** Output only. The tuning data statistics associated with this TuningJob. */
|
|
9609
9742
|
tuningDataStats?: TuningDataStats;
|
|
9610
9743
|
/** Customer-managed encryption key options for a TuningJob. If this is set, then all resources created by the TuningJob will be encrypted with the provided encryption key. */
|
|
@@ -9638,7 +9771,11 @@ export declare enum TuningMethod {
|
|
|
9638
9771
|
/**
|
|
9639
9772
|
* Preference optimization tuning.
|
|
9640
9773
|
*/
|
|
9641
|
-
PREFERENCE_TUNING = "PREFERENCE_TUNING"
|
|
9774
|
+
PREFERENCE_TUNING = "PREFERENCE_TUNING",
|
|
9775
|
+
/**
|
|
9776
|
+
* Distillation tuning.
|
|
9777
|
+
*/
|
|
9778
|
+
DISTILLATION = "DISTILLATION"
|
|
9642
9779
|
}
|
|
9643
9780
|
|
|
9644
9781
|
/** Tuning mode. This enum is not supported in Gemini API. */
|
|
@@ -9879,6 +10016,7 @@ declare namespace types {
|
|
|
9879
10016
|
JobState,
|
|
9880
10017
|
TuningTask,
|
|
9881
10018
|
PartMediaResolutionLevel,
|
|
10019
|
+
ResourceScope,
|
|
9882
10020
|
FeatureSelectionPreference,
|
|
9883
10021
|
Environment,
|
|
9884
10022
|
SafetyFilterLevel,
|
|
@@ -9975,6 +10113,7 @@ declare namespace types {
|
|
|
9975
10113
|
GenerationConfigRoutingConfigManualRoutingMode,
|
|
9976
10114
|
GenerationConfigRoutingConfig,
|
|
9977
10115
|
SafetySetting,
|
|
10116
|
+
ModelArmorConfig,
|
|
9978
10117
|
GenerateContentConfig,
|
|
9979
10118
|
GenerateContentParameters,
|
|
9980
10119
|
HttpResponse,
|
|
@@ -10081,6 +10220,8 @@ declare namespace types {
|
|
|
10081
10220
|
SupervisedTuningSpec,
|
|
10082
10221
|
PreferenceOptimizationHyperParameters,
|
|
10083
10222
|
PreferenceOptimizationSpec,
|
|
10223
|
+
DistillationHyperParameters,
|
|
10224
|
+
DistillationSpec,
|
|
10084
10225
|
GoogleRpcStatus,
|
|
10085
10226
|
PreTunedModel,
|
|
10086
10227
|
DatasetDistributionDistributionBucket,
|
|
@@ -10167,6 +10308,9 @@ declare namespace types {
|
|
|
10167
10308
|
DeleteFileConfig,
|
|
10168
10309
|
DeleteFileParameters,
|
|
10169
10310
|
DeleteFileResponse,
|
|
10311
|
+
RegisterFilesConfig,
|
|
10312
|
+
InternalRegisterFilesParameters,
|
|
10313
|
+
RegisterFilesResponse,
|
|
10170
10314
|
InlinedRequest,
|
|
10171
10315
|
BatchJobSource,
|
|
10172
10316
|
JobError,
|
|
@@ -10226,6 +10370,7 @@ declare namespace types {
|
|
|
10226
10370
|
LiveServerMessage,
|
|
10227
10371
|
OperationFromAPIResponseParameters,
|
|
10228
10372
|
GenerationConfigThinkingConfig,
|
|
10373
|
+
RegisterFilesParameters,
|
|
10229
10374
|
AutomaticActivityDetection,
|
|
10230
10375
|
RealtimeInputConfig,
|
|
10231
10376
|
SessionResumptionConfig,
|
package/dist/tokenizer/node.cjs
CHANGED
|
@@ -773,6 +773,18 @@ var PartMediaResolutionLevel;
|
|
|
773
773
|
*/
|
|
774
774
|
PartMediaResolutionLevel["MEDIA_RESOLUTION_ULTRA_HIGH"] = "MEDIA_RESOLUTION_ULTRA_HIGH";
|
|
775
775
|
})(PartMediaResolutionLevel || (PartMediaResolutionLevel = {}));
|
|
776
|
+
/** Resource scope. */
|
|
777
|
+
var ResourceScope;
|
|
778
|
+
(function (ResourceScope) {
|
|
779
|
+
/**
|
|
780
|
+
* When setting base_url, this value configures resource scope to be the collection.
|
|
781
|
+
The resource name will not include api version, project, or location.
|
|
782
|
+
For example, if base_url is set to "https://aiplatform.googleapis.com",
|
|
783
|
+
then the resource name for a Model would be
|
|
784
|
+
"https://aiplatform.googleapis.com/publishers/google/models/gemini-3-pro-preview
|
|
785
|
+
*/
|
|
786
|
+
ResourceScope["COLLECTION"] = "COLLECTION";
|
|
787
|
+
})(ResourceScope || (ResourceScope = {}));
|
|
776
788
|
/** Options for feature selection preference. */
|
|
777
789
|
var FeatureSelectionPreference;
|
|
778
790
|
(function (FeatureSelectionPreference) {
|
|
@@ -966,6 +978,10 @@ var TuningMethod;
|
|
|
966
978
|
* Preference optimization tuning.
|
|
967
979
|
*/
|
|
968
980
|
TuningMethod["PREFERENCE_TUNING"] = "PREFERENCE_TUNING";
|
|
981
|
+
/**
|
|
982
|
+
* Distillation tuning.
|
|
983
|
+
*/
|
|
984
|
+
TuningMethod["DISTILLATION"] = "DISTILLATION";
|
|
969
985
|
})(TuningMethod || (TuningMethod = {}));
|
|
970
986
|
/** State for the lifecycle of a Document. */
|
|
971
987
|
var DocumentState;
|
package/dist/tokenizer/node.d.ts
CHANGED
|
@@ -553,6 +553,8 @@ declare enum HttpElementLocation {
|
|
|
553
553
|
declare interface HttpOptions {
|
|
554
554
|
/** The base URL for the AI platform service endpoint. */
|
|
555
555
|
baseUrl?: string;
|
|
556
|
+
/** The resource scope used to constructing the resource name when base_url is set */
|
|
557
|
+
baseUrlResourceScope?: ResourceScope;
|
|
556
558
|
/** Specifies the version of the API to use. */
|
|
557
559
|
apiVersion?: string;
|
|
558
560
|
/** Additional HTTP headers to be sent with the request. */
|
|
@@ -881,6 +883,18 @@ declare interface ReplicatedVoiceConfig {
|
|
|
881
883
|
voiceSampleAudio?: string;
|
|
882
884
|
}
|
|
883
885
|
|
|
886
|
+
/** Resource scope. */
|
|
887
|
+
declare enum ResourceScope {
|
|
888
|
+
/**
|
|
889
|
+
* When setting base_url, this value configures resource scope to be the collection.
|
|
890
|
+
The resource name will not include api version, project, or location.
|
|
891
|
+
For example, if base_url is set to "https://aiplatform.googleapis.com",
|
|
892
|
+
then the resource name for a Model would be
|
|
893
|
+
"https://aiplatform.googleapis.com/publishers/google/models/gemini-3-pro-preview
|
|
894
|
+
*/
|
|
895
|
+
COLLECTION = "COLLECTION"
|
|
896
|
+
}
|
|
897
|
+
|
|
884
898
|
/** Defines a retrieval tool that model can call to access external knowledge. This data type is not supported in Gemini API. */
|
|
885
899
|
declare interface Retrieval {
|
|
886
900
|
/** Optional. Deprecated. This option is no longer supported. */
|
package/dist/tokenizer/node.mjs
CHANGED
|
@@ -749,6 +749,18 @@ var PartMediaResolutionLevel;
|
|
|
749
749
|
*/
|
|
750
750
|
PartMediaResolutionLevel["MEDIA_RESOLUTION_ULTRA_HIGH"] = "MEDIA_RESOLUTION_ULTRA_HIGH";
|
|
751
751
|
})(PartMediaResolutionLevel || (PartMediaResolutionLevel = {}));
|
|
752
|
+
/** Resource scope. */
|
|
753
|
+
var ResourceScope;
|
|
754
|
+
(function (ResourceScope) {
|
|
755
|
+
/**
|
|
756
|
+
* When setting base_url, this value configures resource scope to be the collection.
|
|
757
|
+
The resource name will not include api version, project, or location.
|
|
758
|
+
For example, if base_url is set to "https://aiplatform.googleapis.com",
|
|
759
|
+
then the resource name for a Model would be
|
|
760
|
+
"https://aiplatform.googleapis.com/publishers/google/models/gemini-3-pro-preview
|
|
761
|
+
*/
|
|
762
|
+
ResourceScope["COLLECTION"] = "COLLECTION";
|
|
763
|
+
})(ResourceScope || (ResourceScope = {}));
|
|
752
764
|
/** Options for feature selection preference. */
|
|
753
765
|
var FeatureSelectionPreference;
|
|
754
766
|
(function (FeatureSelectionPreference) {
|
|
@@ -942,6 +954,10 @@ var TuningMethod;
|
|
|
942
954
|
* Preference optimization tuning.
|
|
943
955
|
*/
|
|
944
956
|
TuningMethod["PREFERENCE_TUNING"] = "PREFERENCE_TUNING";
|
|
957
|
+
/**
|
|
958
|
+
* Distillation tuning.
|
|
959
|
+
*/
|
|
960
|
+
TuningMethod["DISTILLATION"] = "DISTILLATION";
|
|
945
961
|
})(TuningMethod || (TuningMethod = {}));
|
|
946
962
|
/** State for the lifecycle of a Document. */
|
|
947
963
|
var DocumentState;
|