@google/genai 0.10.0 → 0.12.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 +576 -39
- package/dist/index.js +1320 -894
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1319 -895
- package/dist/index.mjs.map +1 -1
- package/dist/node/index.js +1320 -894
- package/dist/node/index.js.map +1 -1
- package/dist/node/node.d.ts +576 -39
- package/dist/web/index.mjs +1319 -895
- package/dist/web/index.mjs.map +1 -1
- package/dist/web/web.d.ts +576 -39
- 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.
|
|
@@ -258,7 +269,7 @@ export declare class Caches extends BaseModule {
|
|
|
258
269
|
* ```ts
|
|
259
270
|
* const contents = ...; // Initialize the content to cache.
|
|
260
271
|
* const response = await ai.caches.create({
|
|
261
|
-
* model: 'gemini-
|
|
272
|
+
* model: 'gemini-2.0-flash-001',
|
|
262
273
|
* config: {
|
|
263
274
|
* 'contents': contents,
|
|
264
275
|
* 'displayName': 'test cache',
|
|
@@ -277,7 +288,7 @@ export declare class Caches extends BaseModule {
|
|
|
277
288
|
*
|
|
278
289
|
* @example
|
|
279
290
|
* ```ts
|
|
280
|
-
* await ai.caches.get({name: '
|
|
291
|
+
* await ai.caches.get({name: '...'}); // The server-generated resource name.
|
|
281
292
|
* ```
|
|
282
293
|
*/
|
|
283
294
|
get(params: types.GetCachedContentParameters): Promise<types.CachedContent>;
|
|
@@ -289,7 +300,7 @@ export declare class Caches extends BaseModule {
|
|
|
289
300
|
*
|
|
290
301
|
* @example
|
|
291
302
|
* ```ts
|
|
292
|
-
* await ai.caches.delete({name: '
|
|
303
|
+
* await ai.caches.delete({name: '...'}); // The server-generated resource name.
|
|
293
304
|
* ```
|
|
294
305
|
*/
|
|
295
306
|
delete(params: types.DeleteCachedContentParameters): Promise<types.DeleteCachedContentResponse>;
|
|
@@ -302,7 +313,7 @@ export declare class Caches extends BaseModule {
|
|
|
302
313
|
* @example
|
|
303
314
|
* ```ts
|
|
304
315
|
* const response = await ai.caches.update({
|
|
305
|
-
* name: '
|
|
316
|
+
* name: '...', // The server-generated resource name.
|
|
306
317
|
* config: {'ttl': '7600s'}
|
|
307
318
|
* });
|
|
308
319
|
* ```
|
|
@@ -685,7 +696,7 @@ export declare interface CreateCachedContentConfig {
|
|
|
685
696
|
|
|
686
697
|
/** Parameters for caches.create method. */
|
|
687
698
|
export declare interface CreateCachedContentParameters {
|
|
688
|
-
/** ID of the model to use. Example: gemini-
|
|
699
|
+
/** ID of the model to use. Example: gemini-2.0-flash */
|
|
689
700
|
model: string;
|
|
690
701
|
/** Configuration that contains optional parameters.
|
|
691
702
|
*/
|
|
@@ -700,7 +711,7 @@ export declare interface CreateCachedContentParameters {
|
|
|
700
711
|
export declare interface CreateChatParameters {
|
|
701
712
|
/** The name of the model to use for the chat session.
|
|
702
713
|
|
|
703
|
-
For example: 'gemini-2.0-flash', 'gemini-
|
|
714
|
+
For example: 'gemini-2.0-flash', 'gemini-2.0-flash-lite', etc. See Gemini API
|
|
704
715
|
docs to find the available models.
|
|
705
716
|
*/
|
|
706
717
|
model: string;
|
|
@@ -791,11 +802,100 @@ export declare function createPartFromText(text: string): Part;
|
|
|
791
802
|
*/
|
|
792
803
|
export declare function createPartFromUri(uri: string, mimeType: string): Part;
|
|
793
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
|
+
|
|
794
844
|
/**
|
|
795
845
|
* Creates a `Content` object with a user role from a `PartListUnion` object or `string`.
|
|
796
846
|
*/
|
|
797
847
|
export declare function createUserContent(partOrString: PartListUnion | string): Content;
|
|
798
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
|
+
|
|
799
899
|
/** Optional parameters for caches.delete method. */
|
|
800
900
|
export declare interface DeleteCachedContentConfig {
|
|
801
901
|
/** Used to override HTTP request options. */
|
|
@@ -848,6 +948,63 @@ export declare interface DeleteFileParameters {
|
|
|
848
948
|
export declare class DeleteFileResponse {
|
|
849
949
|
}
|
|
850
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
|
+
|
|
851
1008
|
/** Used to override the default configuration. */
|
|
852
1009
|
export declare interface DownloadFileConfig {
|
|
853
1010
|
/** Used to override HTTP request options. */
|
|
@@ -940,6 +1097,12 @@ export declare class EmbedContentResponse {
|
|
|
940
1097
|
metadata?: EmbedContentMetadata;
|
|
941
1098
|
}
|
|
942
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
|
+
|
|
943
1106
|
/** An endpoint where you deploy models. */
|
|
944
1107
|
export declare interface Endpoint {
|
|
945
1108
|
/** Resource name of the endpoint. */
|
|
@@ -1220,21 +1383,16 @@ export declare enum FunctionCallingConfigMode {
|
|
|
1220
1383
|
NONE = "NONE"
|
|
1221
1384
|
}
|
|
1222
1385
|
|
|
1223
|
-
/**
|
|
1224
|
-
|
|
1225
|
-
The inputs are based on `OpenAPI 3.0 specifications
|
|
1226
|
-
<https://spec.openapis.org/oas/v3.0.3>`_.
|
|
1227
|
-
*/
|
|
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. */
|
|
1228
1387
|
export declare interface FunctionDeclaration {
|
|
1229
|
-
/** Describes the output from the function in the OpenAPI JSON Schema
|
|
1230
|
-
Object format. */
|
|
1231
|
-
response?: Schema;
|
|
1232
1388
|
/** Optional. Description and purpose of the function. Model uses it to decide how and whether to call the function. */
|
|
1233
1389
|
description?: string;
|
|
1234
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. */
|
|
1235
1391
|
name?: string;
|
|
1236
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 */
|
|
1237
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;
|
|
1238
1396
|
}
|
|
1239
1397
|
|
|
1240
1398
|
/** A function response. */
|
|
@@ -1887,6 +2045,26 @@ export declare interface GetOperationParameters {
|
|
|
1887
2045
|
config?: GetOperationConfig;
|
|
1888
2046
|
}
|
|
1889
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
|
+
|
|
1890
2068
|
/**
|
|
1891
2069
|
* The Google GenAI SDK.
|
|
1892
2070
|
*
|
|
@@ -1934,6 +2112,7 @@ export declare class GoogleGenAI {
|
|
|
1934
2112
|
readonly caches: Caches;
|
|
1935
2113
|
readonly files: Files;
|
|
1936
2114
|
readonly operations: Operations;
|
|
2115
|
+
readonly tunings: Tunings;
|
|
1937
2116
|
constructor(options: GoogleGenAIOptions);
|
|
1938
2117
|
}
|
|
1939
2118
|
|
|
@@ -1948,7 +2127,7 @@ export declare interface GoogleGenAIOptions {
|
|
|
1948
2127
|
*
|
|
1949
2128
|
* @remarks
|
|
1950
2129
|
* When true, the {@link https://cloud.google.com/vertex-ai/docs/reference/rest | Vertex AI API} will used.
|
|
1951
|
-
* When false, the {@link https://
|
|
2130
|
+
* When false, the {@link https://ai.google.dev/api | Gemini API} will be used.
|
|
1952
2131
|
*
|
|
1953
2132
|
* If unset, default SDK behavior is to use the Gemini API service.
|
|
1954
2133
|
*/
|
|
@@ -1956,12 +2135,14 @@ export declare interface GoogleGenAIOptions {
|
|
|
1956
2135
|
/**
|
|
1957
2136
|
* Optional. The Google Cloud project ID for Vertex AI clients.
|
|
1958
2137
|
*
|
|
2138
|
+
* Find your project ID: https://cloud.google.com/resource-manager/docs/creating-managing-projects#identifying_projects
|
|
2139
|
+
*
|
|
1959
2140
|
* @remarks
|
|
1960
2141
|
* Only supported on Node runtimes, ignored on browser runtimes.
|
|
1961
2142
|
*/
|
|
1962
2143
|
project?: string;
|
|
1963
2144
|
/**
|
|
1964
|
-
* 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.
|
|
1965
2146
|
*
|
|
1966
2147
|
* @remarks
|
|
1967
2148
|
* Only supported on Node runtimes, ignored on browser runtimes.
|
|
@@ -1998,6 +2179,16 @@ export declare interface GoogleGenAIOptions {
|
|
|
1998
2179
|
httpOptions?: HttpOptions;
|
|
1999
2180
|
}
|
|
2000
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
|
+
|
|
2001
2192
|
/** Tool to support Google Search in Model. Powered by Google. */
|
|
2002
2193
|
export declare interface GoogleSearch {
|
|
2003
2194
|
}
|
|
@@ -2214,6 +2405,22 @@ export declare enum ImagePromptLanguage {
|
|
|
2214
2405
|
hi = "hi"
|
|
2215
2406
|
}
|
|
2216
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
|
+
|
|
2217
2424
|
/** Required. Programming language of the `code`. */
|
|
2218
2425
|
export declare enum Language {
|
|
2219
2426
|
LANGUAGE_UNSPECIFIED = "LANGUAGE_UNSPECIFIED",
|
|
@@ -2278,6 +2485,35 @@ export declare class ListFilesResponse {
|
|
|
2278
2485
|
files?: File_2[];
|
|
2279
2486
|
}
|
|
2280
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
|
+
|
|
2281
2517
|
/**
|
|
2282
2518
|
Live class encapsulates the configuration for live interaction with the
|
|
2283
2519
|
Generative Language API. It embeds ApiClient for general API settings.
|
|
@@ -2616,6 +2852,8 @@ export declare interface LiveServerContent {
|
|
|
2616
2852
|
turnComplete?: boolean;
|
|
2617
2853
|
/** If true, indicates that a client message has interrupted current model generation. If the client is playing out the content in realtime, this is a good signal to stop and empty the current queue. */
|
|
2618
2854
|
interrupted?: boolean;
|
|
2855
|
+
/** Metadata returned to client when grounding is enabled. */
|
|
2856
|
+
groundingMetadata?: GroundingMetadata;
|
|
2619
2857
|
/** If true, indicates that the model is done generating. When model is
|
|
2620
2858
|
interrupted while generating there will be no generation_complete message
|
|
2621
2859
|
in interrupted turn, it will go through interrupted > turn_complete.
|
|
@@ -2992,6 +3230,36 @@ export declare class Models extends BaseModule {
|
|
|
2992
3230
|
* ```
|
|
2993
3231
|
*/
|
|
2994
3232
|
get(params: types.GetModelParameters): Promise<types.Model>;
|
|
3233
|
+
/**
|
|
3234
|
+
* Updates a tuned model by its name.
|
|
3235
|
+
*
|
|
3236
|
+
* @param params - The parameters for updating the model.
|
|
3237
|
+
* @return The response from the API.
|
|
3238
|
+
*
|
|
3239
|
+
* @example
|
|
3240
|
+
* ```ts
|
|
3241
|
+
* const response = await ai.models.update({
|
|
3242
|
+
* model: 'tuned-model-name',
|
|
3243
|
+
* config: {
|
|
3244
|
+
* displayName: 'New display name',
|
|
3245
|
+
* description: 'New description',
|
|
3246
|
+
* },
|
|
3247
|
+
* });
|
|
3248
|
+
* ```
|
|
3249
|
+
*/
|
|
3250
|
+
update(params: types.UpdateModelParameters): Promise<types.Model>;
|
|
3251
|
+
/**
|
|
3252
|
+
* Deletes a tuned model by its name.
|
|
3253
|
+
*
|
|
3254
|
+
* @param params - The parameters for deleting the model.
|
|
3255
|
+
* @return The response from the API.
|
|
3256
|
+
*
|
|
3257
|
+
* @example
|
|
3258
|
+
* ```ts
|
|
3259
|
+
* const response = await ai.models.delete({model: 'tuned-model-name'});
|
|
3260
|
+
* ```
|
|
3261
|
+
*/
|
|
3262
|
+
delete(params: types.DeleteModelParameters): Promise<types.DeleteModelResponse>;
|
|
2995
3263
|
/**
|
|
2996
3264
|
* Counts the number of tokens in the given contents. Multimodal input is
|
|
2997
3265
|
* supported for Gemini models.
|
|
@@ -3060,6 +3328,18 @@ export declare interface ModelSelectionConfig {
|
|
|
3060
3328
|
featureSelectionPreference?: FeatureSelectionPreference;
|
|
3061
3329
|
}
|
|
3062
3330
|
|
|
3331
|
+
/** A long-running operation. */
|
|
3332
|
+
export declare interface Operation {
|
|
3333
|
+
/** 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}`. */
|
|
3334
|
+
name?: string;
|
|
3335
|
+
/** 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. */
|
|
3336
|
+
metadata?: Record<string, unknown>;
|
|
3337
|
+
/** 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. */
|
|
3338
|
+
done?: boolean;
|
|
3339
|
+
/** The error result of the operation in case of failure or cancellation. */
|
|
3340
|
+
error?: Record<string, unknown>;
|
|
3341
|
+
}
|
|
3342
|
+
|
|
3063
3343
|
/** Parameters for the get method of the operations module. */
|
|
3064
3344
|
export declare interface OperationGetParameters {
|
|
3065
3345
|
/** The operation to be retrieved. */
|
|
@@ -3251,6 +3531,16 @@ export declare interface Part {
|
|
|
3251
3531
|
|
|
3252
3532
|
export declare type PartListUnion = PartUnion[] | PartUnion;
|
|
3253
3533
|
|
|
3534
|
+
/** Tuning spec for Partner models. */
|
|
3535
|
+
export declare interface PartnerModelTuningSpec {
|
|
3536
|
+
/** Hyperparameters for tuning. The accepted hyper_parameters and their valid range of values will differ depending on the base model. */
|
|
3537
|
+
hyperParameters?: Record<string, unknown>;
|
|
3538
|
+
/** Required. Cloud Storage path to file containing training dataset for tuning. The dataset must be formatted as a JSONL file. */
|
|
3539
|
+
trainingDatasetUri?: string;
|
|
3540
|
+
/** Optional. Cloud Storage path to file containing validation dataset for tuning. The dataset must be formatted as a JSONL file. */
|
|
3541
|
+
validationDatasetUri?: string;
|
|
3542
|
+
}
|
|
3543
|
+
|
|
3254
3544
|
export declare type PartUnion = Part | string;
|
|
3255
3545
|
|
|
3256
3546
|
/** Enum that controls the generation of people. */
|
|
@@ -3436,45 +3726,42 @@ export declare interface SafetySetting {
|
|
|
3436
3726
|
threshold?: HarmBlockThreshold;
|
|
3437
3727
|
}
|
|
3438
3728
|
|
|
3439
|
-
/** Schema
|
|
3440
|
-
|
|
3441
|
-
Represents a select subset of an OpenAPI 3.0 schema object.
|
|
3442
|
-
*/
|
|
3729
|
+
/** 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. */
|
|
3443
3730
|
export declare interface Schema {
|
|
3444
|
-
/** Optional. Example of the object. Will only populated when the object is the root. */
|
|
3445
|
-
example?: unknown;
|
|
3446
|
-
/** Optional. Pattern of the Type.STRING to restrict a string to a regular expression. */
|
|
3447
|
-
pattern?: string;
|
|
3448
|
-
/** Optional. Default value of the data. */
|
|
3449
|
-
default?: unknown;
|
|
3450
|
-
/** Optional. Maximum length of the Type.STRING */
|
|
3451
|
-
maxLength?: string;
|
|
3452
|
-
/** Optional. SCHEMA FIELDS FOR TYPE STRING Minimum length of the Type.STRING */
|
|
3453
|
-
minLength?: string;
|
|
3454
|
-
/** Optional. Minimum number of the properties for Type.OBJECT. */
|
|
3455
|
-
minProperties?: string;
|
|
3456
|
-
/** Optional. Maximum number of the properties for Type.OBJECT. */
|
|
3457
|
-
maxProperties?: string;
|
|
3458
3731
|
/** Optional. The value should be validated against any (one or more) of the subschemas in the list. */
|
|
3459
3732
|
anyOf?: Schema[];
|
|
3733
|
+
/** Optional. Default value of the data. */
|
|
3734
|
+
default?: unknown;
|
|
3460
3735
|
/** Optional. The description of the data. */
|
|
3461
3736
|
description?: string;
|
|
3462
3737
|
/** 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"]} */
|
|
3463
3738
|
enum?: string[];
|
|
3739
|
+
/** Optional. Example of the object. Will only populated when the object is the root. */
|
|
3740
|
+
example?: unknown;
|
|
3464
3741
|
/** Optional. The format of the data. Supported formats: for NUMBER type: "float", "double" for INTEGER type: "int32", "int64" for STRING type: "email", "byte", etc */
|
|
3465
3742
|
format?: string;
|
|
3466
3743
|
/** Optional. SCHEMA FIELDS FOR TYPE ARRAY Schema of the elements of Type.ARRAY. */
|
|
3467
3744
|
items?: Schema;
|
|
3468
3745
|
/** Optional. Maximum number of the elements for Type.ARRAY. */
|
|
3469
3746
|
maxItems?: string;
|
|
3747
|
+
/** Optional. Maximum length of the Type.STRING */
|
|
3748
|
+
maxLength?: string;
|
|
3749
|
+
/** Optional. Maximum number of the properties for Type.OBJECT. */
|
|
3750
|
+
maxProperties?: string;
|
|
3470
3751
|
/** Optional. Maximum value of the Type.INTEGER and Type.NUMBER */
|
|
3471
3752
|
maximum?: number;
|
|
3472
3753
|
/** Optional. Minimum number of the elements for Type.ARRAY. */
|
|
3473
3754
|
minItems?: string;
|
|
3755
|
+
/** Optional. SCHEMA FIELDS FOR TYPE STRING Minimum length of the Type.STRING */
|
|
3756
|
+
minLength?: string;
|
|
3757
|
+
/** Optional. Minimum number of the properties for Type.OBJECT. */
|
|
3758
|
+
minProperties?: string;
|
|
3474
3759
|
/** Optional. SCHEMA FIELDS FOR TYPE INTEGER and NUMBER Minimum value of the Type.INTEGER and Type.NUMBER */
|
|
3475
3760
|
minimum?: number;
|
|
3476
3761
|
/** Optional. Indicates if the value may be null. */
|
|
3477
3762
|
nullable?: boolean;
|
|
3763
|
+
/** Optional. Pattern of the Type.STRING to restrict a string to a regular expression. */
|
|
3764
|
+
pattern?: string;
|
|
3478
3765
|
/** Optional. SCHEMA FIELDS FOR TYPE OBJECT Properties of Type.OBJECT. */
|
|
3479
3766
|
properties?: Record<string, Schema>;
|
|
3480
3767
|
/** Optional. The order of the properties. Not a standard field in open api spec. Only used to support the order of the properties. */
|
|
@@ -3783,6 +4070,84 @@ export declare enum SubjectReferenceType {
|
|
|
3783
4070
|
SUBJECT_TYPE_PRODUCT = "SUBJECT_TYPE_PRODUCT"
|
|
3784
4071
|
}
|
|
3785
4072
|
|
|
4073
|
+
/** Hyperparameters for SFT. */
|
|
4074
|
+
export declare interface SupervisedHyperParameters {
|
|
4075
|
+
/** Optional. Adapter size for tuning. */
|
|
4076
|
+
adapterSize?: AdapterSize;
|
|
4077
|
+
/** Optional. Number of complete passes the model makes over the entire training dataset during training. */
|
|
4078
|
+
epochCount?: string;
|
|
4079
|
+
/** Optional. Multiplier for adjusting the default learning rate. */
|
|
4080
|
+
learningRateMultiplier?: number;
|
|
4081
|
+
}
|
|
4082
|
+
|
|
4083
|
+
/** Dataset distribution for Supervised Tuning. */
|
|
4084
|
+
export declare interface SupervisedTuningDatasetDistribution {
|
|
4085
|
+
/** Output only. Sum of a given population of values that are billable. */
|
|
4086
|
+
billableSum?: string;
|
|
4087
|
+
/** Output only. Defines the histogram bucket. */
|
|
4088
|
+
buckets?: SupervisedTuningDatasetDistributionDatasetBucket[];
|
|
4089
|
+
/** Output only. The maximum of the population values. */
|
|
4090
|
+
max?: number;
|
|
4091
|
+
/** Output only. The arithmetic mean of the values in the population. */
|
|
4092
|
+
mean?: number;
|
|
4093
|
+
/** Output only. The median of the values in the population. */
|
|
4094
|
+
median?: number;
|
|
4095
|
+
/** Output only. The minimum of the population values. */
|
|
4096
|
+
min?: number;
|
|
4097
|
+
/** Output only. The 5th percentile of the values in the population. */
|
|
4098
|
+
p5?: number;
|
|
4099
|
+
/** Output only. The 95th percentile of the values in the population. */
|
|
4100
|
+
p95?: number;
|
|
4101
|
+
/** Output only. Sum of a given population of values. */
|
|
4102
|
+
sum?: string;
|
|
4103
|
+
}
|
|
4104
|
+
|
|
4105
|
+
/** Dataset bucket used to create a histogram for the distribution given a population of values. */
|
|
4106
|
+
export declare interface SupervisedTuningDatasetDistributionDatasetBucket {
|
|
4107
|
+
/** Output only. Number of values in the bucket. */
|
|
4108
|
+
count?: number;
|
|
4109
|
+
/** Output only. Left bound of the bucket. */
|
|
4110
|
+
left?: number;
|
|
4111
|
+
/** Output only. Right bound of the bucket. */
|
|
4112
|
+
right?: number;
|
|
4113
|
+
}
|
|
4114
|
+
|
|
4115
|
+
/** Tuning data statistics for Supervised Tuning. */
|
|
4116
|
+
export declare interface SupervisedTuningDataStats {
|
|
4117
|
+
/** Output only. Number of billable characters in the tuning dataset. */
|
|
4118
|
+
totalBillableCharacterCount?: string;
|
|
4119
|
+
/** Output only. Number of billable tokens in the tuning dataset. */
|
|
4120
|
+
totalBillableTokenCount?: string;
|
|
4121
|
+
/** The number of examples in the dataset that have been truncated by any amount. */
|
|
4122
|
+
totalTruncatedExampleCount?: string;
|
|
4123
|
+
/** Output only. Number of tuning characters in the tuning dataset. */
|
|
4124
|
+
totalTuningCharacterCount?: string;
|
|
4125
|
+
/** A partial sample of the indices (starting from 1) of the truncated examples. */
|
|
4126
|
+
truncatedExampleIndices?: string[];
|
|
4127
|
+
/** Output only. Number of examples in the tuning dataset. */
|
|
4128
|
+
tuningDatasetExampleCount?: string;
|
|
4129
|
+
/** Output only. Number of tuning steps for this Tuning Job. */
|
|
4130
|
+
tuningStepCount?: string;
|
|
4131
|
+
/** Output only. Sample user messages in the training dataset uri. */
|
|
4132
|
+
userDatasetExamples?: Content[];
|
|
4133
|
+
/** Output only. Dataset distributions for the user input tokens. */
|
|
4134
|
+
userInputTokenDistribution?: SupervisedTuningDatasetDistribution;
|
|
4135
|
+
/** Output only. Dataset distributions for the messages per example. */
|
|
4136
|
+
userMessagePerExampleDistribution?: SupervisedTuningDatasetDistribution;
|
|
4137
|
+
/** Output only. Dataset distributions for the user output tokens. */
|
|
4138
|
+
userOutputTokenDistribution?: SupervisedTuningDatasetDistribution;
|
|
4139
|
+
}
|
|
4140
|
+
|
|
4141
|
+
/** Tuning Spec for Supervised Tuning for first party models. */
|
|
4142
|
+
export declare interface SupervisedTuningSpec {
|
|
4143
|
+
/** Optional. Hyperparameters for SFT. */
|
|
4144
|
+
hyperParameters?: SupervisedHyperParameters;
|
|
4145
|
+
/** Required. Cloud Storage path to file containing training dataset for tuning. The dataset must be formatted as a JSONL file. */
|
|
4146
|
+
trainingDatasetUri?: string;
|
|
4147
|
+
/** Optional. Cloud Storage path to file containing validation dataset for tuning. The dataset must be formatted as a JSONL file. */
|
|
4148
|
+
validationDatasetUri?: string;
|
|
4149
|
+
}
|
|
4150
|
+
|
|
3786
4151
|
export declare interface TestTableFile {
|
|
3787
4152
|
comment?: string;
|
|
3788
4153
|
testMethod?: string;
|
|
@@ -3831,8 +4196,6 @@ export declare interface TokensInfo {
|
|
|
3831
4196
|
|
|
3832
4197
|
/** Tool details of a tool that the model may use to generate a response. */
|
|
3833
4198
|
export declare interface Tool {
|
|
3834
|
-
/** List of function declarations that the tool supports. */
|
|
3835
|
-
functionDeclarations?: FunctionDeclaration[];
|
|
3836
4199
|
/** 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. */
|
|
3837
4200
|
retrieval?: Retrieval;
|
|
3838
4201
|
/** Optional. Google Search tool type. Specialized retrieval tool
|
|
@@ -3842,6 +4205,8 @@ export declare interface Tool {
|
|
|
3842
4205
|
googleSearchRetrieval?: GoogleSearchRetrieval;
|
|
3843
4206
|
/** 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. */
|
|
3844
4207
|
codeExecution?: ToolCodeExecution;
|
|
4208
|
+
/** 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. */
|
|
4209
|
+
functionDeclarations?: FunctionDeclaration[];
|
|
3845
4210
|
}
|
|
3846
4211
|
|
|
3847
4212
|
/** 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. */
|
|
@@ -3876,6 +4241,13 @@ export declare interface Transcription {
|
|
|
3876
4241
|
finished?: boolean;
|
|
3877
4242
|
}
|
|
3878
4243
|
|
|
4244
|
+
export declare interface TunedModel {
|
|
4245
|
+
/** Output only. The resource name of the TunedModel. Format: `projects/{project}/locations/{location}/models/{model}`. */
|
|
4246
|
+
model?: string;
|
|
4247
|
+
/** Output only. A resource name of an Endpoint. Format: `projects/{project}/locations/{location}/endpoints/{endpoint}`. */
|
|
4248
|
+
endpoint?: string;
|
|
4249
|
+
}
|
|
4250
|
+
|
|
3879
4251
|
/** A tuned machine learning model. */
|
|
3880
4252
|
export declare interface TunedModelInfo {
|
|
3881
4253
|
/** ID of the base model that you want to tune. */
|
|
@@ -3886,6 +4258,115 @@ export declare interface TunedModelInfo {
|
|
|
3886
4258
|
updateTime?: string;
|
|
3887
4259
|
}
|
|
3888
4260
|
|
|
4261
|
+
/** Supervised fine-tuning training dataset. */
|
|
4262
|
+
export declare interface TuningDataset {
|
|
4263
|
+
/** GCS URI of the file containing training dataset in JSONL format. */
|
|
4264
|
+
gcsUri?: string;
|
|
4265
|
+
/** Inline examples with simple input/output text. */
|
|
4266
|
+
examples?: TuningExample[];
|
|
4267
|
+
}
|
|
4268
|
+
|
|
4269
|
+
/** The tuning data statistic values for TuningJob. */
|
|
4270
|
+
export declare interface TuningDataStats {
|
|
4271
|
+
/** Output only. Statistics for distillation. */
|
|
4272
|
+
distillationDataStats?: DistillationDataStats;
|
|
4273
|
+
/** The SFT Tuning data stats. */
|
|
4274
|
+
supervisedTuningDataStats?: SupervisedTuningDataStats;
|
|
4275
|
+
}
|
|
4276
|
+
|
|
4277
|
+
export declare interface TuningExample {
|
|
4278
|
+
/** Text model input. */
|
|
4279
|
+
textInput?: string;
|
|
4280
|
+
/** The expected model output. */
|
|
4281
|
+
output?: string;
|
|
4282
|
+
}
|
|
4283
|
+
|
|
4284
|
+
/** A tuning job. */
|
|
4285
|
+
export declare interface TuningJob {
|
|
4286
|
+
/** Output only. Identifier. Resource name of a TuningJob. Format: `projects/{project}/locations/{location}/tuningJobs/{tuning_job}` */
|
|
4287
|
+
name?: string;
|
|
4288
|
+
/** Output only. The detailed state of the job. */
|
|
4289
|
+
state?: JobState;
|
|
4290
|
+
/** Output only. Time when the TuningJob was created. */
|
|
4291
|
+
createTime?: string;
|
|
4292
|
+
/** Output only. Time when the TuningJob for the first time entered the `JOB_STATE_RUNNING` state. */
|
|
4293
|
+
startTime?: string;
|
|
4294
|
+
/** Output only. Time when the TuningJob entered any of the following JobStates: `JOB_STATE_SUCCEEDED`, `JOB_STATE_FAILED`, `JOB_STATE_CANCELLED`, `JOB_STATE_EXPIRED`. */
|
|
4295
|
+
endTime?: string;
|
|
4296
|
+
/** Output only. Time when the TuningJob was most recently updated. */
|
|
4297
|
+
updateTime?: string;
|
|
4298
|
+
/** Output only. Only populated when job's state is `JOB_STATE_FAILED` or `JOB_STATE_CANCELLED`. */
|
|
4299
|
+
error?: GoogleRpcStatus;
|
|
4300
|
+
/** Optional. The description of the TuningJob. */
|
|
4301
|
+
description?: string;
|
|
4302
|
+
/** The base model that is being tuned, e.g., "gemini-1.0-pro-002". . */
|
|
4303
|
+
baseModel?: string;
|
|
4304
|
+
/** Output only. The tuned model resources associated with this TuningJob. */
|
|
4305
|
+
tunedModel?: TunedModel;
|
|
4306
|
+
/** Tuning Spec for Supervised Fine Tuning. */
|
|
4307
|
+
supervisedTuningSpec?: SupervisedTuningSpec;
|
|
4308
|
+
/** Output only. The tuning data statistics associated with this TuningJob. */
|
|
4309
|
+
tuningDataStats?: TuningDataStats;
|
|
4310
|
+
/** 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. */
|
|
4311
|
+
encryptionSpec?: EncryptionSpec;
|
|
4312
|
+
/** Tuning Spec for open sourced and third party Partner models. */
|
|
4313
|
+
partnerModelTuningSpec?: PartnerModelTuningSpec;
|
|
4314
|
+
/** Tuning Spec for Distillation. */
|
|
4315
|
+
distillationSpec?: DistillationSpec;
|
|
4316
|
+
/** Output only. The Experiment associated with this TuningJob. */
|
|
4317
|
+
experiment?: string;
|
|
4318
|
+
/** 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. */
|
|
4319
|
+
labels?: Record<string, string>;
|
|
4320
|
+
/** Output only. The resource name of the PipelineJob associated with the TuningJob. Format: `projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}`. */
|
|
4321
|
+
pipelineJob?: string;
|
|
4322
|
+
/** Optional. The display name of the TunedModel. The name can be up to 128 characters long and can consist of any UTF-8 characters. */
|
|
4323
|
+
tunedModelDisplayName?: string;
|
|
4324
|
+
}
|
|
4325
|
+
|
|
4326
|
+
declare class Tunings extends BaseModule {
|
|
4327
|
+
private readonly apiClient;
|
|
4328
|
+
constructor(apiClient: ApiClient);
|
|
4329
|
+
/**
|
|
4330
|
+
* Gets a TuningJob.
|
|
4331
|
+
*
|
|
4332
|
+
* @param name - The resource name of the tuning job.
|
|
4333
|
+
* @return - A TuningJob object.
|
|
4334
|
+
*
|
|
4335
|
+
* @experimental - The SDK's tuning implementation is experimental, and may
|
|
4336
|
+
* change in future versions.
|
|
4337
|
+
*/
|
|
4338
|
+
get: (params: types.GetTuningJobParameters) => Promise<types.TuningJob>;
|
|
4339
|
+
/**
|
|
4340
|
+
* Lists tuning jobs.
|
|
4341
|
+
*
|
|
4342
|
+
* @param config - The configuration for the list request.
|
|
4343
|
+
* @return - A list of tuning jobs.
|
|
4344
|
+
*
|
|
4345
|
+
* @experimental - The SDK's tuning implementation is experimental, and may
|
|
4346
|
+
* change in future versions.
|
|
4347
|
+
*/
|
|
4348
|
+
list: (params?: types.ListTuningJobsParameters) => Promise<Pager<types.TuningJob>>;
|
|
4349
|
+
/**
|
|
4350
|
+
* Creates a supervised fine-tuning job.
|
|
4351
|
+
*
|
|
4352
|
+
* @param params - The parameters for the tuning job.
|
|
4353
|
+
* @return - A TuningJob operation.
|
|
4354
|
+
*
|
|
4355
|
+
* @experimental - The SDK's tuning implementation is experimental, and may
|
|
4356
|
+
* change in future versions.
|
|
4357
|
+
*/
|
|
4358
|
+
tune: (params: types.CreateTuningJobParameters) => Promise<types.TuningJob>;
|
|
4359
|
+
private getInternal;
|
|
4360
|
+
private listInternal;
|
|
4361
|
+
private tuneInternal;
|
|
4362
|
+
private tuneMldevInternal;
|
|
4363
|
+
}
|
|
4364
|
+
|
|
4365
|
+
export declare interface TuningValidationDataset {
|
|
4366
|
+
/** GCS URI of the file containing validation dataset in JSONL format. */
|
|
4367
|
+
gcsUri?: string;
|
|
4368
|
+
}
|
|
4369
|
+
|
|
3889
4370
|
/** Options about which input is included in the user's turn. */
|
|
3890
4371
|
export declare enum TurnCoverage {
|
|
3891
4372
|
TURN_COVERAGE_UNSPECIFIED = "TURN_COVERAGE_UNSPECIFIED",
|
|
@@ -3917,11 +4398,11 @@ declare namespace types {
|
|
|
3917
4398
|
createModelContent,
|
|
3918
4399
|
Outcome,
|
|
3919
4400
|
Language,
|
|
3920
|
-
Type,
|
|
3921
4401
|
HarmCategory,
|
|
3922
4402
|
HarmBlockMethod,
|
|
3923
4403
|
HarmBlockThreshold,
|
|
3924
4404
|
Mode,
|
|
4405
|
+
Type,
|
|
3925
4406
|
FinishReason,
|
|
3926
4407
|
HarmProbability,
|
|
3927
4408
|
HarmSeverity,
|
|
@@ -3929,6 +4410,8 @@ declare namespace types {
|
|
|
3929
4410
|
TrafficType,
|
|
3930
4411
|
Modality,
|
|
3931
4412
|
MediaResolution,
|
|
4413
|
+
JobState,
|
|
4414
|
+
AdapterSize,
|
|
3932
4415
|
FeatureSelectionPreference,
|
|
3933
4416
|
DynamicRetrievalConfigMode,
|
|
3934
4417
|
FunctionCallingConfigMode,
|
|
@@ -3955,10 +4438,8 @@ declare namespace types {
|
|
|
3955
4438
|
Part,
|
|
3956
4439
|
Content,
|
|
3957
4440
|
HttpOptions,
|
|
3958
|
-
Schema,
|
|
3959
4441
|
ModelSelectionConfig,
|
|
3960
4442
|
SafetySetting,
|
|
3961
|
-
FunctionDeclaration,
|
|
3962
4443
|
GoogleSearch,
|
|
3963
4444
|
DynamicRetrievalConfig,
|
|
3964
4445
|
GoogleSearchRetrieval,
|
|
@@ -3973,6 +4454,8 @@ declare namespace types {
|
|
|
3973
4454
|
VertexRagStore,
|
|
3974
4455
|
Retrieval,
|
|
3975
4456
|
ToolCodeExecution,
|
|
4457
|
+
Schema,
|
|
4458
|
+
FunctionDeclaration,
|
|
3976
4459
|
Tool,
|
|
3977
4460
|
FunctionCallingConfig,
|
|
3978
4461
|
ToolConfig,
|
|
@@ -4022,6 +4505,11 @@ declare namespace types {
|
|
|
4022
4505
|
Endpoint,
|
|
4023
4506
|
TunedModelInfo,
|
|
4024
4507
|
Model,
|
|
4508
|
+
UpdateModelConfig,
|
|
4509
|
+
UpdateModelParameters,
|
|
4510
|
+
DeleteModelConfig,
|
|
4511
|
+
DeleteModelParameters,
|
|
4512
|
+
DeleteModelResponse,
|
|
4025
4513
|
GenerationConfig,
|
|
4026
4514
|
CountTokensConfig,
|
|
4027
4515
|
CountTokensParameters,
|
|
@@ -4036,6 +4524,34 @@ declare namespace types {
|
|
|
4036
4524
|
GeneratedVideo,
|
|
4037
4525
|
GenerateVideosResponse,
|
|
4038
4526
|
GenerateVideosOperation,
|
|
4527
|
+
GetTuningJobConfig,
|
|
4528
|
+
GetTuningJobParameters,
|
|
4529
|
+
TunedModel,
|
|
4530
|
+
GoogleRpcStatus,
|
|
4531
|
+
SupervisedHyperParameters,
|
|
4532
|
+
SupervisedTuningSpec,
|
|
4533
|
+
DatasetDistributionDistributionBucket,
|
|
4534
|
+
DatasetDistribution,
|
|
4535
|
+
DatasetStats,
|
|
4536
|
+
DistillationDataStats,
|
|
4537
|
+
SupervisedTuningDatasetDistributionDatasetBucket,
|
|
4538
|
+
SupervisedTuningDatasetDistribution,
|
|
4539
|
+
SupervisedTuningDataStats,
|
|
4540
|
+
TuningDataStats,
|
|
4541
|
+
EncryptionSpec,
|
|
4542
|
+
PartnerModelTuningSpec,
|
|
4543
|
+
DistillationHyperParameters,
|
|
4544
|
+
DistillationSpec,
|
|
4545
|
+
TuningJob,
|
|
4546
|
+
ListTuningJobsConfig,
|
|
4547
|
+
ListTuningJobsParameters,
|
|
4548
|
+
ListTuningJobsResponse,
|
|
4549
|
+
TuningExample,
|
|
4550
|
+
TuningDataset,
|
|
4551
|
+
TuningValidationDataset,
|
|
4552
|
+
CreateTuningJobConfig,
|
|
4553
|
+
CreateTuningJobParameters,
|
|
4554
|
+
Operation,
|
|
4039
4555
|
CreateCachedContentConfig,
|
|
4040
4556
|
CreateCachedContentParameters,
|
|
4041
4557
|
CachedContentUsageMetadata,
|
|
@@ -4156,6 +4672,27 @@ export declare interface UpdateCachedContentParameters {
|
|
|
4156
4672
|
config?: UpdateCachedContentConfig;
|
|
4157
4673
|
}
|
|
4158
4674
|
|
|
4675
|
+
/** Configuration for updating a tuned model. */
|
|
4676
|
+
export declare interface UpdateModelConfig {
|
|
4677
|
+
/** Used to override HTTP request options. */
|
|
4678
|
+
httpOptions?: HttpOptions;
|
|
4679
|
+
/** Abort signal which can be used to cancel the request.
|
|
4680
|
+
|
|
4681
|
+
NOTE: AbortSignal is a client-only operation. Using it to cancel an
|
|
4682
|
+
operation will not cancel the request in the service. You will still
|
|
4683
|
+
be charged usage for any applicable operations.
|
|
4684
|
+
*/
|
|
4685
|
+
abortSignal?: AbortSignal;
|
|
4686
|
+
displayName?: string;
|
|
4687
|
+
description?: string;
|
|
4688
|
+
}
|
|
4689
|
+
|
|
4690
|
+
/** Configuration for updating a tuned model. */
|
|
4691
|
+
export declare interface UpdateModelParameters {
|
|
4692
|
+
model: string;
|
|
4693
|
+
config?: UpdateModelConfig;
|
|
4694
|
+
}
|
|
4695
|
+
|
|
4159
4696
|
declare interface Uploader {
|
|
4160
4697
|
/**
|
|
4161
4698
|
* Uploads a file to the given upload url.
|