@google/genai 0.9.0 → 0.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +30 -5
- package/dist/genai.d.ts +803 -41
- package/dist/index.js +1664 -1039
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1662 -1040
- package/dist/index.mjs.map +1 -1
- package/dist/node/index.js +1792 -1128
- package/dist/node/index.js.map +1 -1
- package/dist/node/node.d.ts +803 -41
- package/dist/web/index.mjs +1786 -1123
- package/dist/web/index.mjs.map +1 -1
- package/dist/web/web.d.ts +803 -41
- package/package.json +1 -1
package/dist/web/web.d.ts
CHANGED
|
@@ -23,6 +23,17 @@ export declare enum ActivityHandling {
|
|
|
23
23
|
export declare interface ActivityStart {
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
+
/** Optional. Adapter size for tuning. */
|
|
27
|
+
export declare enum AdapterSize {
|
|
28
|
+
ADAPTER_SIZE_UNSPECIFIED = "ADAPTER_SIZE_UNSPECIFIED",
|
|
29
|
+
ADAPTER_SIZE_ONE = "ADAPTER_SIZE_ONE",
|
|
30
|
+
ADAPTER_SIZE_TWO = "ADAPTER_SIZE_TWO",
|
|
31
|
+
ADAPTER_SIZE_FOUR = "ADAPTER_SIZE_FOUR",
|
|
32
|
+
ADAPTER_SIZE_EIGHT = "ADAPTER_SIZE_EIGHT",
|
|
33
|
+
ADAPTER_SIZE_SIXTEEN = "ADAPTER_SIZE_SIXTEEN",
|
|
34
|
+
ADAPTER_SIZE_THIRTY_TWO = "ADAPTER_SIZE_THIRTY_TWO"
|
|
35
|
+
}
|
|
36
|
+
|
|
26
37
|
/**
|
|
27
38
|
* The ApiClient class is used to send requests to the Gemini API or Vertex AI
|
|
28
39
|
* endpoints.
|
|
@@ -164,6 +175,14 @@ export declare interface AutomaticActivityDetection {
|
|
|
164
175
|
declare class BaseModule {
|
|
165
176
|
}
|
|
166
177
|
|
|
178
|
+
/**
|
|
179
|
+
* Parameters for setting the base URLs for the Gemini API and Vertex AI API.
|
|
180
|
+
*/
|
|
181
|
+
export declare interface BaseUrlParameters {
|
|
182
|
+
geminiUrl?: string;
|
|
183
|
+
vertexUrl?: string;
|
|
184
|
+
}
|
|
185
|
+
|
|
167
186
|
/** Content blob. */
|
|
168
187
|
declare interface Blob_2 {
|
|
169
188
|
/** Required. Raw bytes. */
|
|
@@ -173,6 +192,8 @@ declare interface Blob_2 {
|
|
|
173
192
|
}
|
|
174
193
|
export { Blob_2 as Blob }
|
|
175
194
|
|
|
195
|
+
export declare type BlobImageUnion = Blob_2;
|
|
196
|
+
|
|
176
197
|
/** Output only. Blocked reason. */
|
|
177
198
|
export declare enum BlockedReason {
|
|
178
199
|
BLOCKED_REASON_UNSPECIFIED = "BLOCKED_REASON_UNSPECIFIED",
|
|
@@ -248,7 +269,7 @@ export declare class Caches extends BaseModule {
|
|
|
248
269
|
* ```ts
|
|
249
270
|
* const contents = ...; // Initialize the content to cache.
|
|
250
271
|
* const response = await ai.caches.create({
|
|
251
|
-
* model: 'gemini-
|
|
272
|
+
* model: 'gemini-2.0-flash-001',
|
|
252
273
|
* config: {
|
|
253
274
|
* 'contents': contents,
|
|
254
275
|
* 'displayName': 'test cache',
|
|
@@ -267,7 +288,7 @@ export declare class Caches extends BaseModule {
|
|
|
267
288
|
*
|
|
268
289
|
* @example
|
|
269
290
|
* ```ts
|
|
270
|
-
* await ai.caches.get({name: '
|
|
291
|
+
* await ai.caches.get({name: '...'}); // The server-generated resource name.
|
|
271
292
|
* ```
|
|
272
293
|
*/
|
|
273
294
|
get(params: types.GetCachedContentParameters): Promise<types.CachedContent>;
|
|
@@ -279,7 +300,7 @@ export declare class Caches extends BaseModule {
|
|
|
279
300
|
*
|
|
280
301
|
* @example
|
|
281
302
|
* ```ts
|
|
282
|
-
* await ai.caches.delete({name: '
|
|
303
|
+
* await ai.caches.delete({name: '...'}); // The server-generated resource name.
|
|
283
304
|
* ```
|
|
284
305
|
*/
|
|
285
306
|
delete(params: types.DeleteCachedContentParameters): Promise<types.DeleteCachedContentResponse>;
|
|
@@ -292,7 +313,7 @@ export declare class Caches extends BaseModule {
|
|
|
292
313
|
* @example
|
|
293
314
|
* ```ts
|
|
294
315
|
* const response = await ai.caches.update({
|
|
295
|
-
* name: '
|
|
316
|
+
* name: '...', // The server-generated resource name.
|
|
296
317
|
* config: {'ttl': '7600s'}
|
|
297
318
|
* });
|
|
298
319
|
* ```
|
|
@@ -487,6 +508,13 @@ export declare interface CodeExecutionResult {
|
|
|
487
508
|
export declare interface ComputeTokensConfig {
|
|
488
509
|
/** Used to override HTTP request options. */
|
|
489
510
|
httpOptions?: HttpOptions;
|
|
511
|
+
/** Abort signal which can be used to cancel the request.
|
|
512
|
+
|
|
513
|
+
NOTE: AbortSignal is a client-only operation. Using it to cancel an
|
|
514
|
+
operation will not cancel the request in the service. You will still
|
|
515
|
+
be charged usage for any applicable operations.
|
|
516
|
+
*/
|
|
517
|
+
abortSignal?: AbortSignal;
|
|
490
518
|
}
|
|
491
519
|
|
|
492
520
|
/** Parameters for computing tokens. */
|
|
@@ -595,6 +623,13 @@ export declare enum ControlReferenceType {
|
|
|
595
623
|
export declare interface CountTokensConfig {
|
|
596
624
|
/** Used to override HTTP request options. */
|
|
597
625
|
httpOptions?: HttpOptions;
|
|
626
|
+
/** Abort signal which can be used to cancel the request.
|
|
627
|
+
|
|
628
|
+
NOTE: AbortSignal is a client-only operation. Using it to cancel an
|
|
629
|
+
operation will not cancel the request in the service. You will still
|
|
630
|
+
be charged usage for any applicable operations.
|
|
631
|
+
*/
|
|
632
|
+
abortSignal?: AbortSignal;
|
|
598
633
|
/** Instructions for the model to steer it toward better performance.
|
|
599
634
|
*/
|
|
600
635
|
systemInstruction?: ContentUnion;
|
|
@@ -631,6 +666,13 @@ export declare class CountTokensResponse {
|
|
|
631
666
|
export declare interface CreateCachedContentConfig {
|
|
632
667
|
/** Used to override HTTP request options. */
|
|
633
668
|
httpOptions?: HttpOptions;
|
|
669
|
+
/** Abort signal which can be used to cancel the request.
|
|
670
|
+
|
|
671
|
+
NOTE: AbortSignal is a client-only operation. Using it to cancel an
|
|
672
|
+
operation will not cancel the request in the service. You will still
|
|
673
|
+
be charged usage for any applicable operations.
|
|
674
|
+
*/
|
|
675
|
+
abortSignal?: AbortSignal;
|
|
634
676
|
/** 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". */
|
|
635
677
|
ttl?: string;
|
|
636
678
|
/** Timestamp of when this resource is considered expired. Uses RFC 3339 format, Example: 2014-10-02T15:01:23Z. */
|
|
@@ -654,7 +696,7 @@ export declare interface CreateCachedContentConfig {
|
|
|
654
696
|
|
|
655
697
|
/** Parameters for caches.create method. */
|
|
656
698
|
export declare interface CreateCachedContentParameters {
|
|
657
|
-
/** ID of the model to use. Example: gemini-
|
|
699
|
+
/** ID of the model to use. Example: gemini-2.0-flash */
|
|
658
700
|
model: string;
|
|
659
701
|
/** Configuration that contains optional parameters.
|
|
660
702
|
*/
|
|
@@ -669,7 +711,7 @@ export declare interface CreateCachedContentParameters {
|
|
|
669
711
|
export declare interface CreateChatParameters {
|
|
670
712
|
/** The name of the model to use for the chat session.
|
|
671
713
|
|
|
672
|
-
For example: 'gemini-2.0-flash', 'gemini-
|
|
714
|
+
For example: 'gemini-2.0-flash', 'gemini-2.0-flash-lite', etc. See Gemini API
|
|
673
715
|
docs to find the available models.
|
|
674
716
|
*/
|
|
675
717
|
model: string;
|
|
@@ -692,6 +734,13 @@ export declare interface CreateChatParameters {
|
|
|
692
734
|
export declare interface CreateFileConfig {
|
|
693
735
|
/** Used to override HTTP request options. */
|
|
694
736
|
httpOptions?: HttpOptions;
|
|
737
|
+
/** Abort signal which can be used to cancel the request.
|
|
738
|
+
|
|
739
|
+
NOTE: AbortSignal is a client-only operation. Using it to cancel an
|
|
740
|
+
operation will not cancel the request in the service. You will still
|
|
741
|
+
be charged usage for any applicable operations.
|
|
742
|
+
*/
|
|
743
|
+
abortSignal?: AbortSignal;
|
|
695
744
|
}
|
|
696
745
|
|
|
697
746
|
/** Generates the parameters for the private _create method. */
|
|
@@ -753,15 +802,111 @@ export declare function createPartFromText(text: string): Part;
|
|
|
753
802
|
*/
|
|
754
803
|
export declare function createPartFromUri(uri: string, mimeType: string): Part;
|
|
755
804
|
|
|
805
|
+
/** Supervised fine-tuning job creation request - optional fields. */
|
|
806
|
+
export declare interface CreateTuningJobConfig {
|
|
807
|
+
/** Used to override HTTP request options. */
|
|
808
|
+
httpOptions?: HttpOptions;
|
|
809
|
+
/** Abort signal which can be used to cancel the request.
|
|
810
|
+
|
|
811
|
+
NOTE: AbortSignal is a client-only operation. Using it to cancel an
|
|
812
|
+
operation will not cancel the request in the service. You will still
|
|
813
|
+
be charged usage for any applicable operations.
|
|
814
|
+
*/
|
|
815
|
+
abortSignal?: AbortSignal;
|
|
816
|
+
/** Cloud Storage path to file containing training dataset for tuning. The dataset must be formatted as a JSONL file. */
|
|
817
|
+
validationDataset?: TuningValidationDataset;
|
|
818
|
+
/** The display name of the tuned Model. The name can be up to 128 characters long and can consist of any UTF-8 characters. */
|
|
819
|
+
tunedModelDisplayName?: string;
|
|
820
|
+
/** The description of the TuningJob */
|
|
821
|
+
description?: string;
|
|
822
|
+
/** Number of complete passes the model makes over the entire training dataset during training. */
|
|
823
|
+
epochCount?: number;
|
|
824
|
+
/** Multiplier for adjusting the default learning rate. */
|
|
825
|
+
learningRateMultiplier?: number;
|
|
826
|
+
/** Adapter size for tuning. */
|
|
827
|
+
adapterSize?: AdapterSize;
|
|
828
|
+
/** The batch size hyperparameter for tuning. If not set, a default of 4 or 16 will be used based on the number of training examples. */
|
|
829
|
+
batchSize?: number;
|
|
830
|
+
/** The learning rate hyperparameter for tuning. If not set, a default of 0.001 or 0.0002 will be calculated based on the number of training examples. */
|
|
831
|
+
learningRate?: number;
|
|
832
|
+
}
|
|
833
|
+
|
|
834
|
+
/** Supervised fine-tuning job creation parameters - optional fields. */
|
|
835
|
+
export declare interface CreateTuningJobParameters {
|
|
836
|
+
/** The base model that is being tuned, e.g., "gemini-1.0-pro-002". */
|
|
837
|
+
baseModel: string;
|
|
838
|
+
/** Cloud Storage path to file containing training dataset for tuning. The dataset must be formatted as a JSONL file. */
|
|
839
|
+
trainingDataset: TuningDataset;
|
|
840
|
+
/** Configuration for the tuning job. */
|
|
841
|
+
config?: CreateTuningJobConfig;
|
|
842
|
+
}
|
|
843
|
+
|
|
756
844
|
/**
|
|
757
845
|
* Creates a `Content` object with a user role from a `PartListUnion` object or `string`.
|
|
758
846
|
*/
|
|
759
847
|
export declare function createUserContent(partOrString: PartListUnion | string): Content;
|
|
760
848
|
|
|
849
|
+
/** Distribution computed over a tuning dataset. */
|
|
850
|
+
export declare interface DatasetDistribution {
|
|
851
|
+
/** Output only. Defines the histogram bucket. */
|
|
852
|
+
buckets?: DatasetDistributionDistributionBucket[];
|
|
853
|
+
/** Output only. The maximum of the population values. */
|
|
854
|
+
max?: number;
|
|
855
|
+
/** Output only. The arithmetic mean of the values in the population. */
|
|
856
|
+
mean?: number;
|
|
857
|
+
/** Output only. The median of the values in the population. */
|
|
858
|
+
median?: number;
|
|
859
|
+
/** Output only. The minimum of the population values. */
|
|
860
|
+
min?: number;
|
|
861
|
+
/** Output only. The 5th percentile of the values in the population. */
|
|
862
|
+
p5?: number;
|
|
863
|
+
/** Output only. The 95th percentile of the values in the population. */
|
|
864
|
+
p95?: number;
|
|
865
|
+
/** Output only. Sum of a given population of values. */
|
|
866
|
+
sum?: number;
|
|
867
|
+
}
|
|
868
|
+
|
|
869
|
+
/** Dataset bucket used to create a histogram for the distribution given a population of values. */
|
|
870
|
+
export declare interface DatasetDistributionDistributionBucket {
|
|
871
|
+
/** Output only. Number of values in the bucket. */
|
|
872
|
+
count?: string;
|
|
873
|
+
/** Output only. Left bound of the bucket. */
|
|
874
|
+
left?: number;
|
|
875
|
+
/** Output only. Right bound of the bucket. */
|
|
876
|
+
right?: number;
|
|
877
|
+
}
|
|
878
|
+
|
|
879
|
+
/** Statistics computed over a tuning dataset. */
|
|
880
|
+
export declare interface DatasetStats {
|
|
881
|
+
/** Output only. Number of billable characters in the tuning dataset. */
|
|
882
|
+
totalBillableCharacterCount?: string;
|
|
883
|
+
/** Output only. Number of tuning characters in the tuning dataset. */
|
|
884
|
+
totalTuningCharacterCount?: string;
|
|
885
|
+
/** Output only. Number of examples in the tuning dataset. */
|
|
886
|
+
tuningDatasetExampleCount?: string;
|
|
887
|
+
/** Output only. Number of tuning steps for this Tuning Job. */
|
|
888
|
+
tuningStepCount?: string;
|
|
889
|
+
/** Output only. Sample user messages in the training dataset uri. */
|
|
890
|
+
userDatasetExamples?: Content[];
|
|
891
|
+
/** Output only. Dataset distributions for the user input tokens. */
|
|
892
|
+
userInputTokenDistribution?: DatasetDistribution;
|
|
893
|
+
/** Output only. Dataset distributions for the messages per example. */
|
|
894
|
+
userMessagePerExampleDistribution?: DatasetDistribution;
|
|
895
|
+
/** Output only. Dataset distributions for the user output tokens. */
|
|
896
|
+
userOutputTokenDistribution?: DatasetDistribution;
|
|
897
|
+
}
|
|
898
|
+
|
|
761
899
|
/** Optional parameters for caches.delete method. */
|
|
762
900
|
export declare interface DeleteCachedContentConfig {
|
|
763
901
|
/** Used to override HTTP request options. */
|
|
764
902
|
httpOptions?: HttpOptions;
|
|
903
|
+
/** Abort signal which can be used to cancel the request.
|
|
904
|
+
|
|
905
|
+
NOTE: AbortSignal is a client-only operation. Using it to cancel an
|
|
906
|
+
operation will not cancel the request in the service. You will still
|
|
907
|
+
be charged usage for any applicable operations.
|
|
908
|
+
*/
|
|
909
|
+
abortSignal?: AbortSignal;
|
|
765
910
|
}
|
|
766
911
|
|
|
767
912
|
/** Parameters for caches.delete method. */
|
|
@@ -782,6 +927,13 @@ export declare class DeleteCachedContentResponse {
|
|
|
782
927
|
export declare interface DeleteFileConfig {
|
|
783
928
|
/** Used to override HTTP request options. */
|
|
784
929
|
httpOptions?: HttpOptions;
|
|
930
|
+
/** Abort signal which can be used to cancel the request.
|
|
931
|
+
|
|
932
|
+
NOTE: AbortSignal is a client-only operation. Using it to cancel an
|
|
933
|
+
operation will not cancel the request in the service. You will still
|
|
934
|
+
be charged usage for any applicable operations.
|
|
935
|
+
*/
|
|
936
|
+
abortSignal?: AbortSignal;
|
|
785
937
|
}
|
|
786
938
|
|
|
787
939
|
/** Generates the parameters for the get method. */
|
|
@@ -796,10 +948,74 @@ export declare interface DeleteFileParameters {
|
|
|
796
948
|
export declare class DeleteFileResponse {
|
|
797
949
|
}
|
|
798
950
|
|
|
951
|
+
/** Configuration for deleting a tuned model. */
|
|
952
|
+
export declare interface DeleteModelConfig {
|
|
953
|
+
/** Used to override HTTP request options. */
|
|
954
|
+
httpOptions?: HttpOptions;
|
|
955
|
+
/** Abort signal which can be used to cancel the request.
|
|
956
|
+
|
|
957
|
+
NOTE: AbortSignal is a client-only operation. Using it to cancel an
|
|
958
|
+
operation will not cancel the request in the service. You will still
|
|
959
|
+
be charged usage for any applicable operations.
|
|
960
|
+
*/
|
|
961
|
+
abortSignal?: AbortSignal;
|
|
962
|
+
}
|
|
963
|
+
|
|
964
|
+
/** Parameters for deleting a tuned model. */
|
|
965
|
+
export declare interface DeleteModelParameters {
|
|
966
|
+
model: string;
|
|
967
|
+
/** Optional parameters for the request. */
|
|
968
|
+
config?: DeleteModelConfig;
|
|
969
|
+
}
|
|
970
|
+
|
|
971
|
+
export declare class DeleteModelResponse {
|
|
972
|
+
}
|
|
973
|
+
|
|
974
|
+
/** Statistics computed for datasets used for distillation. */
|
|
975
|
+
export declare interface DistillationDataStats {
|
|
976
|
+
/** Output only. Statistics computed for the training dataset. */
|
|
977
|
+
trainingDatasetStats?: DatasetStats;
|
|
978
|
+
}
|
|
979
|
+
|
|
980
|
+
/** Hyperparameters for Distillation. */
|
|
981
|
+
export declare interface DistillationHyperParameters {
|
|
982
|
+
/** Optional. Adapter size for distillation. */
|
|
983
|
+
adapterSize?: AdapterSize;
|
|
984
|
+
/** Optional. Number of complete passes the model makes over the entire training dataset during training. */
|
|
985
|
+
epochCount?: string;
|
|
986
|
+
/** Optional. Multiplier for adjusting the default learning rate. */
|
|
987
|
+
learningRateMultiplier?: number;
|
|
988
|
+
}
|
|
989
|
+
|
|
990
|
+
/** Tuning Spec for Distillation. */
|
|
991
|
+
export declare interface DistillationSpec {
|
|
992
|
+
/** The base teacher model that is being distilled, e.g., "gemini-1.0-pro-002". */
|
|
993
|
+
baseTeacherModel?: string;
|
|
994
|
+
/** Optional. Hyperparameters for Distillation. */
|
|
995
|
+
hyperParameters?: DistillationHyperParameters;
|
|
996
|
+
/** Required. 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. */
|
|
997
|
+
pipelineRootDirectory?: string;
|
|
998
|
+
/** The student model that is being tuned, e.g., "google/gemma-2b-1.1-it". */
|
|
999
|
+
studentModel?: string;
|
|
1000
|
+
/** Required. Cloud Storage path to file containing training dataset for tuning. The dataset must be formatted as a JSONL file. */
|
|
1001
|
+
trainingDatasetUri?: string;
|
|
1002
|
+
/** The resource name of the Tuned teacher model. Format: `projects/{project}/locations/{location}/models/{model}`. */
|
|
1003
|
+
tunedTeacherModelSource?: string;
|
|
1004
|
+
/** Optional. Cloud Storage path to file containing validation dataset for tuning. The dataset must be formatted as a JSONL file. */
|
|
1005
|
+
validationDatasetUri?: string;
|
|
1006
|
+
}
|
|
1007
|
+
|
|
799
1008
|
/** Used to override the default configuration. */
|
|
800
1009
|
export declare interface DownloadFileConfig {
|
|
801
1010
|
/** Used to override HTTP request options. */
|
|
802
1011
|
httpOptions?: HttpOptions;
|
|
1012
|
+
/** Abort signal which can be used to cancel the request.
|
|
1013
|
+
|
|
1014
|
+
NOTE: AbortSignal is a client-only operation. Using it to cancel an
|
|
1015
|
+
operation will not cancel the request in the service. You will still
|
|
1016
|
+
be charged usage for any applicable operations.
|
|
1017
|
+
*/
|
|
1018
|
+
abortSignal?: AbortSignal;
|
|
803
1019
|
}
|
|
804
1020
|
|
|
805
1021
|
/** Describes the options to customize dynamic retrieval. */
|
|
@@ -819,6 +1035,13 @@ export declare enum DynamicRetrievalConfigMode {
|
|
|
819
1035
|
export declare interface EmbedContentConfig {
|
|
820
1036
|
/** Used to override HTTP request options. */
|
|
821
1037
|
httpOptions?: HttpOptions;
|
|
1038
|
+
/** Abort signal which can be used to cancel the request.
|
|
1039
|
+
|
|
1040
|
+
NOTE: AbortSignal is a client-only operation. Using it to cancel an
|
|
1041
|
+
operation will not cancel the request in the service. You will still
|
|
1042
|
+
be charged usage for any applicable operations.
|
|
1043
|
+
*/
|
|
1044
|
+
abortSignal?: AbortSignal;
|
|
822
1045
|
/** Type of task for which the embedding will be used.
|
|
823
1046
|
*/
|
|
824
1047
|
taskType?: string;
|
|
@@ -874,6 +1097,12 @@ export declare class EmbedContentResponse {
|
|
|
874
1097
|
metadata?: EmbedContentMetadata;
|
|
875
1098
|
}
|
|
876
1099
|
|
|
1100
|
+
/** Represents a customer-managed encryption key spec that can be applied to a top-level resource. */
|
|
1101
|
+
export declare interface EncryptionSpec {
|
|
1102
|
+
/** Required. The Cloud KMS resource identifier of the customer managed encryption key used to protect a resource. Has the form: `projects/my-project/locations/my-region/keyRings/my-kr/cryptoKeys/my-key`. The key needs to be in the same region as where the compute resource is created. */
|
|
1103
|
+
kmsKeyName?: string;
|
|
1104
|
+
}
|
|
1105
|
+
|
|
877
1106
|
/** An endpoint where you deploy models. */
|
|
878
1107
|
export declare interface Endpoint {
|
|
879
1108
|
/** Resource name of the endpoint. */
|
|
@@ -908,6 +1137,13 @@ export declare enum FeatureSelectionPreference {
|
|
|
908
1137
|
export declare interface FetchPredictOperationConfig {
|
|
909
1138
|
/** Used to override HTTP request options. */
|
|
910
1139
|
httpOptions?: HttpOptions;
|
|
1140
|
+
/** Abort signal which can be used to cancel the request.
|
|
1141
|
+
|
|
1142
|
+
NOTE: AbortSignal is a client-only operation. Using it to cancel an
|
|
1143
|
+
operation will not cancel the request in the service. You will still
|
|
1144
|
+
be charged usage for any applicable operations.
|
|
1145
|
+
*/
|
|
1146
|
+
abortSignal?: AbortSignal;
|
|
911
1147
|
}
|
|
912
1148
|
|
|
913
1149
|
/** Parameters for the fetchPredictOperation method. */
|
|
@@ -1111,6 +1347,7 @@ export declare enum FinishReason {
|
|
|
1111
1347
|
MAX_TOKENS = "MAX_TOKENS",
|
|
1112
1348
|
SAFETY = "SAFETY",
|
|
1113
1349
|
RECITATION = "RECITATION",
|
|
1350
|
+
LANGUAGE = "LANGUAGE",
|
|
1114
1351
|
OTHER = "OTHER",
|
|
1115
1352
|
BLOCKLIST = "BLOCKLIST",
|
|
1116
1353
|
PROHIBITED_CONTENT = "PROHIBITED_CONTENT",
|
|
@@ -1146,21 +1383,16 @@ export declare enum FunctionCallingConfigMode {
|
|
|
1146
1383
|
NONE = "NONE"
|
|
1147
1384
|
}
|
|
1148
1385
|
|
|
1149
|
-
/**
|
|
1150
|
-
|
|
1151
|
-
The inputs are based on `OpenAPI 3.0 specifications
|
|
1152
|
-
<https://spec.openapis.org/oas/v3.0.3>`_.
|
|
1153
|
-
*/
|
|
1386
|
+
/** 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. */
|
|
1154
1387
|
export declare interface FunctionDeclaration {
|
|
1155
|
-
/** Describes the output from the function in the OpenAPI JSON Schema
|
|
1156
|
-
Object format. */
|
|
1157
|
-
response?: Schema;
|
|
1158
1388
|
/** Optional. Description and purpose of the function. Model uses it to decide how and whether to call the function. */
|
|
1159
1389
|
description?: string;
|
|
1160
1390
|
/** 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. */
|
|
1161
1391
|
name?: string;
|
|
1162
1392
|
/** 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 */
|
|
1163
1393
|
parameters?: Schema;
|
|
1394
|
+
/** 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. */
|
|
1395
|
+
response?: Schema;
|
|
1164
1396
|
}
|
|
1165
1397
|
|
|
1166
1398
|
/** A function response. */
|
|
@@ -1182,6 +1414,13 @@ export declare class FunctionResponse {
|
|
|
1182
1414
|
export declare interface GenerateContentConfig {
|
|
1183
1415
|
/** Used to override HTTP request options. */
|
|
1184
1416
|
httpOptions?: HttpOptions;
|
|
1417
|
+
/** Abort signal which can be used to cancel the request.
|
|
1418
|
+
|
|
1419
|
+
NOTE: AbortSignal is a client-only operation. Using it to cancel an
|
|
1420
|
+
operation will not cancel the request in the service. You will still
|
|
1421
|
+
be charged usage for any applicable operations.
|
|
1422
|
+
*/
|
|
1423
|
+
abortSignal?: AbortSignal;
|
|
1185
1424
|
/** Instructions for the model to steer it toward better performance.
|
|
1186
1425
|
For example, "Answer as concisely as possible" or "Don't use technical
|
|
1187
1426
|
terms in your response".
|
|
@@ -1339,6 +1578,17 @@ export declare class GenerateContentResponse {
|
|
|
1339
1578
|
* ```
|
|
1340
1579
|
*/
|
|
1341
1580
|
get text(): string | undefined;
|
|
1581
|
+
/**
|
|
1582
|
+
* Returns the concatenation of all inline data parts from the first candidate
|
|
1583
|
+
* in the response.
|
|
1584
|
+
*
|
|
1585
|
+
* @remarks
|
|
1586
|
+
* If there are multiple candidates in the response, the inline data from the
|
|
1587
|
+
* first one will be returned. If there are non-inline data parts in the
|
|
1588
|
+
* response, the concatenation of all inline data parts will be returned, and
|
|
1589
|
+
* a warning will be logged.
|
|
1590
|
+
*/
|
|
1591
|
+
get data(): string | undefined;
|
|
1342
1592
|
/**
|
|
1343
1593
|
* Returns the function calls from the first candidate in the response.
|
|
1344
1594
|
*
|
|
@@ -1499,6 +1749,13 @@ export declare interface GeneratedVideo {
|
|
|
1499
1749
|
export declare interface GenerateImagesConfig {
|
|
1500
1750
|
/** Used to override HTTP request options. */
|
|
1501
1751
|
httpOptions?: HttpOptions;
|
|
1752
|
+
/** Abort signal which can be used to cancel the request.
|
|
1753
|
+
|
|
1754
|
+
NOTE: AbortSignal is a client-only operation. Using it to cancel an
|
|
1755
|
+
operation will not cancel the request in the service. You will still
|
|
1756
|
+
be charged usage for any applicable operations.
|
|
1757
|
+
*/
|
|
1758
|
+
abortSignal?: AbortSignal;
|
|
1502
1759
|
/** Cloud Storage URI used to store the generated images.
|
|
1503
1760
|
*/
|
|
1504
1761
|
outputGcsUri?: string;
|
|
@@ -1580,6 +1837,13 @@ export declare class GenerateImagesResponse {
|
|
|
1580
1837
|
export declare interface GenerateVideosConfig {
|
|
1581
1838
|
/** Used to override HTTP request options. */
|
|
1582
1839
|
httpOptions?: HttpOptions;
|
|
1840
|
+
/** Abort signal which can be used to cancel the request.
|
|
1841
|
+
|
|
1842
|
+
NOTE: AbortSignal is a client-only operation. Using it to cancel an
|
|
1843
|
+
operation will not cancel the request in the service. You will still
|
|
1844
|
+
be charged usage for any applicable operations.
|
|
1845
|
+
*/
|
|
1846
|
+
abortSignal?: AbortSignal;
|
|
1583
1847
|
/** Number of output videos. */
|
|
1584
1848
|
numberOfVideos?: number;
|
|
1585
1849
|
/** The gcs bucket where to save the generated videos. */
|
|
@@ -1702,6 +1966,13 @@ export declare interface GenerationConfigRoutingConfigManualRoutingMode {
|
|
|
1702
1966
|
export declare interface GetCachedContentConfig {
|
|
1703
1967
|
/** Used to override HTTP request options. */
|
|
1704
1968
|
httpOptions?: HttpOptions;
|
|
1969
|
+
/** Abort signal which can be used to cancel the request.
|
|
1970
|
+
|
|
1971
|
+
NOTE: AbortSignal is a client-only operation. Using it to cancel an
|
|
1972
|
+
operation will not cancel the request in the service. You will still
|
|
1973
|
+
be charged usage for any applicable operations.
|
|
1974
|
+
*/
|
|
1975
|
+
abortSignal?: AbortSignal;
|
|
1705
1976
|
}
|
|
1706
1977
|
|
|
1707
1978
|
/** Parameters for caches.get method. */
|
|
@@ -1718,6 +1989,13 @@ export declare interface GetCachedContentParameters {
|
|
|
1718
1989
|
export declare interface GetFileConfig {
|
|
1719
1990
|
/** Used to override HTTP request options. */
|
|
1720
1991
|
httpOptions?: HttpOptions;
|
|
1992
|
+
/** Abort signal which can be used to cancel the request.
|
|
1993
|
+
|
|
1994
|
+
NOTE: AbortSignal is a client-only operation. Using it to cancel an
|
|
1995
|
+
operation will not cancel the request in the service. You will still
|
|
1996
|
+
be charged usage for any applicable operations.
|
|
1997
|
+
*/
|
|
1998
|
+
abortSignal?: AbortSignal;
|
|
1721
1999
|
}
|
|
1722
2000
|
|
|
1723
2001
|
/** Generates the parameters for the get method. */
|
|
@@ -1732,6 +2010,13 @@ export declare interface GetFileParameters {
|
|
|
1732
2010
|
export declare interface GetModelConfig {
|
|
1733
2011
|
/** Used to override HTTP request options. */
|
|
1734
2012
|
httpOptions?: HttpOptions;
|
|
2013
|
+
/** Abort signal which can be used to cancel the request.
|
|
2014
|
+
|
|
2015
|
+
NOTE: AbortSignal is a client-only operation. Using it to cancel an
|
|
2016
|
+
operation will not cancel the request in the service. You will still
|
|
2017
|
+
be charged usage for any applicable operations.
|
|
2018
|
+
*/
|
|
2019
|
+
abortSignal?: AbortSignal;
|
|
1735
2020
|
}
|
|
1736
2021
|
|
|
1737
2022
|
export declare interface GetModelParameters {
|
|
@@ -1743,6 +2028,13 @@ export declare interface GetModelParameters {
|
|
|
1743
2028
|
export declare interface GetOperationConfig {
|
|
1744
2029
|
/** Used to override HTTP request options. */
|
|
1745
2030
|
httpOptions?: HttpOptions;
|
|
2031
|
+
/** Abort signal which can be used to cancel the request.
|
|
2032
|
+
|
|
2033
|
+
NOTE: AbortSignal is a client-only operation. Using it to cancel an
|
|
2034
|
+
operation will not cancel the request in the service. You will still
|
|
2035
|
+
be charged usage for any applicable operations.
|
|
2036
|
+
*/
|
|
2037
|
+
abortSignal?: AbortSignal;
|
|
1746
2038
|
}
|
|
1747
2039
|
|
|
1748
2040
|
/** Parameters for the GET method. */
|
|
@@ -1753,6 +2045,26 @@ export declare interface GetOperationParameters {
|
|
|
1753
2045
|
config?: GetOperationConfig;
|
|
1754
2046
|
}
|
|
1755
2047
|
|
|
2048
|
+
/** Optional parameters for tunings.get method. */
|
|
2049
|
+
export declare interface GetTuningJobConfig {
|
|
2050
|
+
/** Used to override HTTP request options. */
|
|
2051
|
+
httpOptions?: HttpOptions;
|
|
2052
|
+
/** Abort signal which can be used to cancel the request.
|
|
2053
|
+
|
|
2054
|
+
NOTE: AbortSignal is a client-only operation. Using it to cancel an
|
|
2055
|
+
operation will not cancel the request in the service. You will still
|
|
2056
|
+
be charged usage for any applicable operations.
|
|
2057
|
+
*/
|
|
2058
|
+
abortSignal?: AbortSignal;
|
|
2059
|
+
}
|
|
2060
|
+
|
|
2061
|
+
/** Parameters for the get method. */
|
|
2062
|
+
export declare interface GetTuningJobParameters {
|
|
2063
|
+
name: string;
|
|
2064
|
+
/** Optional parameters for the request. */
|
|
2065
|
+
config?: GetTuningJobConfig;
|
|
2066
|
+
}
|
|
2067
|
+
|
|
1756
2068
|
/**
|
|
1757
2069
|
* The Google GenAI SDK.
|
|
1758
2070
|
*
|
|
@@ -1800,6 +2112,7 @@ export declare class GoogleGenAI {
|
|
|
1800
2112
|
readonly caches: Caches;
|
|
1801
2113
|
readonly files: Files;
|
|
1802
2114
|
readonly operations: Operations;
|
|
2115
|
+
readonly tunings: Tunings;
|
|
1803
2116
|
constructor(options: GoogleGenAIOptions);
|
|
1804
2117
|
}
|
|
1805
2118
|
|
|
@@ -1814,7 +2127,7 @@ export declare interface GoogleGenAIOptions {
|
|
|
1814
2127
|
*
|
|
1815
2128
|
* @remarks
|
|
1816
2129
|
* When true, the {@link https://cloud.google.com/vertex-ai/docs/reference/rest | Vertex AI API} will used.
|
|
1817
|
-
* When false, the {@link https://
|
|
2130
|
+
* When false, the {@link https://ai.google.dev/api | Gemini API} will be used.
|
|
1818
2131
|
*
|
|
1819
2132
|
* If unset, default SDK behavior is to use the Gemini API service.
|
|
1820
2133
|
*/
|
|
@@ -1822,12 +2135,14 @@ export declare interface GoogleGenAIOptions {
|
|
|
1822
2135
|
/**
|
|
1823
2136
|
* Optional. The Google Cloud project ID for Vertex AI clients.
|
|
1824
2137
|
*
|
|
2138
|
+
* Find your project ID: https://cloud.google.com/resource-manager/docs/creating-managing-projects#identifying_projects
|
|
2139
|
+
*
|
|
1825
2140
|
* @remarks
|
|
1826
2141
|
* Only supported on Node runtimes, ignored on browser runtimes.
|
|
1827
2142
|
*/
|
|
1828
2143
|
project?: string;
|
|
1829
2144
|
/**
|
|
1830
|
-
* Optional. The Google Cloud project
|
|
2145
|
+
* Optional. The Google Cloud project {@link https://cloud.google.com/vertex-ai/generative-ai/docs/learn/locations | location} for Vertex AI clients.
|
|
1831
2146
|
*
|
|
1832
2147
|
* @remarks
|
|
1833
2148
|
* Only supported on Node runtimes, ignored on browser runtimes.
|
|
@@ -1864,6 +2179,16 @@ export declare interface GoogleGenAIOptions {
|
|
|
1864
2179
|
httpOptions?: HttpOptions;
|
|
1865
2180
|
}
|
|
1866
2181
|
|
|
2182
|
+
/** 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). */
|
|
2183
|
+
export declare interface GoogleRpcStatus {
|
|
2184
|
+
/** The status code, which should be an enum value of google.rpc.Code. */
|
|
2185
|
+
code?: number;
|
|
2186
|
+
/** A list of messages that carry the error details. There is a common set of message types for APIs to use. */
|
|
2187
|
+
details?: Record<string, unknown>[];
|
|
2188
|
+
/** 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. */
|
|
2189
|
+
message?: string;
|
|
2190
|
+
}
|
|
2191
|
+
|
|
1867
2192
|
/** Tool to support Google Search in Model. Powered by Google. */
|
|
1868
2193
|
export declare interface GoogleSearch {
|
|
1869
2194
|
}
|
|
@@ -2038,6 +2363,10 @@ declare interface HttpRequest {
|
|
|
2038
2363
|
* Optional set of customizable configuration for HTTP requests.
|
|
2039
2364
|
*/
|
|
2040
2365
|
httpOptions?: HttpOptions;
|
|
2366
|
+
/**
|
|
2367
|
+
* Optional abort signal which can be used to cancel the request.
|
|
2368
|
+
*/
|
|
2369
|
+
abortSignal?: AbortSignal;
|
|
2041
2370
|
}
|
|
2042
2371
|
|
|
2043
2372
|
/** A wrapper class for the http response. */
|
|
@@ -2076,6 +2405,22 @@ export declare enum ImagePromptLanguage {
|
|
|
2076
2405
|
hi = "hi"
|
|
2077
2406
|
}
|
|
2078
2407
|
|
|
2408
|
+
/** Output only. The detailed state of the job. */
|
|
2409
|
+
export declare enum JobState {
|
|
2410
|
+
JOB_STATE_UNSPECIFIED = "JOB_STATE_UNSPECIFIED",
|
|
2411
|
+
JOB_STATE_QUEUED = "JOB_STATE_QUEUED",
|
|
2412
|
+
JOB_STATE_PENDING = "JOB_STATE_PENDING",
|
|
2413
|
+
JOB_STATE_RUNNING = "JOB_STATE_RUNNING",
|
|
2414
|
+
JOB_STATE_SUCCEEDED = "JOB_STATE_SUCCEEDED",
|
|
2415
|
+
JOB_STATE_FAILED = "JOB_STATE_FAILED",
|
|
2416
|
+
JOB_STATE_CANCELLING = "JOB_STATE_CANCELLING",
|
|
2417
|
+
JOB_STATE_CANCELLED = "JOB_STATE_CANCELLED",
|
|
2418
|
+
JOB_STATE_PAUSED = "JOB_STATE_PAUSED",
|
|
2419
|
+
JOB_STATE_EXPIRED = "JOB_STATE_EXPIRED",
|
|
2420
|
+
JOB_STATE_UPDATING = "JOB_STATE_UPDATING",
|
|
2421
|
+
JOB_STATE_PARTIALLY_SUCCEEDED = "JOB_STATE_PARTIALLY_SUCCEEDED"
|
|
2422
|
+
}
|
|
2423
|
+
|
|
2079
2424
|
/** Required. Programming language of the `code`. */
|
|
2080
2425
|
export declare enum Language {
|
|
2081
2426
|
LANGUAGE_UNSPECIFIED = "LANGUAGE_UNSPECIFIED",
|
|
@@ -2086,6 +2431,13 @@ export declare enum Language {
|
|
|
2086
2431
|
export declare interface ListCachedContentsConfig {
|
|
2087
2432
|
/** Used to override HTTP request options. */
|
|
2088
2433
|
httpOptions?: HttpOptions;
|
|
2434
|
+
/** Abort signal which can be used to cancel the request.
|
|
2435
|
+
|
|
2436
|
+
NOTE: AbortSignal is a client-only operation. Using it to cancel an
|
|
2437
|
+
operation will not cancel the request in the service. You will still
|
|
2438
|
+
be charged usage for any applicable operations.
|
|
2439
|
+
*/
|
|
2440
|
+
abortSignal?: AbortSignal;
|
|
2089
2441
|
pageSize?: number;
|
|
2090
2442
|
pageToken?: string;
|
|
2091
2443
|
}
|
|
@@ -2108,6 +2460,13 @@ export declare class ListCachedContentsResponse {
|
|
|
2108
2460
|
export declare interface ListFilesConfig {
|
|
2109
2461
|
/** Used to override HTTP request options. */
|
|
2110
2462
|
httpOptions?: HttpOptions;
|
|
2463
|
+
/** Abort signal which can be used to cancel the request.
|
|
2464
|
+
|
|
2465
|
+
NOTE: AbortSignal is a client-only operation. Using it to cancel an
|
|
2466
|
+
operation will not cancel the request in the service. You will still
|
|
2467
|
+
be charged usage for any applicable operations.
|
|
2468
|
+
*/
|
|
2469
|
+
abortSignal?: AbortSignal;
|
|
2111
2470
|
pageSize?: number;
|
|
2112
2471
|
pageToken?: string;
|
|
2113
2472
|
}
|
|
@@ -2126,6 +2485,35 @@ export declare class ListFilesResponse {
|
|
|
2126
2485
|
files?: File_2[];
|
|
2127
2486
|
}
|
|
2128
2487
|
|
|
2488
|
+
/** Configuration for the list tuning jobs method. */
|
|
2489
|
+
export declare interface ListTuningJobsConfig {
|
|
2490
|
+
/** Used to override HTTP request options. */
|
|
2491
|
+
httpOptions?: HttpOptions;
|
|
2492
|
+
/** Abort signal which can be used to cancel the request.
|
|
2493
|
+
|
|
2494
|
+
NOTE: AbortSignal is a client-only operation. Using it to cancel an
|
|
2495
|
+
operation will not cancel the request in the service. You will still
|
|
2496
|
+
be charged usage for any applicable operations.
|
|
2497
|
+
*/
|
|
2498
|
+
abortSignal?: AbortSignal;
|
|
2499
|
+
pageSize?: number;
|
|
2500
|
+
pageToken?: string;
|
|
2501
|
+
filter?: string;
|
|
2502
|
+
}
|
|
2503
|
+
|
|
2504
|
+
/** Parameters for the list tuning jobs method. */
|
|
2505
|
+
export declare interface ListTuningJobsParameters {
|
|
2506
|
+
config?: ListTuningJobsConfig;
|
|
2507
|
+
}
|
|
2508
|
+
|
|
2509
|
+
/** Response for the list tuning jobs method. */
|
|
2510
|
+
export declare class ListTuningJobsResponse {
|
|
2511
|
+
/** A token to retrieve the next page of results. Pass to ListTuningJobsRequest.page_token to obtain that page. */
|
|
2512
|
+
nextPageToken?: string;
|
|
2513
|
+
/** List of TuningJobs in the requested page. */
|
|
2514
|
+
tuningJobs?: TuningJob[];
|
|
2515
|
+
}
|
|
2516
|
+
|
|
2129
2517
|
/**
|
|
2130
2518
|
Live class encapsulates the configuration for live interaction with the
|
|
2131
2519
|
Generative Language API. It embeds ApiClient for general API settings.
|
|
@@ -2252,6 +2640,22 @@ export declare interface LiveClientMessage {
|
|
|
2252
2640
|
export declare interface LiveClientRealtimeInput {
|
|
2253
2641
|
/** Inlined bytes data for media input. */
|
|
2254
2642
|
mediaChunks?: Blob_2[];
|
|
2643
|
+
/** The realtime audio input stream. */
|
|
2644
|
+
audio?: Blob_2;
|
|
2645
|
+
/**
|
|
2646
|
+
Indicates that the audio stream has ended, e.g. because the microphone was
|
|
2647
|
+
turned off.
|
|
2648
|
+
|
|
2649
|
+
This should only be sent when automatic activity detection is enabled
|
|
2650
|
+
(which is the default).
|
|
2651
|
+
|
|
2652
|
+
The client can reopen the stream by sending an audio message.
|
|
2653
|
+
*/
|
|
2654
|
+
audioStreamEnd?: boolean;
|
|
2655
|
+
/** The realtime video input stream. */
|
|
2656
|
+
video?: Blob_2;
|
|
2657
|
+
/** The realtime text input stream. */
|
|
2658
|
+
text?: string;
|
|
2255
2659
|
/** Marks the start of user activity. */
|
|
2256
2660
|
activityStart?: ActivityStart;
|
|
2257
2661
|
/** Marks the end of user activity. */
|
|
@@ -2407,7 +2811,23 @@ export declare interface LiveSendClientContentParameters {
|
|
|
2407
2811
|
/** Parameters for sending realtime input to the live API. */
|
|
2408
2812
|
export declare interface LiveSendRealtimeInputParameters {
|
|
2409
2813
|
/** Realtime input to send to the session. */
|
|
2410
|
-
media
|
|
2814
|
+
media?: BlobImageUnion;
|
|
2815
|
+
/** The realtime audio input stream. */
|
|
2816
|
+
audio?: Blob_2;
|
|
2817
|
+
/**
|
|
2818
|
+
Indicates that the audio stream has ended, e.g. because the microphone was
|
|
2819
|
+
turned off.
|
|
2820
|
+
|
|
2821
|
+
This should only be sent when automatic activity detection is enabled
|
|
2822
|
+
(which is the default).
|
|
2823
|
+
|
|
2824
|
+
The client can reopen the stream by sending an audio message.
|
|
2825
|
+
*/
|
|
2826
|
+
audioStreamEnd?: boolean;
|
|
2827
|
+
/** The realtime video input stream. */
|
|
2828
|
+
video?: BlobImageUnion;
|
|
2829
|
+
/** The realtime text input stream. */
|
|
2830
|
+
text?: string;
|
|
2411
2831
|
/** Marks the start of user activity. */
|
|
2412
2832
|
activityStart?: ActivityStart;
|
|
2413
2833
|
/** Marks the end of user activity. */
|
|
@@ -2808,6 +3228,36 @@ export declare class Models extends BaseModule {
|
|
|
2808
3228
|
* ```
|
|
2809
3229
|
*/
|
|
2810
3230
|
get(params: types.GetModelParameters): Promise<types.Model>;
|
|
3231
|
+
/**
|
|
3232
|
+
* Updates a tuned model by its name.
|
|
3233
|
+
*
|
|
3234
|
+
* @param params - The parameters for updating the model.
|
|
3235
|
+
* @return The response from the API.
|
|
3236
|
+
*
|
|
3237
|
+
* @example
|
|
3238
|
+
* ```ts
|
|
3239
|
+
* const response = await ai.models.update({
|
|
3240
|
+
* model: 'tuned-model-name',
|
|
3241
|
+
* config: {
|
|
3242
|
+
* displayName: 'New display name',
|
|
3243
|
+
* description: 'New description',
|
|
3244
|
+
* },
|
|
3245
|
+
* });
|
|
3246
|
+
* ```
|
|
3247
|
+
*/
|
|
3248
|
+
update(params: types.UpdateModelParameters): Promise<types.Model>;
|
|
3249
|
+
/**
|
|
3250
|
+
* Deletes a tuned model by its name.
|
|
3251
|
+
*
|
|
3252
|
+
* @param params - The parameters for deleting the model.
|
|
3253
|
+
* @return The response from the API.
|
|
3254
|
+
*
|
|
3255
|
+
* @example
|
|
3256
|
+
* ```ts
|
|
3257
|
+
* const response = await ai.models.delete({model: 'tuned-model-name'});
|
|
3258
|
+
* ```
|
|
3259
|
+
*/
|
|
3260
|
+
delete(params: types.DeleteModelParameters): Promise<types.DeleteModelResponse>;
|
|
2811
3261
|
/**
|
|
2812
3262
|
* Counts the number of tokens in the given contents. Multimodal input is
|
|
2813
3263
|
* supported for Gemini models.
|
|
@@ -2876,6 +3326,18 @@ export declare interface ModelSelectionConfig {
|
|
|
2876
3326
|
featureSelectionPreference?: FeatureSelectionPreference;
|
|
2877
3327
|
}
|
|
2878
3328
|
|
|
3329
|
+
/** A long-running operation. */
|
|
3330
|
+
export declare interface Operation {
|
|
3331
|
+
/** 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}`. */
|
|
3332
|
+
name?: string;
|
|
3333
|
+
/** 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. */
|
|
3334
|
+
metadata?: Record<string, unknown>;
|
|
3335
|
+
/** 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. */
|
|
3336
|
+
done?: boolean;
|
|
3337
|
+
/** The error result of the operation in case of failure or cancellation. */
|
|
3338
|
+
error?: Record<string, unknown>;
|
|
3339
|
+
}
|
|
3340
|
+
|
|
2879
3341
|
/** Parameters for the get method of the operations module. */
|
|
2880
3342
|
export declare interface OperationGetParameters {
|
|
2881
3343
|
/** The operation to be retrieved. */
|
|
@@ -3067,6 +3529,16 @@ export declare interface Part {
|
|
|
3067
3529
|
|
|
3068
3530
|
export declare type PartListUnion = PartUnion[] | PartUnion;
|
|
3069
3531
|
|
|
3532
|
+
/** Tuning spec for Partner models. */
|
|
3533
|
+
export declare interface PartnerModelTuningSpec {
|
|
3534
|
+
/** Hyperparameters for tuning. The accepted hyper_parameters and their valid range of values will differ depending on the base model. */
|
|
3535
|
+
hyperParameters?: Record<string, unknown>;
|
|
3536
|
+
/** Required. Cloud Storage path to file containing training dataset for tuning. The dataset must be formatted as a JSONL file. */
|
|
3537
|
+
trainingDatasetUri?: string;
|
|
3538
|
+
/** Optional. Cloud Storage path to file containing validation dataset for tuning. The dataset must be formatted as a JSONL file. */
|
|
3539
|
+
validationDatasetUri?: string;
|
|
3540
|
+
}
|
|
3541
|
+
|
|
3070
3542
|
export declare type PartUnion = Part | string;
|
|
3071
3543
|
|
|
3072
3544
|
/** Enum that controls the generation of people. */
|
|
@@ -3252,45 +3724,42 @@ export declare interface SafetySetting {
|
|
|
3252
3724
|
threshold?: HarmBlockThreshold;
|
|
3253
3725
|
}
|
|
3254
3726
|
|
|
3255
|
-
/** Schema
|
|
3256
|
-
|
|
3257
|
-
Represents a select subset of an OpenAPI 3.0 schema object.
|
|
3258
|
-
*/
|
|
3727
|
+
/** Schema is used to define the format of input/output data. Represents a select subset of an [OpenAPI 3.0 schema object](https://spec.openapis.org/oas/v3.0.3#schema-object). More fields may be added in the future as needed. */
|
|
3259
3728
|
export declare interface Schema {
|
|
3260
|
-
/** Optional. Example of the object. Will only populated when the object is the root. */
|
|
3261
|
-
example?: unknown;
|
|
3262
|
-
/** Optional. Pattern of the Type.STRING to restrict a string to a regular expression. */
|
|
3263
|
-
pattern?: string;
|
|
3264
|
-
/** Optional. Default value of the data. */
|
|
3265
|
-
default?: unknown;
|
|
3266
|
-
/** Optional. Maximum length of the Type.STRING */
|
|
3267
|
-
maxLength?: string;
|
|
3268
|
-
/** Optional. SCHEMA FIELDS FOR TYPE STRING Minimum length of the Type.STRING */
|
|
3269
|
-
minLength?: string;
|
|
3270
|
-
/** Optional. Minimum number of the properties for Type.OBJECT. */
|
|
3271
|
-
minProperties?: string;
|
|
3272
|
-
/** Optional. Maximum number of the properties for Type.OBJECT. */
|
|
3273
|
-
maxProperties?: string;
|
|
3274
3729
|
/** Optional. The value should be validated against any (one or more) of the subschemas in the list. */
|
|
3275
3730
|
anyOf?: Schema[];
|
|
3731
|
+
/** Optional. Default value of the data. */
|
|
3732
|
+
default?: unknown;
|
|
3276
3733
|
/** Optional. The description of the data. */
|
|
3277
3734
|
description?: string;
|
|
3278
3735
|
/** Optional. Possible values of the element of primitive type with enum format. Examples: 1. We can define direction as : {type:STRING, format:enum, enum:["EAST", NORTH", "SOUTH", "WEST"]} 2. We can define apartment number as : {type:INTEGER, format:enum, enum:["101", "201", "301"]} */
|
|
3279
3736
|
enum?: string[];
|
|
3737
|
+
/** Optional. Example of the object. Will only populated when the object is the root. */
|
|
3738
|
+
example?: unknown;
|
|
3280
3739
|
/** Optional. The format of the data. Supported formats: for NUMBER type: "float", "double" for INTEGER type: "int32", "int64" for STRING type: "email", "byte", etc */
|
|
3281
3740
|
format?: string;
|
|
3282
3741
|
/** Optional. SCHEMA FIELDS FOR TYPE ARRAY Schema of the elements of Type.ARRAY. */
|
|
3283
3742
|
items?: Schema;
|
|
3284
3743
|
/** Optional. Maximum number of the elements for Type.ARRAY. */
|
|
3285
3744
|
maxItems?: string;
|
|
3745
|
+
/** Optional. Maximum length of the Type.STRING */
|
|
3746
|
+
maxLength?: string;
|
|
3747
|
+
/** Optional. Maximum number of the properties for Type.OBJECT. */
|
|
3748
|
+
maxProperties?: string;
|
|
3286
3749
|
/** Optional. Maximum value of the Type.INTEGER and Type.NUMBER */
|
|
3287
3750
|
maximum?: number;
|
|
3288
3751
|
/** Optional. Minimum number of the elements for Type.ARRAY. */
|
|
3289
3752
|
minItems?: string;
|
|
3753
|
+
/** Optional. SCHEMA FIELDS FOR TYPE STRING Minimum length of the Type.STRING */
|
|
3754
|
+
minLength?: string;
|
|
3755
|
+
/** Optional. Minimum number of the properties for Type.OBJECT. */
|
|
3756
|
+
minProperties?: string;
|
|
3290
3757
|
/** Optional. SCHEMA FIELDS FOR TYPE INTEGER and NUMBER Minimum value of the Type.INTEGER and Type.NUMBER */
|
|
3291
3758
|
minimum?: number;
|
|
3292
3759
|
/** Optional. Indicates if the value may be null. */
|
|
3293
3760
|
nullable?: boolean;
|
|
3761
|
+
/** Optional. Pattern of the Type.STRING to restrict a string to a regular expression. */
|
|
3762
|
+
pattern?: string;
|
|
3294
3763
|
/** Optional. SCHEMA FIELDS FOR TYPE OBJECT Properties of Type.OBJECT. */
|
|
3295
3764
|
properties?: Record<string, Schema>;
|
|
3296
3765
|
/** Optional. The order of the properties. Not a standard field in open api spec. Only used to support the order of the properties. */
|
|
@@ -3356,7 +3825,6 @@ export declare class Session {
|
|
|
3356
3825
|
private readonly apiClient;
|
|
3357
3826
|
constructor(conn: WebSocket_2, apiClient: ApiClient);
|
|
3358
3827
|
private tLiveClientContent;
|
|
3359
|
-
private tLiveClientRealtimeInput;
|
|
3360
3828
|
private tLiveClienttToolResponse;
|
|
3361
3829
|
/**
|
|
3362
3830
|
Send a message over the established connection.
|
|
@@ -3486,6 +3954,28 @@ export declare interface SessionResumptionConfig {
|
|
|
3486
3954
|
transparent?: boolean;
|
|
3487
3955
|
}
|
|
3488
3956
|
|
|
3957
|
+
/**
|
|
3958
|
+
* Overrides the base URLs for the Gemini API and Vertex AI API.
|
|
3959
|
+
*
|
|
3960
|
+
* @remarks This function should be called before initializing the SDK. If the
|
|
3961
|
+
* base URLs are set after initializing the SDK, the base URLs will not be
|
|
3962
|
+
* updated. Base URLs provided in the HttpOptions will also take precedence over
|
|
3963
|
+
* URLs set here.
|
|
3964
|
+
*
|
|
3965
|
+
* @example
|
|
3966
|
+
* ```ts
|
|
3967
|
+
* import {GoogleGenAI, setDefaultBaseUrls} from '@google/genai';
|
|
3968
|
+
* // Override the base URL for the Gemini API.
|
|
3969
|
+
* setDefaultBaseUrls({geminiUrl:'https://gemini.google.com'});
|
|
3970
|
+
*
|
|
3971
|
+
* // Override the base URL for the Vertex AI API.
|
|
3972
|
+
* setDefaultBaseUrls({vertexUrl: 'https://vertexai.googleapis.com'});
|
|
3973
|
+
*
|
|
3974
|
+
* const ai = new GoogleGenAI({apiKey: 'GEMINI_API_KEY'});
|
|
3975
|
+
* ```
|
|
3976
|
+
*/
|
|
3977
|
+
export declare function setDefaultBaseUrls(baseUrlParams: BaseUrlParameters): void;
|
|
3978
|
+
|
|
3489
3979
|
/** Context window will be truncated by keeping only suffix of it.
|
|
3490
3980
|
|
|
3491
3981
|
Context window will always be cut at start of USER role turn. System
|
|
@@ -3578,6 +4068,84 @@ export declare enum SubjectReferenceType {
|
|
|
3578
4068
|
SUBJECT_TYPE_PRODUCT = "SUBJECT_TYPE_PRODUCT"
|
|
3579
4069
|
}
|
|
3580
4070
|
|
|
4071
|
+
/** Hyperparameters for SFT. */
|
|
4072
|
+
export declare interface SupervisedHyperParameters {
|
|
4073
|
+
/** Optional. Adapter size for tuning. */
|
|
4074
|
+
adapterSize?: AdapterSize;
|
|
4075
|
+
/** Optional. Number of complete passes the model makes over the entire training dataset during training. */
|
|
4076
|
+
epochCount?: string;
|
|
4077
|
+
/** Optional. Multiplier for adjusting the default learning rate. */
|
|
4078
|
+
learningRateMultiplier?: number;
|
|
4079
|
+
}
|
|
4080
|
+
|
|
4081
|
+
/** Dataset distribution for Supervised Tuning. */
|
|
4082
|
+
export declare interface SupervisedTuningDatasetDistribution {
|
|
4083
|
+
/** Output only. Sum of a given population of values that are billable. */
|
|
4084
|
+
billableSum?: string;
|
|
4085
|
+
/** Output only. Defines the histogram bucket. */
|
|
4086
|
+
buckets?: SupervisedTuningDatasetDistributionDatasetBucket[];
|
|
4087
|
+
/** Output only. The maximum of the population values. */
|
|
4088
|
+
max?: number;
|
|
4089
|
+
/** Output only. The arithmetic mean of the values in the population. */
|
|
4090
|
+
mean?: number;
|
|
4091
|
+
/** Output only. The median of the values in the population. */
|
|
4092
|
+
median?: number;
|
|
4093
|
+
/** Output only. The minimum of the population values. */
|
|
4094
|
+
min?: number;
|
|
4095
|
+
/** Output only. The 5th percentile of the values in the population. */
|
|
4096
|
+
p5?: number;
|
|
4097
|
+
/** Output only. The 95th percentile of the values in the population. */
|
|
4098
|
+
p95?: number;
|
|
4099
|
+
/** Output only. Sum of a given population of values. */
|
|
4100
|
+
sum?: string;
|
|
4101
|
+
}
|
|
4102
|
+
|
|
4103
|
+
/** Dataset bucket used to create a histogram for the distribution given a population of values. */
|
|
4104
|
+
export declare interface SupervisedTuningDatasetDistributionDatasetBucket {
|
|
4105
|
+
/** Output only. Number of values in the bucket. */
|
|
4106
|
+
count?: number;
|
|
4107
|
+
/** Output only. Left bound of the bucket. */
|
|
4108
|
+
left?: number;
|
|
4109
|
+
/** Output only. Right bound of the bucket. */
|
|
4110
|
+
right?: number;
|
|
4111
|
+
}
|
|
4112
|
+
|
|
4113
|
+
/** Tuning data statistics for Supervised Tuning. */
|
|
4114
|
+
export declare interface SupervisedTuningDataStats {
|
|
4115
|
+
/** Output only. Number of billable characters in the tuning dataset. */
|
|
4116
|
+
totalBillableCharacterCount?: string;
|
|
4117
|
+
/** Output only. Number of billable tokens in the tuning dataset. */
|
|
4118
|
+
totalBillableTokenCount?: string;
|
|
4119
|
+
/** The number of examples in the dataset that have been truncated by any amount. */
|
|
4120
|
+
totalTruncatedExampleCount?: string;
|
|
4121
|
+
/** Output only. Number of tuning characters in the tuning dataset. */
|
|
4122
|
+
totalTuningCharacterCount?: string;
|
|
4123
|
+
/** A partial sample of the indices (starting from 1) of the truncated examples. */
|
|
4124
|
+
truncatedExampleIndices?: string[];
|
|
4125
|
+
/** Output only. Number of examples in the tuning dataset. */
|
|
4126
|
+
tuningDatasetExampleCount?: string;
|
|
4127
|
+
/** Output only. Number of tuning steps for this Tuning Job. */
|
|
4128
|
+
tuningStepCount?: string;
|
|
4129
|
+
/** Output only. Sample user messages in the training dataset uri. */
|
|
4130
|
+
userDatasetExamples?: Content[];
|
|
4131
|
+
/** Output only. Dataset distributions for the user input tokens. */
|
|
4132
|
+
userInputTokenDistribution?: SupervisedTuningDatasetDistribution;
|
|
4133
|
+
/** Output only. Dataset distributions for the messages per example. */
|
|
4134
|
+
userMessagePerExampleDistribution?: SupervisedTuningDatasetDistribution;
|
|
4135
|
+
/** Output only. Dataset distributions for the user output tokens. */
|
|
4136
|
+
userOutputTokenDistribution?: SupervisedTuningDatasetDistribution;
|
|
4137
|
+
}
|
|
4138
|
+
|
|
4139
|
+
/** Tuning Spec for Supervised Tuning for first party models. */
|
|
4140
|
+
export declare interface SupervisedTuningSpec {
|
|
4141
|
+
/** Optional. Hyperparameters for SFT. */
|
|
4142
|
+
hyperParameters?: SupervisedHyperParameters;
|
|
4143
|
+
/** Required. Cloud Storage path to file containing training dataset for tuning. The dataset must be formatted as a JSONL file. */
|
|
4144
|
+
trainingDatasetUri?: string;
|
|
4145
|
+
/** Optional. Cloud Storage path to file containing validation dataset for tuning. The dataset must be formatted as a JSONL file. */
|
|
4146
|
+
validationDatasetUri?: string;
|
|
4147
|
+
}
|
|
4148
|
+
|
|
3581
4149
|
export declare interface TestTableFile {
|
|
3582
4150
|
comment?: string;
|
|
3583
4151
|
testMethod?: string;
|
|
@@ -3626,8 +4194,6 @@ export declare interface TokensInfo {
|
|
|
3626
4194
|
|
|
3627
4195
|
/** Tool details of a tool that the model may use to generate a response. */
|
|
3628
4196
|
export declare interface Tool {
|
|
3629
|
-
/** List of function declarations that the tool supports. */
|
|
3630
|
-
functionDeclarations?: FunctionDeclaration[];
|
|
3631
4197
|
/** 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. */
|
|
3632
4198
|
retrieval?: Retrieval;
|
|
3633
4199
|
/** Optional. Google Search tool type. Specialized retrieval tool
|
|
@@ -3637,6 +4203,8 @@ export declare interface Tool {
|
|
|
3637
4203
|
googleSearchRetrieval?: GoogleSearchRetrieval;
|
|
3638
4204
|
/** Optional. CodeExecution tool type. Enables the model to execute code as part of generation. This field is only used by the Gemini Developer API services. */
|
|
3639
4205
|
codeExecution?: ToolCodeExecution;
|
|
4206
|
+
/** 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 128 function declarations can be provided. */
|
|
4207
|
+
functionDeclarations?: FunctionDeclaration[];
|
|
3640
4208
|
}
|
|
3641
4209
|
|
|
3642
4210
|
/** Tool that executes code generated by the model, and automatically returns the result to the model. See also [ExecutableCode]and [CodeExecutionResult] which are input and output to this tool. */
|
|
@@ -3671,6 +4239,13 @@ export declare interface Transcription {
|
|
|
3671
4239
|
finished?: boolean;
|
|
3672
4240
|
}
|
|
3673
4241
|
|
|
4242
|
+
export declare interface TunedModel {
|
|
4243
|
+
/** Output only. The resource name of the TunedModel. Format: `projects/{project}/locations/{location}/models/{model}`. */
|
|
4244
|
+
model?: string;
|
|
4245
|
+
/** Output only. A resource name of an Endpoint. Format: `projects/{project}/locations/{location}/endpoints/{endpoint}`. */
|
|
4246
|
+
endpoint?: string;
|
|
4247
|
+
}
|
|
4248
|
+
|
|
3674
4249
|
/** A tuned machine learning model. */
|
|
3675
4250
|
export declare interface TunedModelInfo {
|
|
3676
4251
|
/** ID of the base model that you want to tune. */
|
|
@@ -3681,6 +4256,115 @@ export declare interface TunedModelInfo {
|
|
|
3681
4256
|
updateTime?: string;
|
|
3682
4257
|
}
|
|
3683
4258
|
|
|
4259
|
+
/** Supervised fine-tuning training dataset. */
|
|
4260
|
+
export declare interface TuningDataset {
|
|
4261
|
+
/** GCS URI of the file containing training dataset in JSONL format. */
|
|
4262
|
+
gcsUri?: string;
|
|
4263
|
+
/** Inline examples with simple input/output text. */
|
|
4264
|
+
examples?: TuningExample[];
|
|
4265
|
+
}
|
|
4266
|
+
|
|
4267
|
+
/** The tuning data statistic values for TuningJob. */
|
|
4268
|
+
export declare interface TuningDataStats {
|
|
4269
|
+
/** Output only. Statistics for distillation. */
|
|
4270
|
+
distillationDataStats?: DistillationDataStats;
|
|
4271
|
+
/** The SFT Tuning data stats. */
|
|
4272
|
+
supervisedTuningDataStats?: SupervisedTuningDataStats;
|
|
4273
|
+
}
|
|
4274
|
+
|
|
4275
|
+
export declare interface TuningExample {
|
|
4276
|
+
/** Text model input. */
|
|
4277
|
+
textInput?: string;
|
|
4278
|
+
/** The expected model output. */
|
|
4279
|
+
output?: string;
|
|
4280
|
+
}
|
|
4281
|
+
|
|
4282
|
+
/** A tuning job. */
|
|
4283
|
+
export declare interface TuningJob {
|
|
4284
|
+
/** Output only. Identifier. Resource name of a TuningJob. Format: `projects/{project}/locations/{location}/tuningJobs/{tuning_job}` */
|
|
4285
|
+
name?: string;
|
|
4286
|
+
/** Output only. The detailed state of the job. */
|
|
4287
|
+
state?: JobState;
|
|
4288
|
+
/** Output only. Time when the TuningJob was created. */
|
|
4289
|
+
createTime?: string;
|
|
4290
|
+
/** Output only. Time when the TuningJob for the first time entered the `JOB_STATE_RUNNING` state. */
|
|
4291
|
+
startTime?: string;
|
|
4292
|
+
/** Output only. Time when the TuningJob entered any of the following JobStates: `JOB_STATE_SUCCEEDED`, `JOB_STATE_FAILED`, `JOB_STATE_CANCELLED`, `JOB_STATE_EXPIRED`. */
|
|
4293
|
+
endTime?: string;
|
|
4294
|
+
/** Output only. Time when the TuningJob was most recently updated. */
|
|
4295
|
+
updateTime?: string;
|
|
4296
|
+
/** Output only. Only populated when job's state is `JOB_STATE_FAILED` or `JOB_STATE_CANCELLED`. */
|
|
4297
|
+
error?: GoogleRpcStatus;
|
|
4298
|
+
/** Optional. The description of the TuningJob. */
|
|
4299
|
+
description?: string;
|
|
4300
|
+
/** The base model that is being tuned, e.g., "gemini-1.0-pro-002". . */
|
|
4301
|
+
baseModel?: string;
|
|
4302
|
+
/** Output only. The tuned model resources associated with this TuningJob. */
|
|
4303
|
+
tunedModel?: TunedModel;
|
|
4304
|
+
/** Tuning Spec for Supervised Fine Tuning. */
|
|
4305
|
+
supervisedTuningSpec?: SupervisedTuningSpec;
|
|
4306
|
+
/** Output only. The tuning data statistics associated with this TuningJob. */
|
|
4307
|
+
tuningDataStats?: TuningDataStats;
|
|
4308
|
+
/** 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. */
|
|
4309
|
+
encryptionSpec?: EncryptionSpec;
|
|
4310
|
+
/** Tuning Spec for open sourced and third party Partner models. */
|
|
4311
|
+
partnerModelTuningSpec?: PartnerModelTuningSpec;
|
|
4312
|
+
/** Tuning Spec for Distillation. */
|
|
4313
|
+
distillationSpec?: DistillationSpec;
|
|
4314
|
+
/** Output only. The Experiment associated with this TuningJob. */
|
|
4315
|
+
experiment?: string;
|
|
4316
|
+
/** 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. */
|
|
4317
|
+
labels?: Record<string, string>;
|
|
4318
|
+
/** Output only. The resource name of the PipelineJob associated with the TuningJob. Format: `projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}`. */
|
|
4319
|
+
pipelineJob?: string;
|
|
4320
|
+
/** Optional. The display name of the TunedModel. The name can be up to 128 characters long and can consist of any UTF-8 characters. */
|
|
4321
|
+
tunedModelDisplayName?: string;
|
|
4322
|
+
}
|
|
4323
|
+
|
|
4324
|
+
declare class Tunings extends BaseModule {
|
|
4325
|
+
private readonly apiClient;
|
|
4326
|
+
constructor(apiClient: ApiClient);
|
|
4327
|
+
/**
|
|
4328
|
+
* Gets a TuningJob.
|
|
4329
|
+
*
|
|
4330
|
+
* @param name - The resource name of the tuning job.
|
|
4331
|
+
* @return - A TuningJob object.
|
|
4332
|
+
*
|
|
4333
|
+
* @experimental - The SDK's tuning implementation is experimental, and may
|
|
4334
|
+
* change in future versions.
|
|
4335
|
+
*/
|
|
4336
|
+
get: (params: types.GetTuningJobParameters) => Promise<types.TuningJob>;
|
|
4337
|
+
/**
|
|
4338
|
+
* Lists tuning jobs.
|
|
4339
|
+
*
|
|
4340
|
+
* @param config - The configuration for the list request.
|
|
4341
|
+
* @return - A list of tuning jobs.
|
|
4342
|
+
*
|
|
4343
|
+
* @experimental - The SDK's tuning implementation is experimental, and may
|
|
4344
|
+
* change in future versions.
|
|
4345
|
+
*/
|
|
4346
|
+
list: (params?: types.ListTuningJobsParameters) => Promise<Pager<types.TuningJob>>;
|
|
4347
|
+
/**
|
|
4348
|
+
* Creates a supervised fine-tuning job.
|
|
4349
|
+
*
|
|
4350
|
+
* @param params - The parameters for the tuning job.
|
|
4351
|
+
* @return - A TuningJob operation.
|
|
4352
|
+
*
|
|
4353
|
+
* @experimental - The SDK's tuning implementation is experimental, and may
|
|
4354
|
+
* change in future versions.
|
|
4355
|
+
*/
|
|
4356
|
+
tune: (params: types.CreateTuningJobParameters) => Promise<types.TuningJob>;
|
|
4357
|
+
private getInternal;
|
|
4358
|
+
private listInternal;
|
|
4359
|
+
private tuneInternal;
|
|
4360
|
+
private tuneMldevInternal;
|
|
4361
|
+
}
|
|
4362
|
+
|
|
4363
|
+
export declare interface TuningValidationDataset {
|
|
4364
|
+
/** GCS URI of the file containing validation dataset in JSONL format. */
|
|
4365
|
+
gcsUri?: string;
|
|
4366
|
+
}
|
|
4367
|
+
|
|
3684
4368
|
/** Options about which input is included in the user's turn. */
|
|
3685
4369
|
export declare enum TurnCoverage {
|
|
3686
4370
|
TURN_COVERAGE_UNSPECIFIED = "TURN_COVERAGE_UNSPECIFIED",
|
|
@@ -3712,11 +4396,11 @@ declare namespace types {
|
|
|
3712
4396
|
createModelContent,
|
|
3713
4397
|
Outcome,
|
|
3714
4398
|
Language,
|
|
3715
|
-
Type,
|
|
3716
4399
|
HarmCategory,
|
|
3717
4400
|
HarmBlockMethod,
|
|
3718
4401
|
HarmBlockThreshold,
|
|
3719
4402
|
Mode,
|
|
4403
|
+
Type,
|
|
3720
4404
|
FinishReason,
|
|
3721
4405
|
HarmProbability,
|
|
3722
4406
|
HarmSeverity,
|
|
@@ -3724,6 +4408,8 @@ declare namespace types {
|
|
|
3724
4408
|
TrafficType,
|
|
3725
4409
|
Modality,
|
|
3726
4410
|
MediaResolution,
|
|
4411
|
+
JobState,
|
|
4412
|
+
AdapterSize,
|
|
3727
4413
|
FeatureSelectionPreference,
|
|
3728
4414
|
DynamicRetrievalConfigMode,
|
|
3729
4415
|
FunctionCallingConfigMode,
|
|
@@ -3750,10 +4436,8 @@ declare namespace types {
|
|
|
3750
4436
|
Part,
|
|
3751
4437
|
Content,
|
|
3752
4438
|
HttpOptions,
|
|
3753
|
-
Schema,
|
|
3754
4439
|
ModelSelectionConfig,
|
|
3755
4440
|
SafetySetting,
|
|
3756
|
-
FunctionDeclaration,
|
|
3757
4441
|
GoogleSearch,
|
|
3758
4442
|
DynamicRetrievalConfig,
|
|
3759
4443
|
GoogleSearchRetrieval,
|
|
@@ -3768,6 +4452,8 @@ declare namespace types {
|
|
|
3768
4452
|
VertexRagStore,
|
|
3769
4453
|
Retrieval,
|
|
3770
4454
|
ToolCodeExecution,
|
|
4455
|
+
Schema,
|
|
4456
|
+
FunctionDeclaration,
|
|
3771
4457
|
Tool,
|
|
3772
4458
|
FunctionCallingConfig,
|
|
3773
4459
|
ToolConfig,
|
|
@@ -3817,6 +4503,11 @@ declare namespace types {
|
|
|
3817
4503
|
Endpoint,
|
|
3818
4504
|
TunedModelInfo,
|
|
3819
4505
|
Model,
|
|
4506
|
+
UpdateModelConfig,
|
|
4507
|
+
UpdateModelParameters,
|
|
4508
|
+
DeleteModelConfig,
|
|
4509
|
+
DeleteModelParameters,
|
|
4510
|
+
DeleteModelResponse,
|
|
3820
4511
|
GenerationConfig,
|
|
3821
4512
|
CountTokensConfig,
|
|
3822
4513
|
CountTokensParameters,
|
|
@@ -3831,6 +4522,34 @@ declare namespace types {
|
|
|
3831
4522
|
GeneratedVideo,
|
|
3832
4523
|
GenerateVideosResponse,
|
|
3833
4524
|
GenerateVideosOperation,
|
|
4525
|
+
GetTuningJobConfig,
|
|
4526
|
+
GetTuningJobParameters,
|
|
4527
|
+
TunedModel,
|
|
4528
|
+
GoogleRpcStatus,
|
|
4529
|
+
SupervisedHyperParameters,
|
|
4530
|
+
SupervisedTuningSpec,
|
|
4531
|
+
DatasetDistributionDistributionBucket,
|
|
4532
|
+
DatasetDistribution,
|
|
4533
|
+
DatasetStats,
|
|
4534
|
+
DistillationDataStats,
|
|
4535
|
+
SupervisedTuningDatasetDistributionDatasetBucket,
|
|
4536
|
+
SupervisedTuningDatasetDistribution,
|
|
4537
|
+
SupervisedTuningDataStats,
|
|
4538
|
+
TuningDataStats,
|
|
4539
|
+
EncryptionSpec,
|
|
4540
|
+
PartnerModelTuningSpec,
|
|
4541
|
+
DistillationHyperParameters,
|
|
4542
|
+
DistillationSpec,
|
|
4543
|
+
TuningJob,
|
|
4544
|
+
ListTuningJobsConfig,
|
|
4545
|
+
ListTuningJobsParameters,
|
|
4546
|
+
ListTuningJobsResponse,
|
|
4547
|
+
TuningExample,
|
|
4548
|
+
TuningDataset,
|
|
4549
|
+
TuningValidationDataset,
|
|
4550
|
+
CreateTuningJobConfig,
|
|
4551
|
+
CreateTuningJobParameters,
|
|
4552
|
+
Operation,
|
|
3834
4553
|
CreateCachedContentConfig,
|
|
3835
4554
|
CreateCachedContentParameters,
|
|
3836
4555
|
CachedContentUsageMetadata,
|
|
@@ -3914,6 +4633,7 @@ declare namespace types {
|
|
|
3914
4633
|
LiveSendRealtimeInputParameters,
|
|
3915
4634
|
LiveSendToolResponseParameters,
|
|
3916
4635
|
OperationGetParameters,
|
|
4636
|
+
BlobImageUnion,
|
|
3917
4637
|
PartUnion,
|
|
3918
4638
|
PartListUnion,
|
|
3919
4639
|
ContentUnion,
|
|
@@ -3928,6 +4648,13 @@ declare namespace types {
|
|
|
3928
4648
|
export declare interface UpdateCachedContentConfig {
|
|
3929
4649
|
/** Used to override HTTP request options. */
|
|
3930
4650
|
httpOptions?: HttpOptions;
|
|
4651
|
+
/** Abort signal which can be used to cancel the request.
|
|
4652
|
+
|
|
4653
|
+
NOTE: AbortSignal is a client-only operation. Using it to cancel an
|
|
4654
|
+
operation will not cancel the request in the service. You will still
|
|
4655
|
+
be charged usage for any applicable operations.
|
|
4656
|
+
*/
|
|
4657
|
+
abortSignal?: AbortSignal;
|
|
3931
4658
|
/** 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". */
|
|
3932
4659
|
ttl?: string;
|
|
3933
4660
|
/** Timestamp of when this resource is considered expired. Uses RFC 3339 format, Example: 2014-10-02T15:01:23Z. */
|
|
@@ -3943,6 +4670,27 @@ export declare interface UpdateCachedContentParameters {
|
|
|
3943
4670
|
config?: UpdateCachedContentConfig;
|
|
3944
4671
|
}
|
|
3945
4672
|
|
|
4673
|
+
/** Configuration for updating a tuned model. */
|
|
4674
|
+
export declare interface UpdateModelConfig {
|
|
4675
|
+
/** Used to override HTTP request options. */
|
|
4676
|
+
httpOptions?: HttpOptions;
|
|
4677
|
+
/** Abort signal which can be used to cancel the request.
|
|
4678
|
+
|
|
4679
|
+
NOTE: AbortSignal is a client-only operation. Using it to cancel an
|
|
4680
|
+
operation will not cancel the request in the service. You will still
|
|
4681
|
+
be charged usage for any applicable operations.
|
|
4682
|
+
*/
|
|
4683
|
+
abortSignal?: AbortSignal;
|
|
4684
|
+
displayName?: string;
|
|
4685
|
+
description?: string;
|
|
4686
|
+
}
|
|
4687
|
+
|
|
4688
|
+
/** Configuration for updating a tuned model. */
|
|
4689
|
+
export declare interface UpdateModelParameters {
|
|
4690
|
+
model: string;
|
|
4691
|
+
config?: UpdateModelConfig;
|
|
4692
|
+
}
|
|
4693
|
+
|
|
3946
4694
|
declare interface Uploader {
|
|
3947
4695
|
/**
|
|
3948
4696
|
* Uploads a file to the given upload url.
|
|
@@ -3970,6 +4718,13 @@ declare interface Uploader {
|
|
|
3970
4718
|
export declare interface UploadFileConfig {
|
|
3971
4719
|
/** Used to override HTTP request options. */
|
|
3972
4720
|
httpOptions?: HttpOptions;
|
|
4721
|
+
/** Abort signal which can be used to cancel the request.
|
|
4722
|
+
|
|
4723
|
+
NOTE: AbortSignal is a client-only operation. Using it to cancel an
|
|
4724
|
+
operation will not cancel the request in the service. You will still
|
|
4725
|
+
be charged usage for any applicable operations.
|
|
4726
|
+
*/
|
|
4727
|
+
abortSignal?: AbortSignal;
|
|
3973
4728
|
/** The name of the file in the destination (e.g., 'files/sample-image'. If not provided one will be generated. */
|
|
3974
4729
|
name?: string;
|
|
3975
4730
|
/** mime_type: The MIME type of the file. If not provided, it will be inferred from the file extension. */
|
|
@@ -3995,6 +4750,13 @@ export declare interface UploadFileParameters {
|
|
|
3995
4750
|
export declare interface UpscaleImageConfig {
|
|
3996
4751
|
/** Used to override HTTP request options. */
|
|
3997
4752
|
httpOptions?: HttpOptions;
|
|
4753
|
+
/** Abort signal which can be used to cancel the request.
|
|
4754
|
+
|
|
4755
|
+
NOTE: AbortSignal is a client-only operation. Using it to cancel an
|
|
4756
|
+
operation will not cancel the request in the service. You will still
|
|
4757
|
+
be charged usage for any applicable operations.
|
|
4758
|
+
*/
|
|
4759
|
+
abortSignal?: AbortSignal;
|
|
3998
4760
|
/** Whether to include a reason for filtered-out images in the
|
|
3999
4761
|
response. */
|
|
4000
4762
|
includeRaiReason?: boolean;
|