@google/genai 1.28.0 → 1.29.1
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 +4 -4
- package/dist/genai.d.ts +769 -47
- package/dist/index.cjs +1281 -165
- package/dist/index.mjs +1275 -166
- package/dist/index.mjs.map +1 -1
- package/dist/node/index.cjs +1429 -292
- package/dist/node/index.mjs +1422 -293
- package/dist/node/index.mjs.map +1 -1
- package/dist/node/node.d.ts +769 -47
- package/dist/web/index.mjs +1306 -199
- package/dist/web/index.mjs.map +1 -1
- package/dist/web/web.d.ts +769 -47
- package/package.json +11 -6
package/dist/node/node.d.ts
CHANGED
|
@@ -124,6 +124,7 @@ declare class ApiClient {
|
|
|
124
124
|
private apiCall;
|
|
125
125
|
getDefaultHeaders(): Record<string, string>;
|
|
126
126
|
private getHeadersInternal;
|
|
127
|
+
private getFileName;
|
|
127
128
|
/**
|
|
128
129
|
* Uploads a file asynchronously using Gemini API only, this is not supported
|
|
129
130
|
* in Vertex AI.
|
|
@@ -136,6 +137,19 @@ declare class ApiClient {
|
|
|
136
137
|
* @throws An error if the `mimeType` is not provided and can not be inferred,
|
|
137
138
|
*/
|
|
138
139
|
uploadFile(file: string | Blob, config?: types.UploadFileConfig): Promise<types.File>;
|
|
140
|
+
/**
|
|
141
|
+
* Uploads a file to a given file search store asynchronously using Gemini API only, this is not supported
|
|
142
|
+
* in Vertex AI.
|
|
143
|
+
*
|
|
144
|
+
* @param fileSearchStoreName The name of the file search store to upload the file to.
|
|
145
|
+
* @param file The string path to the file to be uploaded or a Blob object.
|
|
146
|
+
* @param config Optional parameters specified in the `UploadFileConfig`
|
|
147
|
+
* interface. @see {@link UploadFileConfig}
|
|
148
|
+
* @return A promise that resolves to a `File` object.
|
|
149
|
+
* @throws An error if called on a Vertex AI client.
|
|
150
|
+
* @throws An error if the `mimeType` is not provided and can not be inferred,
|
|
151
|
+
*/
|
|
152
|
+
uploadFileToFileSearchStore(fileSearchStoreName: string, file: string | Blob, config?: types.UploadToFileSearchStoreConfig): Promise<types.UploadToFileSearchStoreOperation>;
|
|
139
153
|
/**
|
|
140
154
|
* Downloads a file asynchronously to the specified path.
|
|
141
155
|
*
|
|
@@ -228,10 +242,16 @@ export declare interface ApiErrorInfo {
|
|
|
228
242
|
status: number;
|
|
229
243
|
}
|
|
230
244
|
|
|
231
|
-
/** Config for authentication with API key. */
|
|
245
|
+
/** Config for authentication with API key. This data type is not supported in Gemini API. */
|
|
232
246
|
export declare interface ApiKeyConfig {
|
|
233
|
-
/** The API key
|
|
247
|
+
/** Optional. The name of the SecretManager secret version resource storing the API key. Format: `projects/{project}/secrets/{secrete}/versions/{version}` - If both `api_key_secret` and `api_key_string` are specified, this field takes precedence over `api_key_string`. - If specified, the `secretmanager.versions.access` permission should be granted to Vertex AI Extension Service Agent (https://cloud.google.com/vertex-ai/docs/general/access-control#service-agents) on the specified resource. */
|
|
248
|
+
apiKeySecret?: string;
|
|
249
|
+
/** Optional. The API key to be used in the request directly. */
|
|
234
250
|
apiKeyString?: string;
|
|
251
|
+
/** Optional. The location of the API key. */
|
|
252
|
+
httpElementLocation?: HttpElementLocation;
|
|
253
|
+
/** Optional. The parameter name of the API key. E.g. If the API request is "https://example.com/act?api_key=", "api_key" would be the parameter name. */
|
|
254
|
+
name?: string;
|
|
235
255
|
}
|
|
236
256
|
|
|
237
257
|
/** The API spec that the external API implements. This enum is not supported in Gemini API. */
|
|
@@ -283,7 +303,7 @@ declare interface Auth {
|
|
|
283
303
|
addAuthHeaders(headers: Headers, url?: string): Promise<void>;
|
|
284
304
|
}
|
|
285
305
|
|
|
286
|
-
/** Auth configuration to run the extension. */
|
|
306
|
+
/** Auth configuration to run the extension. This data type is not supported in Gemini API. */
|
|
287
307
|
export declare interface AuthConfig {
|
|
288
308
|
/** Config for API key auth. */
|
|
289
309
|
apiKeyConfig?: ApiKeyConfig;
|
|
@@ -544,7 +564,7 @@ export declare interface BatchJob {
|
|
|
544
564
|
createTime?: string;
|
|
545
565
|
/** Output only. Time when the Job for the first time entered the `JOB_STATE_RUNNING` state. */
|
|
546
566
|
startTime?: string;
|
|
547
|
-
/** The time when the BatchJob was completed.
|
|
567
|
+
/** The time when the BatchJob was completed. This field is for Vertex AI only.
|
|
548
568
|
*/
|
|
549
569
|
endTime?: string;
|
|
550
570
|
/** The time when the BatchJob was last updated.
|
|
@@ -553,12 +573,15 @@ export declare interface BatchJob {
|
|
|
553
573
|
/** The name of the model that produces the predictions via the BatchJob.
|
|
554
574
|
*/
|
|
555
575
|
model?: string;
|
|
556
|
-
/** Configuration for the input data.
|
|
576
|
+
/** Configuration for the input data. This field is for Vertex AI only.
|
|
557
577
|
*/
|
|
558
578
|
src?: BatchJobSource;
|
|
559
579
|
/** Configuration for the output data.
|
|
560
580
|
*/
|
|
561
581
|
dest?: BatchJobDestination;
|
|
582
|
+
/** Statistics on completed and failed prediction instances. This field is for Vertex AI only.
|
|
583
|
+
*/
|
|
584
|
+
completionStats?: CompletionStats;
|
|
562
585
|
}
|
|
563
586
|
|
|
564
587
|
/** Config for `des` parameter. */
|
|
@@ -1042,6 +1065,12 @@ export declare interface Checkpoint {
|
|
|
1042
1065
|
step?: string;
|
|
1043
1066
|
}
|
|
1044
1067
|
|
|
1068
|
+
/** Config for telling the service how to chunk the file. */
|
|
1069
|
+
export declare interface ChunkingConfig {
|
|
1070
|
+
/** White space chunking configuration. */
|
|
1071
|
+
whiteSpaceConfig?: WhiteSpaceConfig;
|
|
1072
|
+
}
|
|
1073
|
+
|
|
1045
1074
|
/** Source attributions for content. This data type is not supported in Gemini API. */
|
|
1046
1075
|
export declare interface Citation {
|
|
1047
1076
|
/** Output only. End index into the content. */
|
|
@@ -1075,6 +1104,18 @@ export declare interface CodeExecutionResult {
|
|
|
1075
1104
|
output?: string;
|
|
1076
1105
|
}
|
|
1077
1106
|
|
|
1107
|
+
/** Success and error statistics of processing multiple entities (for example, DataItems or structured data rows) in batch. This data type is not supported in Gemini API. */
|
|
1108
|
+
export declare interface CompletionStats {
|
|
1109
|
+
/** Output only. The number of entities for which any error was encountered. */
|
|
1110
|
+
failedCount?: string;
|
|
1111
|
+
/** Output only. In cases when enough errors are encountered a job, pipeline, or operation may be failed as a whole. Below is the number of entities for which the processing had not been finished (either in successful or failed state). Set to -1 if the number is unknown (for example, the operation failed before the total entity number could be collected). */
|
|
1112
|
+
incompleteCount?: string;
|
|
1113
|
+
/** Output only. The number of entities that had been processed successfully. */
|
|
1114
|
+
successfulCount?: string;
|
|
1115
|
+
/** Output only. The number of the successful forecast points that are generated by the forecasting model. This is ONLY used by the forecasting batch prediction. */
|
|
1116
|
+
successfulForecastPointCount?: string;
|
|
1117
|
+
}
|
|
1118
|
+
|
|
1078
1119
|
/** Tool to support computer use. */
|
|
1079
1120
|
export declare interface ComputerUse {
|
|
1080
1121
|
/** Required. The environment being operated. */
|
|
@@ -1476,6 +1517,29 @@ export declare class CreateFileResponse {
|
|
|
1476
1517
|
sdkHttpResponse?: HttpResponse;
|
|
1477
1518
|
}
|
|
1478
1519
|
|
|
1520
|
+
/** Optional parameters for creating a file search store. */
|
|
1521
|
+
export declare interface CreateFileSearchStoreConfig {
|
|
1522
|
+
/** Used to override HTTP request options. */
|
|
1523
|
+
httpOptions?: HttpOptions;
|
|
1524
|
+
/** Abort signal which can be used to cancel the request.
|
|
1525
|
+
|
|
1526
|
+
NOTE: AbortSignal is a client-only operation. Using it to cancel an
|
|
1527
|
+
operation will not cancel the request in the service. You will still
|
|
1528
|
+
be charged usage for any applicable operations.
|
|
1529
|
+
*/
|
|
1530
|
+
abortSignal?: AbortSignal;
|
|
1531
|
+
/** The human-readable display name for the file search store.
|
|
1532
|
+
*/
|
|
1533
|
+
displayName?: string;
|
|
1534
|
+
}
|
|
1535
|
+
|
|
1536
|
+
/** Config for file_search_stores.create parameters. */
|
|
1537
|
+
export declare interface CreateFileSearchStoreParameters {
|
|
1538
|
+
/** Optional parameters for creating a file search store.
|
|
1539
|
+
*/
|
|
1540
|
+
config?: CreateFileSearchStoreConfig;
|
|
1541
|
+
}
|
|
1542
|
+
|
|
1479
1543
|
/**
|
|
1480
1544
|
* Creates a `FunctionResponsePart` object from a `base64` encoded `string`.
|
|
1481
1545
|
*/
|
|
@@ -1592,6 +1656,18 @@ export declare interface CreateTuningJobParametersPrivate {
|
|
|
1592
1656
|
*/
|
|
1593
1657
|
export declare function createUserContent(partOrString: PartListUnion | string): Content;
|
|
1594
1658
|
|
|
1659
|
+
/** User provided metadata stored as key-value pairs. This data type is not supported in Vertex AI. */
|
|
1660
|
+
export declare interface CustomMetadata {
|
|
1661
|
+
/** Required. The key of the metadata to store. */
|
|
1662
|
+
key?: string;
|
|
1663
|
+
/** The numeric value of the metadata to store. */
|
|
1664
|
+
numericValue?: number;
|
|
1665
|
+
/** The StringList value of the metadata to store. */
|
|
1666
|
+
stringListValue?: StringList;
|
|
1667
|
+
/** The string value of the metadata to store. */
|
|
1668
|
+
stringValue?: string;
|
|
1669
|
+
}
|
|
1670
|
+
|
|
1595
1671
|
/** Distribution computed over a tuning dataset. This data type is not supported in Gemini API. */
|
|
1596
1672
|
export declare interface DatasetDistribution {
|
|
1597
1673
|
/** Output only. Defines the histogram bucket. */
|
|
@@ -1695,6 +1771,32 @@ export declare class DeleteCachedContentResponse {
|
|
|
1695
1771
|
sdkHttpResponse?: HttpResponse;
|
|
1696
1772
|
}
|
|
1697
1773
|
|
|
1774
|
+
/** Config for optional parameters. */
|
|
1775
|
+
export declare interface DeleteDocumentConfig {
|
|
1776
|
+
/** Used to override HTTP request options. */
|
|
1777
|
+
httpOptions?: HttpOptions;
|
|
1778
|
+
/** Abort signal which can be used to cancel the request.
|
|
1779
|
+
|
|
1780
|
+
NOTE: AbortSignal is a client-only operation. Using it to cancel an
|
|
1781
|
+
operation will not cancel the request in the service. You will still
|
|
1782
|
+
be charged usage for any applicable operations.
|
|
1783
|
+
*/
|
|
1784
|
+
abortSignal?: AbortSignal;
|
|
1785
|
+
/** If set to true, any `Chunk`s and objects related to this `Document` will
|
|
1786
|
+
also be deleted.
|
|
1787
|
+
*/
|
|
1788
|
+
force?: boolean;
|
|
1789
|
+
}
|
|
1790
|
+
|
|
1791
|
+
/** Config for documents.delete parameters. */
|
|
1792
|
+
export declare interface DeleteDocumentParameters {
|
|
1793
|
+
/** The resource name of the Document.
|
|
1794
|
+
Example: fileSearchStores/file-search-store-foo/documents/documents-bar */
|
|
1795
|
+
name: string;
|
|
1796
|
+
/** Optional parameters for the request. */
|
|
1797
|
+
config?: DeleteDocumentConfig;
|
|
1798
|
+
}
|
|
1799
|
+
|
|
1698
1800
|
/** Used to override the default configuration. */
|
|
1699
1801
|
export declare interface DeleteFileConfig {
|
|
1700
1802
|
/** Used to override HTTP request options. */
|
|
@@ -1722,6 +1824,32 @@ export declare class DeleteFileResponse {
|
|
|
1722
1824
|
sdkHttpResponse?: HttpResponse;
|
|
1723
1825
|
}
|
|
1724
1826
|
|
|
1827
|
+
/** Optional parameters for deleting a FileSearchStore. */
|
|
1828
|
+
export declare interface DeleteFileSearchStoreConfig {
|
|
1829
|
+
/** Used to override HTTP request options. */
|
|
1830
|
+
httpOptions?: HttpOptions;
|
|
1831
|
+
/** Abort signal which can be used to cancel the request.
|
|
1832
|
+
|
|
1833
|
+
NOTE: AbortSignal is a client-only operation. Using it to cancel an
|
|
1834
|
+
operation will not cancel the request in the service. You will still
|
|
1835
|
+
be charged usage for any applicable operations.
|
|
1836
|
+
*/
|
|
1837
|
+
abortSignal?: AbortSignal;
|
|
1838
|
+
/** If set to true, any Documents and objects related to this FileSearchStore will also be deleted.
|
|
1839
|
+
If false (the default), a FAILED_PRECONDITION error will be returned if
|
|
1840
|
+
the FileSearchStore contains any Documents.
|
|
1841
|
+
*/
|
|
1842
|
+
force?: boolean;
|
|
1843
|
+
}
|
|
1844
|
+
|
|
1845
|
+
/** Config for file_search_stores.delete parameters. */
|
|
1846
|
+
export declare interface DeleteFileSearchStoreParameters {
|
|
1847
|
+
/** The resource name of the FileSearchStore. Example: `fileSearchStores/my-file-search-store-123` */
|
|
1848
|
+
name: string;
|
|
1849
|
+
/** Optional parameters for the request. */
|
|
1850
|
+
config?: DeleteFileSearchStoreConfig;
|
|
1851
|
+
}
|
|
1852
|
+
|
|
1725
1853
|
/** Configuration for deleting a tuned model. */
|
|
1726
1854
|
export declare interface DeleteModelConfig {
|
|
1727
1855
|
/** Used to override HTTP request options. */
|
|
@@ -1762,6 +1890,76 @@ export declare interface DistillationDataStats {
|
|
|
1762
1890
|
trainingDatasetStats?: DatasetStats;
|
|
1763
1891
|
}
|
|
1764
1892
|
|
|
1893
|
+
/** A Document is a collection of Chunks. */
|
|
1894
|
+
declare interface Document_2 {
|
|
1895
|
+
/** The resource name of the Document.
|
|
1896
|
+
Example: fileSearchStores/file-search-store-foo/documents/documents-bar */
|
|
1897
|
+
name?: string;
|
|
1898
|
+
/** The human-readable display name for the Document. */
|
|
1899
|
+
displayName?: string;
|
|
1900
|
+
/** The current state of the Document. */
|
|
1901
|
+
state?: DocumentState;
|
|
1902
|
+
/** The size of the Document in bytes. */
|
|
1903
|
+
sizeBytes?: string;
|
|
1904
|
+
/** The MIME type of the Document. */
|
|
1905
|
+
mimeType?: string;
|
|
1906
|
+
/** Output only. The Timestamp of when the `Document` was created. */
|
|
1907
|
+
createTime?: string;
|
|
1908
|
+
/** Optional. User provided custom metadata stored as key-value pairs used for querying. A `Document` can have a maximum of 20 `CustomMetadata`. */
|
|
1909
|
+
customMetadata?: CustomMetadata[];
|
|
1910
|
+
/** Output only. The Timestamp of when the `Document` was last updated. */
|
|
1911
|
+
updateTime?: string;
|
|
1912
|
+
}
|
|
1913
|
+
export { Document_2 as Document }
|
|
1914
|
+
|
|
1915
|
+
declare class Documents extends BaseModule {
|
|
1916
|
+
private readonly apiClient;
|
|
1917
|
+
constructor(apiClient: ApiClient);
|
|
1918
|
+
/**
|
|
1919
|
+
* Lists documents.
|
|
1920
|
+
*
|
|
1921
|
+
* @param params - The parameters for the list request.
|
|
1922
|
+
* @return - A pager of documents.
|
|
1923
|
+
*
|
|
1924
|
+
* @example
|
|
1925
|
+
* ```ts
|
|
1926
|
+
* const documents = await ai.documents.list({config: {'pageSize': 2}});
|
|
1927
|
+
* for await (const document of documents) {
|
|
1928
|
+
* console.log(document);
|
|
1929
|
+
* }
|
|
1930
|
+
* ```
|
|
1931
|
+
*/
|
|
1932
|
+
list: (params: types.ListDocumentsParameters) => Promise<Pager<types.Document>>;
|
|
1933
|
+
/**
|
|
1934
|
+
* Gets a Document.
|
|
1935
|
+
*
|
|
1936
|
+
* @param params - The parameters for getting a document.
|
|
1937
|
+
* @return Document.
|
|
1938
|
+
*/
|
|
1939
|
+
get(params: types.GetDocumentParameters): Promise<types.Document>;
|
|
1940
|
+
/**
|
|
1941
|
+
* Deletes a Document.
|
|
1942
|
+
*
|
|
1943
|
+
* @param params - The parameters for deleting a document.
|
|
1944
|
+
*/
|
|
1945
|
+
delete(params: types.DeleteDocumentParameters): Promise<void>;
|
|
1946
|
+
/**
|
|
1947
|
+
* Lists all Documents in a FileSearchStore.
|
|
1948
|
+
*
|
|
1949
|
+
* @param params - The parameters for listing documents.
|
|
1950
|
+
* @return ListDocumentsResponse.
|
|
1951
|
+
*/
|
|
1952
|
+
private listInternal;
|
|
1953
|
+
}
|
|
1954
|
+
|
|
1955
|
+
/** State for the lifecycle of a Document. */
|
|
1956
|
+
export declare enum DocumentState {
|
|
1957
|
+
STATE_UNSPECIFIED = "STATE_UNSPECIFIED",
|
|
1958
|
+
STATE_PENDING = "STATE_PENDING",
|
|
1959
|
+
STATE_ACTIVE = "STATE_ACTIVE",
|
|
1960
|
+
STATE_FAILED = "STATE_FAILED"
|
|
1961
|
+
}
|
|
1962
|
+
|
|
1765
1963
|
export declare type DownloadableFileUnion = string | File_2 | GeneratedVideo | Video;
|
|
1766
1964
|
|
|
1767
1965
|
declare interface Downloader {
|
|
@@ -2027,6 +2225,8 @@ export declare enum EndSensitivity {
|
|
|
2027
2225
|
export declare interface EnterpriseWebSearch {
|
|
2028
2226
|
/** Optional. List of domains to be excluded from the search results. The default limit is 2000 domains. */
|
|
2029
2227
|
excludeDomains?: string[];
|
|
2228
|
+
/** Optional. Sites with confidence level chosen & above this value will be blocked from the search results. */
|
|
2229
|
+
blockingConfidence?: PhishBlockThreshold;
|
|
2030
2230
|
}
|
|
2031
2231
|
|
|
2032
2232
|
/** An entity representing the segmented area. */
|
|
@@ -2275,6 +2475,133 @@ export declare class Files extends BaseModule {
|
|
|
2275
2475
|
delete(params: types.DeleteFileParameters): Promise<types.DeleteFileResponse>;
|
|
2276
2476
|
}
|
|
2277
2477
|
|
|
2478
|
+
/** Tool to retrieve knowledge from the File Search Stores. */
|
|
2479
|
+
export declare interface FileSearch {
|
|
2480
|
+
/** The names of the file_search_stores to retrieve from.
|
|
2481
|
+
Example: `fileSearchStores/my-file-search-store-123` */
|
|
2482
|
+
fileSearchStoreNames?: string[];
|
|
2483
|
+
/** The number of file search retrieval chunks to retrieve. */
|
|
2484
|
+
topK?: number;
|
|
2485
|
+
/** Metadata filter to apply to the file search retrieval documents. See https://google.aip.dev/160 for the syntax of the filter expression. */
|
|
2486
|
+
metadataFilter?: string;
|
|
2487
|
+
}
|
|
2488
|
+
|
|
2489
|
+
/** A collection of Documents. */
|
|
2490
|
+
export declare interface FileSearchStore {
|
|
2491
|
+
/** The resource name of the FileSearchStore. Example: `fileSearchStores/my-file-search-store-123` */
|
|
2492
|
+
name?: string;
|
|
2493
|
+
/** The human-readable display name for the FileSearchStore. */
|
|
2494
|
+
displayName?: string;
|
|
2495
|
+
/** The Timestamp of when the FileSearchStore was created. */
|
|
2496
|
+
createTime?: string;
|
|
2497
|
+
/** The Timestamp of when the FileSearchStore was last updated. */
|
|
2498
|
+
updateTime?: string;
|
|
2499
|
+
/** The number of documents in the FileSearchStore that are active and ready for retrieval. */
|
|
2500
|
+
activeDocumentsCount?: string;
|
|
2501
|
+
/** The number of documents in the FileSearchStore that are being processed. */
|
|
2502
|
+
pendingDocumentsCount?: string;
|
|
2503
|
+
/** The number of documents in the FileSearchStore that have failed processing. */
|
|
2504
|
+
failedDocumentsCount?: string;
|
|
2505
|
+
/** The size of raw bytes ingested into the FileSearchStore. This is the
|
|
2506
|
+
total size of all the documents in the FileSearchStore. */
|
|
2507
|
+
sizeBytes?: string;
|
|
2508
|
+
}
|
|
2509
|
+
|
|
2510
|
+
declare class FileSearchStores extends BaseModule {
|
|
2511
|
+
private readonly apiClient;
|
|
2512
|
+
readonly documents: Documents;
|
|
2513
|
+
constructor(apiClient: ApiClient, documents?: Documents);
|
|
2514
|
+
/**
|
|
2515
|
+
* Uploads a file asynchronously to a given File Search Store.
|
|
2516
|
+
* This method is not available in Vertex AI.
|
|
2517
|
+
* Supported upload sources:
|
|
2518
|
+
* - Node.js: File path (string) or Blob object.
|
|
2519
|
+
* - Browser: Blob object (e.g., File).
|
|
2520
|
+
*
|
|
2521
|
+
* @remarks
|
|
2522
|
+
* The `mimeType` can be specified in the `config` parameter. If omitted:
|
|
2523
|
+
* - For file path (string) inputs, the `mimeType` will be inferred from the
|
|
2524
|
+
* file extension.
|
|
2525
|
+
* - For Blob object inputs, the `mimeType` will be set to the Blob's `type`
|
|
2526
|
+
* property.
|
|
2527
|
+
*
|
|
2528
|
+
* This section can contain multiple paragraphs and code examples.
|
|
2529
|
+
*
|
|
2530
|
+
* @param params - Optional parameters specified in the
|
|
2531
|
+
* `types.UploadToFileSearchStoreParameters` interface.
|
|
2532
|
+
* @see {@link types.UploadToFileSearchStoreParameters#config} for the optional
|
|
2533
|
+
* config in the parameters.
|
|
2534
|
+
* @return A promise that resolves to a long running operation.
|
|
2535
|
+
* @throws An error if called on a Vertex AI client.
|
|
2536
|
+
* @throws An error if the `mimeType` is not provided and can not be inferred,
|
|
2537
|
+
* the `mimeType` can be provided in the `params.config` parameter.
|
|
2538
|
+
* @throws An error occurs if a suitable upload location cannot be established.
|
|
2539
|
+
*
|
|
2540
|
+
* @example
|
|
2541
|
+
* The following code uploads a file to a given file search store.
|
|
2542
|
+
*
|
|
2543
|
+
* ```ts
|
|
2544
|
+
* const operation = await ai.fileSearchStores.upload({fileSearchStoreName: 'fileSearchStores/foo-bar', file: 'file.txt', config: {
|
|
2545
|
+
* mimeType: 'text/plain',
|
|
2546
|
+
* }});
|
|
2547
|
+
* console.log(operation.name);
|
|
2548
|
+
* ```
|
|
2549
|
+
*/
|
|
2550
|
+
uploadToFileSearchStore(params: types.UploadToFileSearchStoreParameters): Promise<types.UploadToFileSearchStoreOperation>;
|
|
2551
|
+
/**
|
|
2552
|
+
* Lists file search stores.
|
|
2553
|
+
*
|
|
2554
|
+
* @param params - The parameters for the list request.
|
|
2555
|
+
* @return - A pager of file search stores.
|
|
2556
|
+
*
|
|
2557
|
+
* @example
|
|
2558
|
+
* ```ts
|
|
2559
|
+
* const fileSearchStores = await ai.fileSearchStores.list({config: {'pageSize': 2}});
|
|
2560
|
+
* for await (const fileSearchStore of fileSearchStores) {
|
|
2561
|
+
* console.log(fileSearchStore);
|
|
2562
|
+
* }
|
|
2563
|
+
* ```
|
|
2564
|
+
*/
|
|
2565
|
+
list: (params?: types.ListFileSearchStoresParameters) => Promise<Pager<types.FileSearchStore>>;
|
|
2566
|
+
/**
|
|
2567
|
+
* Creates a File Search Store.
|
|
2568
|
+
*
|
|
2569
|
+
* @param params - The parameters for creating a File Search Store.
|
|
2570
|
+
* @return FileSearchStore.
|
|
2571
|
+
*/
|
|
2572
|
+
create(params: types.CreateFileSearchStoreParameters): Promise<types.FileSearchStore>;
|
|
2573
|
+
/**
|
|
2574
|
+
* Gets a File Search Store.
|
|
2575
|
+
*
|
|
2576
|
+
* @param params - The parameters for getting a File Search Store.
|
|
2577
|
+
* @return FileSearchStore.
|
|
2578
|
+
*/
|
|
2579
|
+
get(params: types.GetFileSearchStoreParameters): Promise<types.FileSearchStore>;
|
|
2580
|
+
/**
|
|
2581
|
+
* Deletes a File Search Store.
|
|
2582
|
+
*
|
|
2583
|
+
* @param params - The parameters for deleting a File Search Store.
|
|
2584
|
+
*/
|
|
2585
|
+
delete(params: types.DeleteFileSearchStoreParameters): Promise<void>;
|
|
2586
|
+
/**
|
|
2587
|
+
* Lists all FileSearchStore owned by the user.
|
|
2588
|
+
*
|
|
2589
|
+
* @param params - The parameters for listing file search stores.
|
|
2590
|
+
* @return ListFileSearchStoresResponse.
|
|
2591
|
+
*/
|
|
2592
|
+
private listInternal;
|
|
2593
|
+
private uploadToFileSearchStoreInternal;
|
|
2594
|
+
/**
|
|
2595
|
+
* Imports a File from File Service to a FileSearchStore.
|
|
2596
|
+
*
|
|
2597
|
+
* This is a long-running operation, see aip.dev/151
|
|
2598
|
+
*
|
|
2599
|
+
* @param params - The parameters for importing a file to a file search store.
|
|
2600
|
+
* @return ImportFileOperation.
|
|
2601
|
+
*/
|
|
2602
|
+
importFile(params: types.ImportFileParameters): Promise<types.ImportFileOperation>;
|
|
2603
|
+
}
|
|
2604
|
+
|
|
2278
2605
|
/** Source of the File. */
|
|
2279
2606
|
export declare enum FileSource {
|
|
2280
2607
|
SOURCE_UNSPECIFIED = "SOURCE_UNSPECIFIED",
|
|
@@ -2390,7 +2717,7 @@ export declare interface FunctionCall {
|
|
|
2390
2717
|
id?: string;
|
|
2391
2718
|
/** Optional. The function parameters and values in JSON object format. See [FunctionDeclaration.parameters] for parameter details. */
|
|
2392
2719
|
args?: Record<string, unknown>;
|
|
2393
|
-
/**
|
|
2720
|
+
/** Optional. The name of the function to call. Matches [FunctionDeclaration.name]. */
|
|
2394
2721
|
name?: string;
|
|
2395
2722
|
}
|
|
2396
2723
|
|
|
@@ -2860,29 +3187,29 @@ export declare class GenerateContentResponsePromptFeedback {
|
|
|
2860
3187
|
safetyRatings?: SafetyRating[];
|
|
2861
3188
|
}
|
|
2862
3189
|
|
|
2863
|
-
/** Usage metadata about response
|
|
3190
|
+
/** Usage metadata about the content generation request and response. This message provides a detailed breakdown of token usage and other relevant metrics. This data type is not supported in Gemini API. */
|
|
2864
3191
|
export declare class GenerateContentResponseUsageMetadata {
|
|
2865
|
-
/** Output only.
|
|
3192
|
+
/** Output only. A detailed breakdown of the token count for each modality in the cached content. */
|
|
2866
3193
|
cacheTokensDetails?: ModalityTokenCount[];
|
|
2867
|
-
/** Output only.
|
|
3194
|
+
/** Output only. The number of tokens in the cached content that was used for this request. */
|
|
2868
3195
|
cachedContentTokenCount?: number;
|
|
2869
|
-
/**
|
|
3196
|
+
/** The total number of tokens in the generated candidates. */
|
|
2870
3197
|
candidatesTokenCount?: number;
|
|
2871
|
-
/** Output only.
|
|
3198
|
+
/** Output only. A detailed breakdown of the token count for each modality in the generated candidates. */
|
|
2872
3199
|
candidatesTokensDetails?: ModalityTokenCount[];
|
|
2873
|
-
/**
|
|
3200
|
+
/** The total number of tokens in the prompt. This includes any text, images, or other media provided in the request. When `cached_content` is set, this also includes the number of tokens in the cached content. */
|
|
2874
3201
|
promptTokenCount?: number;
|
|
2875
|
-
/** Output only.
|
|
3202
|
+
/** Output only. A detailed breakdown of the token count for each modality in the prompt. */
|
|
2876
3203
|
promptTokensDetails?: ModalityTokenCount[];
|
|
2877
|
-
/** Output only.
|
|
3204
|
+
/** Output only. The number of tokens that were part of the model's generated "thoughts" output, if applicable. */
|
|
2878
3205
|
thoughtsTokenCount?: number;
|
|
2879
|
-
/** Output only.
|
|
3206
|
+
/** Output only. The number of tokens in the results from tool executions, which are provided back to the model as input, if applicable. */
|
|
2880
3207
|
toolUsePromptTokenCount?: number;
|
|
2881
|
-
/** Output only.
|
|
3208
|
+
/** Output only. A detailed breakdown by modality of the token counts from the results of tool executions, which are provided back to the model as input. */
|
|
2882
3209
|
toolUsePromptTokensDetails?: ModalityTokenCount[];
|
|
2883
|
-
/**
|
|
3210
|
+
/** The total number of tokens for the entire request. This is the sum of `prompt_token_count`, `candidates_token_count`, `tool_use_prompt_token_count`, and `thoughts_token_count`. */
|
|
2884
3211
|
totalTokenCount?: number;
|
|
2885
|
-
/** Output only.
|
|
3212
|
+
/** Output only. The traffic type for this request. */
|
|
2886
3213
|
trafficType?: TrafficType;
|
|
2887
3214
|
}
|
|
2888
3215
|
|
|
@@ -3068,7 +3395,7 @@ export declare class GenerateVideosOperation implements Operation<GenerateVideos
|
|
|
3068
3395
|
* Instantiates an Operation of the same type as the one being called with the fields set from the API response.
|
|
3069
3396
|
* @internal
|
|
3070
3397
|
*/
|
|
3071
|
-
_fromAPIResponse({ apiResponse,
|
|
3398
|
+
_fromAPIResponse({ apiResponse, _isVertexAI, }: OperationFromAPIResponseParameters): Operation<GenerateVideosResponse>;
|
|
3072
3399
|
/** The full HTTP response. */
|
|
3073
3400
|
sdkHttpResponse?: HttpResponse;
|
|
3074
3401
|
}
|
|
@@ -3120,6 +3447,10 @@ export declare interface GenerateVideosSource {
|
|
|
3120
3447
|
export declare interface GenerationConfig {
|
|
3121
3448
|
/** Optional. Config for model selection. */
|
|
3122
3449
|
modelSelectionConfig?: ModelSelectionConfig;
|
|
3450
|
+
/** Output schema of the generated response. This is an alternative to
|
|
3451
|
+
`response_schema` that accepts [JSON Schema](https://json-schema.org/).
|
|
3452
|
+
*/
|
|
3453
|
+
responseJsonSchema?: unknown;
|
|
3123
3454
|
/** Optional. If enabled, audio timestamp will be included in the request to the model. This field is not supported in Gemini API. */
|
|
3124
3455
|
audioTimestamp?: boolean;
|
|
3125
3456
|
/** Optional. Number of candidates to generate. */
|
|
@@ -3136,8 +3467,6 @@ export declare interface GenerationConfig {
|
|
|
3136
3467
|
mediaResolution?: MediaResolution;
|
|
3137
3468
|
/** Optional. Positive penalties. */
|
|
3138
3469
|
presencePenalty?: number;
|
|
3139
|
-
/** Optional. Output schema of the generated response. This is an alternative to `response_schema` that accepts [JSON Schema](https://json-schema.org/). If set, `response_schema` must be omitted, but `response_mime_type` is required. While the full JSON Schema may be sent, not all features are supported. Specifically, only the following properties are supported: - `$id` - `$defs` - `$ref` - `$anchor` - `type` - `format` - `title` - `description` - `enum` (for strings and numbers) - `items` - `prefixItems` - `minItems` - `maxItems` - `minimum` - `maximum` - `anyOf` - `oneOf` (interpreted the same as `anyOf`) - `properties` - `additionalProperties` - `required` The non-standard `propertyOrdering` property may also be set. Cyclic references are unrolled to a limited degree and, as such, may only be used within non-required properties. (Nullable properties are not sufficient.) If `$ref` is set on a sub-schema, no other properties, except for than those starting as a `$`, may be set. */
|
|
3140
|
-
responseJsonSchema?: unknown;
|
|
3141
3470
|
/** Optional. If true, export the logprobs results in response. */
|
|
3142
3471
|
responseLogprobs?: boolean;
|
|
3143
3472
|
/** Optional. Output response mimetype of the generated candidate text. Supported mimetype: - `text/plain`: (default) Text output. - `application/json`: JSON response in the candidates. The model needs to be prompted to output the appropriate response type, otherwise the behavior is undefined. This is a preview feature. */
|
|
@@ -3241,6 +3570,28 @@ export declare interface GetCachedContentParameters {
|
|
|
3241
3570
|
config?: GetCachedContentConfig;
|
|
3242
3571
|
}
|
|
3243
3572
|
|
|
3573
|
+
/** Optional Config. */
|
|
3574
|
+
export declare interface GetDocumentConfig {
|
|
3575
|
+
/** Used to override HTTP request options. */
|
|
3576
|
+
httpOptions?: HttpOptions;
|
|
3577
|
+
/** Abort signal which can be used to cancel the request.
|
|
3578
|
+
|
|
3579
|
+
NOTE: AbortSignal is a client-only operation. Using it to cancel an
|
|
3580
|
+
operation will not cancel the request in the service. You will still
|
|
3581
|
+
be charged usage for any applicable operations.
|
|
3582
|
+
*/
|
|
3583
|
+
abortSignal?: AbortSignal;
|
|
3584
|
+
}
|
|
3585
|
+
|
|
3586
|
+
/** Parameters for documents.get. */
|
|
3587
|
+
export declare interface GetDocumentParameters {
|
|
3588
|
+
/** The resource name of the Document.
|
|
3589
|
+
Example: fileSearchStores/file-search-store-foo/documents/documents-bar */
|
|
3590
|
+
name: string;
|
|
3591
|
+
/** Optional parameters for the request. */
|
|
3592
|
+
config?: GetDocumentConfig;
|
|
3593
|
+
}
|
|
3594
|
+
|
|
3244
3595
|
/** Used to override the default configuration. */
|
|
3245
3596
|
export declare interface GetFileConfig {
|
|
3246
3597
|
/** Used to override HTTP request options. */
|
|
@@ -3262,6 +3613,27 @@ export declare interface GetFileParameters {
|
|
|
3262
3613
|
config?: GetFileConfig;
|
|
3263
3614
|
}
|
|
3264
3615
|
|
|
3616
|
+
/** Optional parameters for getting a FileSearchStore. */
|
|
3617
|
+
export declare interface GetFileSearchStoreConfig {
|
|
3618
|
+
/** Used to override HTTP request options. */
|
|
3619
|
+
httpOptions?: HttpOptions;
|
|
3620
|
+
/** Abort signal which can be used to cancel the request.
|
|
3621
|
+
|
|
3622
|
+
NOTE: AbortSignal is a client-only operation. Using it to cancel an
|
|
3623
|
+
operation will not cancel the request in the service. You will still
|
|
3624
|
+
be charged usage for any applicable operations.
|
|
3625
|
+
*/
|
|
3626
|
+
abortSignal?: AbortSignal;
|
|
3627
|
+
}
|
|
3628
|
+
|
|
3629
|
+
/** Config for file_search_stores.get parameters. */
|
|
3630
|
+
export declare interface GetFileSearchStoreParameters {
|
|
3631
|
+
/** The resource name of the FileSearchStore. Example: `fileSearchStores/my-file-search-store-123` */
|
|
3632
|
+
name: string;
|
|
3633
|
+
/** Optional parameters for the request. */
|
|
3634
|
+
config?: GetFileSearchStoreConfig;
|
|
3635
|
+
}
|
|
3636
|
+
|
|
3265
3637
|
/** Optional parameters for models.get method. */
|
|
3266
3638
|
export declare interface GetModelConfig {
|
|
3267
3639
|
/** Used to override HTTP request options. */
|
|
@@ -3301,6 +3673,7 @@ export declare interface GetOperationParameters {
|
|
|
3301
3673
|
config?: GetOperationConfig;
|
|
3302
3674
|
}
|
|
3303
3675
|
|
|
3676
|
+
/** Optional parameters for tunings.get method. */
|
|
3304
3677
|
export declare interface GetTuningJobConfig {
|
|
3305
3678
|
/** Used to override HTTP request options. */
|
|
3306
3679
|
httpOptions?: HttpOptions;
|
|
@@ -3377,6 +3750,7 @@ export declare class GoogleGenAI {
|
|
|
3377
3750
|
readonly operations: Operations;
|
|
3378
3751
|
readonly authTokens: Tokens;
|
|
3379
3752
|
readonly tunings: Tunings;
|
|
3753
|
+
readonly fileSearchStores: FileSearchStores;
|
|
3380
3754
|
constructor(options: GoogleGenAIOptions);
|
|
3381
3755
|
}
|
|
3382
3756
|
|
|
@@ -3443,9 +3817,9 @@ export declare interface GoogleGenAIOptions {
|
|
|
3443
3817
|
httpOptions?: HttpOptions;
|
|
3444
3818
|
}
|
|
3445
3819
|
|
|
3446
|
-
/** Tool to
|
|
3820
|
+
/** Tool to retrieve public maps data for grounding, powered by Google. */
|
|
3447
3821
|
export declare interface GoogleMaps {
|
|
3448
|
-
/**
|
|
3822
|
+
/** The authentication config to access the API. Only API key is supported. This field is not supported in Gemini API. */
|
|
3449
3823
|
authConfig?: AuthConfig;
|
|
3450
3824
|
/** Optional. If true, include the widget context token in the response. */
|
|
3451
3825
|
enableWidget?: boolean;
|
|
@@ -3465,6 +3839,8 @@ export declare interface GoogleRpcStatus {
|
|
|
3465
3839
|
export declare interface GoogleSearch {
|
|
3466
3840
|
/** Optional. List of domains to be excluded from the search results. The default limit is 2000 domains. Example: ["amazon.com", "facebook.com"]. This field is not supported in Gemini API. */
|
|
3467
3841
|
excludeDomains?: string[];
|
|
3842
|
+
/** Optional. Sites with confidence level chosen & above this value will be blocked from the search results. This field is not supported in Gemini API. */
|
|
3843
|
+
blockingConfidence?: PhishBlockThreshold;
|
|
3468
3844
|
/** Optional. Filter search results to a specific time range. If customers set a start time, they must set an end time (and vice versa). This field is not supported in Vertex AI. */
|
|
3469
3845
|
timeRangeFilter?: Interval;
|
|
3470
3846
|
}
|
|
@@ -3501,11 +3877,11 @@ export declare interface GroundingChunkMaps {
|
|
|
3501
3877
|
placeAnswerSources?: GroundingChunkMapsPlaceAnswerSources;
|
|
3502
3878
|
/** This Place's resource name, in `places/{place_id}` format. Can be used to look up the Place. */
|
|
3503
3879
|
placeId?: string;
|
|
3504
|
-
/** Text of the
|
|
3880
|
+
/** Text of the place answer. */
|
|
3505
3881
|
text?: string;
|
|
3506
|
-
/** Title of the
|
|
3882
|
+
/** Title of the place. */
|
|
3507
3883
|
title?: string;
|
|
3508
|
-
/** URI reference of the
|
|
3884
|
+
/** URI reference of the place. */
|
|
3509
3885
|
uri?: string;
|
|
3510
3886
|
}
|
|
3511
3887
|
|
|
@@ -3747,6 +4123,31 @@ export declare enum HarmSeverity {
|
|
|
3747
4123
|
HARM_SEVERITY_HIGH = "HARM_SEVERITY_HIGH"
|
|
3748
4124
|
}
|
|
3749
4125
|
|
|
4126
|
+
/** The location of the API key. This enum is not supported in Gemini API. */
|
|
4127
|
+
export declare enum HttpElementLocation {
|
|
4128
|
+
HTTP_IN_UNSPECIFIED = "HTTP_IN_UNSPECIFIED",
|
|
4129
|
+
/**
|
|
4130
|
+
* Element is in the HTTP request query.
|
|
4131
|
+
*/
|
|
4132
|
+
HTTP_IN_QUERY = "HTTP_IN_QUERY",
|
|
4133
|
+
/**
|
|
4134
|
+
* Element is in the HTTP request header.
|
|
4135
|
+
*/
|
|
4136
|
+
HTTP_IN_HEADER = "HTTP_IN_HEADER",
|
|
4137
|
+
/**
|
|
4138
|
+
* Element is in the HTTP request path.
|
|
4139
|
+
*/
|
|
4140
|
+
HTTP_IN_PATH = "HTTP_IN_PATH",
|
|
4141
|
+
/**
|
|
4142
|
+
* Element is in the HTTP request body.
|
|
4143
|
+
*/
|
|
4144
|
+
HTTP_IN_BODY = "HTTP_IN_BODY",
|
|
4145
|
+
/**
|
|
4146
|
+
* Element is in the HTTP request cookie.
|
|
4147
|
+
*/
|
|
4148
|
+
HTTP_IN_COOKIE = "HTTP_IN_COOKIE"
|
|
4149
|
+
}
|
|
4150
|
+
|
|
3750
4151
|
/** HTTP options to be used in each of the requests. */
|
|
3751
4152
|
export declare interface HttpOptions {
|
|
3752
4153
|
/** The base URL for the AI platform service endpoint. */
|
|
@@ -3844,6 +4245,10 @@ export declare interface ImageConfig {
|
|
|
3844
4245
|
/** Aspect ratio of the generated images. Supported values are
|
|
3845
4246
|
"1:1", "2:3", "3:2", "3:4", "4:3", "9:16", "16:9", and "21:9". */
|
|
3846
4247
|
aspectRatio?: string;
|
|
4248
|
+
/** Optional. Specifies the size of generated images. Supported
|
|
4249
|
+
values are `1K`, `2K`, `4K`. If not specified, the model will use default
|
|
4250
|
+
value `1K`. */
|
|
4251
|
+
imageSize?: string;
|
|
3847
4252
|
}
|
|
3848
4253
|
|
|
3849
4254
|
/** Enum that specifies the language of the text in the prompt. */
|
|
@@ -3882,6 +4287,64 @@ export declare enum ImagePromptLanguage {
|
|
|
3882
4287
|
es = "es"
|
|
3883
4288
|
}
|
|
3884
4289
|
|
|
4290
|
+
/** Optional parameters for importing a file. */
|
|
4291
|
+
export declare interface ImportFileConfig {
|
|
4292
|
+
/** Used to override HTTP request options. */
|
|
4293
|
+
httpOptions?: HttpOptions;
|
|
4294
|
+
/** Abort signal which can be used to cancel the request.
|
|
4295
|
+
|
|
4296
|
+
NOTE: AbortSignal is a client-only operation. Using it to cancel an
|
|
4297
|
+
operation will not cancel the request in the service. You will still
|
|
4298
|
+
be charged usage for any applicable operations.
|
|
4299
|
+
*/
|
|
4300
|
+
abortSignal?: AbortSignal;
|
|
4301
|
+
/** User provided custom metadata stored as key-value pairs used for querying. */
|
|
4302
|
+
customMetadata?: CustomMetadata[];
|
|
4303
|
+
/** Config for telling the service how to chunk the file. */
|
|
4304
|
+
chunkingConfig?: ChunkingConfig;
|
|
4305
|
+
}
|
|
4306
|
+
|
|
4307
|
+
/** Long-running operation for importing a file to a FileSearchStore. */
|
|
4308
|
+
export declare class ImportFileOperation implements Operation<ImportFileResponse> {
|
|
4309
|
+
/** 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}`. */
|
|
4310
|
+
name?: string;
|
|
4311
|
+
/** 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. */
|
|
4312
|
+
metadata?: Record<string, unknown>;
|
|
4313
|
+
/** 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. */
|
|
4314
|
+
done?: boolean;
|
|
4315
|
+
/** The error result of the operation in case of failure or cancellation. */
|
|
4316
|
+
error?: Record<string, unknown>;
|
|
4317
|
+
/** The result of the ImportFile operation, available when the operation is done. */
|
|
4318
|
+
response?: ImportFileResponse;
|
|
4319
|
+
/**
|
|
4320
|
+
* Instantiates an Operation of the same type as the one being called with the fields set from the API response.
|
|
4321
|
+
* @internal
|
|
4322
|
+
*/
|
|
4323
|
+
_fromAPIResponse({ apiResponse, _isVertexAI, }: OperationFromAPIResponseParameters): Operation<ImportFileResponse>;
|
|
4324
|
+
/** The full HTTP response. */
|
|
4325
|
+
sdkHttpResponse?: HttpResponse;
|
|
4326
|
+
}
|
|
4327
|
+
|
|
4328
|
+
/** Config for file_search_stores.import_file parameters. */
|
|
4329
|
+
export declare interface ImportFileParameters {
|
|
4330
|
+
/** The resource name of the FileSearchStore. Example: `fileSearchStores/my-file-search-store-123` */
|
|
4331
|
+
fileSearchStoreName: string;
|
|
4332
|
+
/** The name of the File API File to import. Example: `files/abc-123` */
|
|
4333
|
+
fileName: string;
|
|
4334
|
+
/** Optional parameters for the request. */
|
|
4335
|
+
config?: ImportFileConfig;
|
|
4336
|
+
}
|
|
4337
|
+
|
|
4338
|
+
/** Response for ImportFile to import a File API file with a file search store. */
|
|
4339
|
+
export declare class ImportFileResponse {
|
|
4340
|
+
/** Used to retain the full HTTP response. */
|
|
4341
|
+
sdkHttpResponse?: HttpResponse;
|
|
4342
|
+
/** The name of the FileSearchStore containing Documents. */
|
|
4343
|
+
parent?: string;
|
|
4344
|
+
/** The identifier for the Document imported. */
|
|
4345
|
+
documentName?: string;
|
|
4346
|
+
}
|
|
4347
|
+
|
|
3885
4348
|
/** Config for `inlined_embedding_responses` parameter. */
|
|
3886
4349
|
export declare class InlinedEmbedContentResponse {
|
|
3887
4350
|
/** The response to the request.
|
|
@@ -4072,7 +4535,38 @@ export declare class ListCachedContentsResponse {
|
|
|
4072
4535
|
cachedContents?: CachedContent[];
|
|
4073
4536
|
}
|
|
4074
4537
|
|
|
4075
|
-
/**
|
|
4538
|
+
/** Config for optional parameters. */
|
|
4539
|
+
export declare interface ListDocumentsConfig {
|
|
4540
|
+
/** Used to override HTTP request options. */
|
|
4541
|
+
httpOptions?: HttpOptions;
|
|
4542
|
+
/** Abort signal which can be used to cancel the request.
|
|
4543
|
+
|
|
4544
|
+
NOTE: AbortSignal is a client-only operation. Using it to cancel an
|
|
4545
|
+
operation will not cancel the request in the service. You will still
|
|
4546
|
+
be charged usage for any applicable operations.
|
|
4547
|
+
*/
|
|
4548
|
+
abortSignal?: AbortSignal;
|
|
4549
|
+
pageSize?: number;
|
|
4550
|
+
pageToken?: string;
|
|
4551
|
+
}
|
|
4552
|
+
|
|
4553
|
+
/** Config for documents.list parameters. */
|
|
4554
|
+
export declare interface ListDocumentsParameters {
|
|
4555
|
+
/** The resource name of the FileSearchStores. Example: `fileSearchStore/file-search-store-foo` */
|
|
4556
|
+
parent: string;
|
|
4557
|
+
config?: ListDocumentsConfig;
|
|
4558
|
+
}
|
|
4559
|
+
|
|
4560
|
+
/** Config for documents.list return value. */
|
|
4561
|
+
export declare class ListDocumentsResponse {
|
|
4562
|
+
/** Used to retain the full HTTP response. */
|
|
4563
|
+
sdkHttpResponse?: HttpResponse;
|
|
4564
|
+
/** A token, which can be sent as `page_token` to retrieve the next page. If this field is omitted, there are no more pages. */
|
|
4565
|
+
nextPageToken?: string;
|
|
4566
|
+
/** The returned `Document`s. */
|
|
4567
|
+
documents?: Document_2[];
|
|
4568
|
+
}
|
|
4569
|
+
|
|
4076
4570
|
export declare interface ListFilesConfig {
|
|
4077
4571
|
/** Used to override HTTP request options. */
|
|
4078
4572
|
httpOptions?: HttpOptions;
|
|
@@ -4087,6 +4581,36 @@ export declare interface ListFilesConfig {
|
|
|
4087
4581
|
pageToken?: string;
|
|
4088
4582
|
}
|
|
4089
4583
|
|
|
4584
|
+
/** Optional parameters for listing FileSearchStore. */
|
|
4585
|
+
export declare interface ListFileSearchStoresConfig {
|
|
4586
|
+
/** Used to override HTTP request options. */
|
|
4587
|
+
httpOptions?: HttpOptions;
|
|
4588
|
+
/** Abort signal which can be used to cancel the request.
|
|
4589
|
+
|
|
4590
|
+
NOTE: AbortSignal is a client-only operation. Using it to cancel an
|
|
4591
|
+
operation will not cancel the request in the service. You will still
|
|
4592
|
+
be charged usage for any applicable operations.
|
|
4593
|
+
*/
|
|
4594
|
+
abortSignal?: AbortSignal;
|
|
4595
|
+
pageSize?: number;
|
|
4596
|
+
pageToken?: string;
|
|
4597
|
+
}
|
|
4598
|
+
|
|
4599
|
+
/** Config for file_search_stores.list parameters. */
|
|
4600
|
+
export declare interface ListFileSearchStoresParameters {
|
|
4601
|
+
/** Optional parameters for the list request. */
|
|
4602
|
+
config?: ListFileSearchStoresConfig;
|
|
4603
|
+
}
|
|
4604
|
+
|
|
4605
|
+
/** Config for file_search_stores.list return value. */
|
|
4606
|
+
export declare class ListFileSearchStoresResponse {
|
|
4607
|
+
/** Used to retain the full HTTP response. */
|
|
4608
|
+
sdkHttpResponse?: HttpResponse;
|
|
4609
|
+
nextPageToken?: string;
|
|
4610
|
+
/** The returned file search stores. */
|
|
4611
|
+
fileSearchStores?: FileSearchStore[];
|
|
4612
|
+
}
|
|
4613
|
+
|
|
4090
4614
|
/** Generates the parameters for the list method. */
|
|
4091
4615
|
export declare interface ListFilesParameters {
|
|
4092
4616
|
/** Used to override the default configuration. */
|
|
@@ -5120,6 +5644,28 @@ export declare interface Model {
|
|
|
5120
5644
|
defaultCheckpointId?: string;
|
|
5121
5645
|
/** The checkpoints of the model. */
|
|
5122
5646
|
checkpoints?: Checkpoint[];
|
|
5647
|
+
/** Temperature value used for sampling set when the dataset was saved.
|
|
5648
|
+
This value is used to tune the degree of randomness. */
|
|
5649
|
+
temperature?: number;
|
|
5650
|
+
/** The maximum temperature value used for sampling set when the
|
|
5651
|
+
dataset was saved. This value is used to tune the degree of randomness. */
|
|
5652
|
+
maxTemperature?: number;
|
|
5653
|
+
/** Optional. Specifies the nucleus sampling threshold. The model
|
|
5654
|
+
considers only the smallest set of tokens whose cumulative probability is
|
|
5655
|
+
at least `top_p`. This helps generate more diverse and less repetitive
|
|
5656
|
+
responses. For example, a `top_p` of 0.9 means the model considers tokens
|
|
5657
|
+
until the cumulative probability of the tokens to select from reaches 0.9.
|
|
5658
|
+
It's recommended to adjust either temperature or `top_p`, but not both. */
|
|
5659
|
+
topP?: number;
|
|
5660
|
+
/** Optional. Specifies the top-k sampling threshold. The model
|
|
5661
|
+
considers only the top k most probable tokens for the next token. This can
|
|
5662
|
+
be useful for generating more coherent and less random text. For example,
|
|
5663
|
+
a `top_k` of 40 means the model will choose the next word from the 40 most
|
|
5664
|
+
likely words. */
|
|
5665
|
+
topK?: number;
|
|
5666
|
+
/** Whether the model supports thinking features. If true, thoughts are
|
|
5667
|
+
returned only if the model supports thought and thoughts are available. */
|
|
5668
|
+
thinking?: boolean;
|
|
5123
5669
|
}
|
|
5124
5670
|
|
|
5125
5671
|
export declare class Models extends BaseModule {
|
|
@@ -5541,7 +6087,7 @@ export declare interface Operation<T> {
|
|
|
5541
6087
|
* Instantiates an Operation of the same type as the one being called with the fields set from the API response.
|
|
5542
6088
|
* @internal
|
|
5543
6089
|
*/
|
|
5544
|
-
_fromAPIResponse({ apiResponse,
|
|
6090
|
+
_fromAPIResponse({ apiResponse, _isVertexAI, }: OperationFromAPIResponseParameters): Operation<T>;
|
|
5545
6091
|
}
|
|
5546
6092
|
|
|
5547
6093
|
/** Parameters of the fromAPIResponse method of the Operation class. */
|
|
@@ -5549,7 +6095,7 @@ export declare interface OperationFromAPIResponseParameters {
|
|
|
5549
6095
|
/** The API response to be converted to an Operation. */
|
|
5550
6096
|
apiResponse: Record<string, unknown>;
|
|
5551
6097
|
/** Whether the API response is from Vertex AI. */
|
|
5552
|
-
|
|
6098
|
+
_isVertexAI: boolean;
|
|
5553
6099
|
}
|
|
5554
6100
|
|
|
5555
6101
|
/** Parameters for the get method of the operations module. */
|
|
@@ -5607,7 +6153,7 @@ export declare enum PagedItem {
|
|
|
5607
6153
|
PAGED_ITEM_TUNING_JOBS = "tuningJobs",
|
|
5608
6154
|
PAGED_ITEM_FILES = "files",
|
|
5609
6155
|
PAGED_ITEM_CACHED_CONTENTS = "cachedContents",
|
|
5610
|
-
|
|
6156
|
+
PAGED_ITEM_FILE_SEARCH_STORES = "fileSearchStores",
|
|
5611
6157
|
PAGED_ITEM_DOCUMENTS = "documents"
|
|
5612
6158
|
}
|
|
5613
6159
|
|
|
@@ -5627,7 +6173,7 @@ declare interface PagedItemResponse<T> {
|
|
|
5627
6173
|
tuningJobs?: T[];
|
|
5628
6174
|
files?: T[];
|
|
5629
6175
|
cachedContents?: T[];
|
|
5630
|
-
|
|
6176
|
+
fileSearchStores?: T[];
|
|
5631
6177
|
documents?: T[];
|
|
5632
6178
|
}
|
|
5633
6179
|
|
|
@@ -5792,6 +6338,38 @@ export declare enum PersonGeneration {
|
|
|
5792
6338
|
ALLOW_ALL = "ALLOW_ALL"
|
|
5793
6339
|
}
|
|
5794
6340
|
|
|
6341
|
+
/** Sites with confidence level chosen & above this value will be blocked from the search results. This enum is not supported in Gemini API. */
|
|
6342
|
+
export declare enum PhishBlockThreshold {
|
|
6343
|
+
/**
|
|
6344
|
+
* Defaults to unspecified.
|
|
6345
|
+
*/
|
|
6346
|
+
PHISH_BLOCK_THRESHOLD_UNSPECIFIED = "PHISH_BLOCK_THRESHOLD_UNSPECIFIED",
|
|
6347
|
+
/**
|
|
6348
|
+
* Blocks Low and above confidence URL that is risky.
|
|
6349
|
+
*/
|
|
6350
|
+
BLOCK_LOW_AND_ABOVE = "BLOCK_LOW_AND_ABOVE",
|
|
6351
|
+
/**
|
|
6352
|
+
* Blocks Medium and above confidence URL that is risky.
|
|
6353
|
+
*/
|
|
6354
|
+
BLOCK_MEDIUM_AND_ABOVE = "BLOCK_MEDIUM_AND_ABOVE",
|
|
6355
|
+
/**
|
|
6356
|
+
* Blocks High and above confidence URL that is risky.
|
|
6357
|
+
*/
|
|
6358
|
+
BLOCK_HIGH_AND_ABOVE = "BLOCK_HIGH_AND_ABOVE",
|
|
6359
|
+
/**
|
|
6360
|
+
* Blocks Higher and above confidence URL that is risky.
|
|
6361
|
+
*/
|
|
6362
|
+
BLOCK_HIGHER_AND_ABOVE = "BLOCK_HIGHER_AND_ABOVE",
|
|
6363
|
+
/**
|
|
6364
|
+
* Blocks Very high and above confidence URL that is risky.
|
|
6365
|
+
*/
|
|
6366
|
+
BLOCK_VERY_HIGH_AND_ABOVE = "BLOCK_VERY_HIGH_AND_ABOVE",
|
|
6367
|
+
/**
|
|
6368
|
+
* Blocks Extremely high confidence URL that is risky.
|
|
6369
|
+
*/
|
|
6370
|
+
BLOCK_ONLY_EXTREMELY_HIGH = "BLOCK_ONLY_EXTREMELY_HIGH"
|
|
6371
|
+
}
|
|
6372
|
+
|
|
5795
6373
|
/** The configuration for the prebuilt speaker to use. */
|
|
5796
6374
|
export declare interface PrebuiltVoiceConfig {
|
|
5797
6375
|
/** The name of the preset voice to use. */
|
|
@@ -5832,6 +6410,8 @@ export declare interface PreferenceOptimizationHyperParameters {
|
|
|
5832
6410
|
|
|
5833
6411
|
/** Preference optimization tuning spec for tuning. */
|
|
5834
6412
|
export declare interface PreferenceOptimizationSpec {
|
|
6413
|
+
/** Optional. If set to true, disable intermediate checkpoints for Preference Optimization and only the last checkpoint will be exported. Otherwise, enable intermediate checkpoints for Preference Optimization. Default is false. */
|
|
6414
|
+
exportLastCheckpointOnly?: boolean;
|
|
5835
6415
|
/** Optional. Hyperparameters for Preference Optimization. */
|
|
5836
6416
|
hyperParameters?: PreferenceOptimizationHyperParameters;
|
|
5837
6417
|
/** Required. Cloud Storage path to file containing training dataset for preference optimization tuning. The dataset must be formatted as a JSONL file. */
|
|
@@ -6554,11 +7134,11 @@ export declare interface SlidingWindow {
|
|
|
6554
7134
|
targetTokens?: string;
|
|
6555
7135
|
}
|
|
6556
7136
|
|
|
6557
|
-
/**
|
|
7137
|
+
/** Configuration for a single speaker in a multi speaker setup. */
|
|
6558
7138
|
export declare interface SpeakerVoiceConfig {
|
|
6559
|
-
/** Required. The name of the speaker
|
|
7139
|
+
/** Required. The name of the speaker. This should be the same as the speaker name used in the prompt. */
|
|
6560
7140
|
speaker?: string;
|
|
6561
|
-
/** Required. The configuration for the voice
|
|
7141
|
+
/** Required. The configuration for the voice of this speaker. */
|
|
6562
7142
|
voiceConfig?: VoiceConfig;
|
|
6563
7143
|
}
|
|
6564
7144
|
|
|
@@ -6590,6 +7170,12 @@ export declare enum StartSensitivity {
|
|
|
6590
7170
|
START_SENSITIVITY_LOW = "START_SENSITIVITY_LOW"
|
|
6591
7171
|
}
|
|
6592
7172
|
|
|
7173
|
+
/** User provided string values assigned to a single metadata key. This data type is not supported in Vertex AI. */
|
|
7174
|
+
export declare interface StringList {
|
|
7175
|
+
/** The string values of the metadata to store. */
|
|
7176
|
+
values?: string[];
|
|
7177
|
+
}
|
|
7178
|
+
|
|
6593
7179
|
/** Configuration for a Style reference image. */
|
|
6594
7180
|
export declare interface StyleReferenceConfig {
|
|
6595
7181
|
/** A text description of the style to use for the generated image. */
|
|
@@ -6881,19 +7467,20 @@ export declare interface Tool {
|
|
|
6881
7467
|
functionDeclarations?: FunctionDeclaration[];
|
|
6882
7468
|
/** Optional. Retrieval tool type. System will always execute the provided retrieval tool(s) to get external knowledge to answer the prompt. Retrieval results are presented to the model for generation. This field is not supported in Gemini API. */
|
|
6883
7469
|
retrieval?: Retrieval;
|
|
6884
|
-
/** Optional.
|
|
7470
|
+
/** Optional. Specialized retrieval tool that is powered by Google Search. */
|
|
6885
7471
|
googleSearchRetrieval?: GoogleSearchRetrieval;
|
|
6886
|
-
/** Optional. Google Maps tool type. Specialized retrieval tool
|
|
6887
|
-
that is powered by Google Maps. */
|
|
6888
|
-
googleMaps?: GoogleMaps;
|
|
6889
7472
|
/** Optional. Tool to support the model interacting directly with the
|
|
6890
7473
|
computer. If enabled, it automatically populates computer-use specific
|
|
6891
7474
|
Function Declarations. */
|
|
6892
7475
|
computerUse?: ComputerUse;
|
|
7476
|
+
/** Optional. Tool to retrieve knowledge from the File Search Stores. */
|
|
7477
|
+
fileSearch?: FileSearch;
|
|
6893
7478
|
/** Optional. CodeExecution tool type. Enables the model to execute code as part of generation. */
|
|
6894
7479
|
codeExecution?: ToolCodeExecution;
|
|
6895
7480
|
/** Optional. Tool to support searching public web data, powered by Vertex AI Search and Sec4 compliance. This field is not supported in Gemini API. */
|
|
6896
7481
|
enterpriseWebSearch?: EnterpriseWebSearch;
|
|
7482
|
+
/** Optional. GoogleMaps tool type. Tool to support Google Maps in Model. */
|
|
7483
|
+
googleMaps?: GoogleMaps;
|
|
6897
7484
|
/** Optional. GoogleSearch tool type. Tool to support Google Search in Model. Powered by Google. */
|
|
6898
7485
|
googleSearch?: GoogleSearch;
|
|
6899
7486
|
/** Optional. Tool to support URL context retrieval. */
|
|
@@ -6918,14 +7505,14 @@ export declare type ToolListUnion = ToolUnion[];
|
|
|
6918
7505
|
|
|
6919
7506
|
export declare type ToolUnion = Tool | CallableTool;
|
|
6920
7507
|
|
|
6921
|
-
/** Output only.
|
|
7508
|
+
/** Output only. The traffic type for this request. This enum is not supported in Gemini API. */
|
|
6922
7509
|
export declare enum TrafficType {
|
|
6923
7510
|
/**
|
|
6924
7511
|
* Unspecified request traffic type.
|
|
6925
7512
|
*/
|
|
6926
7513
|
TRAFFIC_TYPE_UNSPECIFIED = "TRAFFIC_TYPE_UNSPECIFIED",
|
|
6927
7514
|
/**
|
|
6928
|
-
*
|
|
7515
|
+
* The request was processed using Pay-As-You-Go quota.
|
|
6929
7516
|
*/
|
|
6930
7517
|
ON_DEMAND = "ON_DEMAND",
|
|
6931
7518
|
/**
|
|
@@ -7066,7 +7653,7 @@ export declare interface TuningJob {
|
|
|
7066
7653
|
pipelineJob?: string;
|
|
7067
7654
|
/** The service account that the tuningJob workload runs as. If not specified, the Vertex AI Secure Fine-Tuned Service Agent in the project will be used. See https://cloud.google.com/iam/docs/service-agents#vertex-ai-secure-fine-tuning-service-agent Users starting the pipeline must have the `iam.serviceAccounts.actAs` permission on this service account. */
|
|
7068
7655
|
serviceAccount?: string;
|
|
7069
|
-
/** Optional. The display name of the TunedModel. The name can be up to 128 characters long and can consist of any UTF-8 characters. */
|
|
7656
|
+
/** Optional. The display name of the TunedModel. The name can be up to 128 characters long and can consist of any UTF-8 characters. For continuous tuning, tuned_model_display_name will by default use the same display name as the pre-tuned model. If a new display name is provided, the tuning job will create a new model instead of a new version. */
|
|
7070
7657
|
tunedModelDisplayName?: string;
|
|
7071
7658
|
/** Tuning Spec for Veo Tuning. */
|
|
7072
7659
|
veoTuningSpec?: VeoTuningSpec;
|
|
@@ -7178,7 +7765,11 @@ export declare enum TuningTask {
|
|
|
7178
7765
|
/**
|
|
7179
7766
|
* Tuning task for text to video.
|
|
7180
7767
|
*/
|
|
7181
|
-
TUNING_TASK_T2V = "TUNING_TASK_T2V"
|
|
7768
|
+
TUNING_TASK_T2V = "TUNING_TASK_T2V",
|
|
7769
|
+
/**
|
|
7770
|
+
* Tuning task for reference to video.
|
|
7771
|
+
*/
|
|
7772
|
+
TUNING_TASK_R2V = "TUNING_TASK_R2V"
|
|
7182
7773
|
}
|
|
7183
7774
|
|
|
7184
7775
|
export declare interface TuningValidationDataset {
|
|
@@ -7278,8 +7869,10 @@ declare namespace types {
|
|
|
7278
7869
|
FunctionResponseScheduling,
|
|
7279
7870
|
Type,
|
|
7280
7871
|
Mode,
|
|
7281
|
-
AuthType,
|
|
7282
7872
|
ApiSpec,
|
|
7873
|
+
AuthType,
|
|
7874
|
+
HttpElementLocation,
|
|
7875
|
+
PhishBlockThreshold,
|
|
7283
7876
|
HarmCategory,
|
|
7284
7877
|
HarmBlockMethod,
|
|
7285
7878
|
HarmBlockThreshold,
|
|
@@ -7312,6 +7905,7 @@ declare namespace types {
|
|
|
7312
7905
|
VideoGenerationMaskMode,
|
|
7313
7906
|
VideoCompressionQuality,
|
|
7314
7907
|
TuningMethod,
|
|
7908
|
+
DocumentState,
|
|
7315
7909
|
FileState,
|
|
7316
7910
|
FileSource,
|
|
7317
7911
|
TurnCompleteReason,
|
|
@@ -7341,16 +7935,16 @@ declare namespace types {
|
|
|
7341
7935
|
FunctionDeclaration,
|
|
7342
7936
|
DynamicRetrievalConfig,
|
|
7343
7937
|
GoogleSearchRetrieval,
|
|
7938
|
+
ComputerUse,
|
|
7939
|
+
FileSearch,
|
|
7940
|
+
ApiAuthApiKeyConfig,
|
|
7941
|
+
ApiAuth,
|
|
7344
7942
|
ApiKeyConfig,
|
|
7345
7943
|
AuthConfigGoogleServiceAccountConfig,
|
|
7346
7944
|
AuthConfigHttpBasicAuthConfig,
|
|
7347
7945
|
AuthConfigOauthConfig,
|
|
7348
7946
|
AuthConfigOidcConfig,
|
|
7349
7947
|
AuthConfig,
|
|
7350
|
-
GoogleMaps,
|
|
7351
|
-
ComputerUse,
|
|
7352
|
-
ApiAuthApiKeyConfig,
|
|
7353
|
-
ApiAuth,
|
|
7354
7948
|
ExternalApiElasticSearchParams,
|
|
7355
7949
|
ExternalApiSimpleSearchParams,
|
|
7356
7950
|
ExternalApi,
|
|
@@ -7367,6 +7961,7 @@ declare namespace types {
|
|
|
7367
7961
|
Retrieval,
|
|
7368
7962
|
ToolCodeExecution,
|
|
7369
7963
|
EnterpriseWebSearch,
|
|
7964
|
+
GoogleMaps,
|
|
7370
7965
|
Interval,
|
|
7371
7966
|
GoogleSearch,
|
|
7372
7967
|
UrlContext,
|
|
@@ -7536,6 +8131,35 @@ declare namespace types {
|
|
|
7536
8131
|
ListCachedContentsConfig,
|
|
7537
8132
|
ListCachedContentsParameters,
|
|
7538
8133
|
ListCachedContentsResponse,
|
|
8134
|
+
GetDocumentConfig,
|
|
8135
|
+
GetDocumentParameters,
|
|
8136
|
+
StringList,
|
|
8137
|
+
CustomMetadata,
|
|
8138
|
+
Document_2 as Document,
|
|
8139
|
+
DeleteDocumentConfig,
|
|
8140
|
+
DeleteDocumentParameters,
|
|
8141
|
+
ListDocumentsConfig,
|
|
8142
|
+
ListDocumentsParameters,
|
|
8143
|
+
ListDocumentsResponse,
|
|
8144
|
+
CreateFileSearchStoreConfig,
|
|
8145
|
+
CreateFileSearchStoreParameters,
|
|
8146
|
+
FileSearchStore,
|
|
8147
|
+
GetFileSearchStoreConfig,
|
|
8148
|
+
GetFileSearchStoreParameters,
|
|
8149
|
+
DeleteFileSearchStoreConfig,
|
|
8150
|
+
DeleteFileSearchStoreParameters,
|
|
8151
|
+
ListFileSearchStoresConfig,
|
|
8152
|
+
ListFileSearchStoresParameters,
|
|
8153
|
+
ListFileSearchStoresResponse,
|
|
8154
|
+
WhiteSpaceConfig,
|
|
8155
|
+
ChunkingConfig,
|
|
8156
|
+
UploadToFileSearchStoreConfig,
|
|
8157
|
+
UploadToFileSearchStoreParameters,
|
|
8158
|
+
UploadToFileSearchStoreResumableResponse,
|
|
8159
|
+
ImportFileConfig,
|
|
8160
|
+
ImportFileParameters,
|
|
8161
|
+
ImportFileResponse,
|
|
8162
|
+
ImportFileOperation,
|
|
7539
8163
|
ListFilesConfig,
|
|
7540
8164
|
ListFilesParameters,
|
|
7541
8165
|
FileStatus,
|
|
@@ -7558,6 +8182,7 @@ declare namespace types {
|
|
|
7558
8182
|
BatchJobDestination,
|
|
7559
8183
|
CreateBatchJobConfig,
|
|
7560
8184
|
CreateBatchJobParameters,
|
|
8185
|
+
CompletionStats,
|
|
7561
8186
|
BatchJob,
|
|
7562
8187
|
EmbedContentBatch,
|
|
7563
8188
|
EmbeddingsBatchJobSource,
|
|
@@ -7650,6 +8275,8 @@ declare namespace types {
|
|
|
7650
8275
|
CreateAuthTokenParameters,
|
|
7651
8276
|
OperationGetParameters,
|
|
7652
8277
|
CreateTuningJobParameters,
|
|
8278
|
+
UploadToFileSearchStoreResponse,
|
|
8279
|
+
UploadToFileSearchStoreOperation,
|
|
7653
8280
|
BlobImageUnion,
|
|
7654
8281
|
PartUnion,
|
|
7655
8282
|
PartListUnion,
|
|
@@ -7725,6 +8352,17 @@ declare interface Uploader {
|
|
|
7725
8352
|
* @return A Promise that resolves to types.File.
|
|
7726
8353
|
*/
|
|
7727
8354
|
upload(file: string | Blob, uploadUrl: string, apiClient: ApiClient): Promise<File_2>;
|
|
8355
|
+
/**
|
|
8356
|
+
* Uploads a file to file search store via the given upload url.
|
|
8357
|
+
*
|
|
8358
|
+
* @param file The file to upload. file is in string type or a Blob.
|
|
8359
|
+
* @param uploadUrl The upload URL as a string is where the file will be
|
|
8360
|
+
* uploaded to. The uploadUrl must be a url that was returned by the
|
|
8361
|
+
* https://generativelanguage.googleapis.com/upload/v1beta/{file_search_store_name}:uploadToFileSearchStore endpoint
|
|
8362
|
+
* @param apiClient The ApiClient to use for uploading.
|
|
8363
|
+
* @return A Promise that resolves to types.UploadToFileSearchStoreOperation.
|
|
8364
|
+
*/
|
|
8365
|
+
uploadToFileSearchStore(file: string | Blob, uploadUrl: string, apiClient: ApiClient): Promise<UploadToFileSearchStoreOperation>;
|
|
7728
8366
|
/**
|
|
7729
8367
|
* Returns the file's mimeType and the size of a given file. If the file is a
|
|
7730
8368
|
* string path, the file type is determined by the file extension. If the
|
|
@@ -7763,6 +8401,82 @@ export declare interface UploadFileParameters {
|
|
|
7763
8401
|
config?: UploadFileConfig;
|
|
7764
8402
|
}
|
|
7765
8403
|
|
|
8404
|
+
/** Optional parameters for uploading a file to a FileSearchStore. */
|
|
8405
|
+
export declare interface UploadToFileSearchStoreConfig {
|
|
8406
|
+
/** Used to override HTTP request options. */
|
|
8407
|
+
httpOptions?: HttpOptions;
|
|
8408
|
+
/** Abort signal which can be used to cancel the request.
|
|
8409
|
+
|
|
8410
|
+
NOTE: AbortSignal is a client-only operation. Using it to cancel an
|
|
8411
|
+
operation will not cancel the request in the service. You will still
|
|
8412
|
+
be charged usage for any applicable operations.
|
|
8413
|
+
*/
|
|
8414
|
+
abortSignal?: AbortSignal;
|
|
8415
|
+
/** MIME type of the file to be uploaded. If not provided, it will be inferred from the file extension. */
|
|
8416
|
+
mimeType?: string;
|
|
8417
|
+
/** Display name of the created document. */
|
|
8418
|
+
displayName?: string;
|
|
8419
|
+
/** User provided custom metadata stored as key-value pairs used for querying. */
|
|
8420
|
+
customMetadata?: CustomMetadata[];
|
|
8421
|
+
/** Config for telling the service how to chunk the file. */
|
|
8422
|
+
chunkingConfig?: ChunkingConfig;
|
|
8423
|
+
}
|
|
8424
|
+
|
|
8425
|
+
/** Long-running operation for uploading a file to a FileSearchStore. */
|
|
8426
|
+
export declare class UploadToFileSearchStoreOperation implements Operation<UploadToFileSearchStoreResponse> {
|
|
8427
|
+
/** 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}`. */
|
|
8428
|
+
name?: string;
|
|
8429
|
+
/** 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. */
|
|
8430
|
+
metadata?: Record<string, unknown>;
|
|
8431
|
+
/** 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. */
|
|
8432
|
+
done?: boolean;
|
|
8433
|
+
/** The error result of the operation in case of failure or cancellation. */
|
|
8434
|
+
error?: Record<string, unknown>;
|
|
8435
|
+
/** The result of the UploadToFileSearchStore operation, available when the operation is done. */
|
|
8436
|
+
response?: UploadToFileSearchStoreResponse;
|
|
8437
|
+
/**
|
|
8438
|
+
* Instantiates an Operation of the same type as the one being called with the fields set from the API response.
|
|
8439
|
+
* @internal
|
|
8440
|
+
*/
|
|
8441
|
+
_fromAPIResponse({ apiResponse, _isVertexAI, }: OperationFromAPIResponseParameters): Operation<UploadToFileSearchStoreResponse>;
|
|
8442
|
+
/** The full HTTP response. */
|
|
8443
|
+
sdkHttpResponse?: HttpResponse;
|
|
8444
|
+
}
|
|
8445
|
+
|
|
8446
|
+
/** Generates the parameters for the private _upload_to_file_search_store method. */
|
|
8447
|
+
export declare interface UploadToFileSearchStoreParameters {
|
|
8448
|
+
/** The resource name of the FileSearchStore. Example: `fileSearchStores/my-file-search-store-123` */
|
|
8449
|
+
fileSearchStoreName: string;
|
|
8450
|
+
/** Used to override the default configuration. */
|
|
8451
|
+
config?: UploadToFileSearchStoreConfig;
|
|
8452
|
+
}
|
|
8453
|
+
|
|
8454
|
+
/** Parameters for the upload file to file search store method. */
|
|
8455
|
+
export declare interface UploadToFileSearchStoreParameters {
|
|
8456
|
+
/** The name of the file search store to upload. */
|
|
8457
|
+
fileSearchStoreName: string;
|
|
8458
|
+
/** The string path to the file to be uploaded or a Blob object. */
|
|
8459
|
+
file: string | globalThis.Blob;
|
|
8460
|
+
/** Configuration that contains optional parameters. */
|
|
8461
|
+
config?: UploadToFileSearchStoreConfig;
|
|
8462
|
+
}
|
|
8463
|
+
|
|
8464
|
+
/** The response when long-running operation for uploading a file to a FileSearchStore complete. */
|
|
8465
|
+
export declare class UploadToFileSearchStoreResponse {
|
|
8466
|
+
/** Used to retain the full HTTP response. */
|
|
8467
|
+
sdkHttpResponse?: HttpResponse;
|
|
8468
|
+
/** The name of the FileSearchStore containing Documents. */
|
|
8469
|
+
parent?: string;
|
|
8470
|
+
/** The identifier for the Document imported. */
|
|
8471
|
+
documentName?: string;
|
|
8472
|
+
}
|
|
8473
|
+
|
|
8474
|
+
/** Response for the resumable upload method. */
|
|
8475
|
+
export declare class UploadToFileSearchStoreResumableResponse {
|
|
8476
|
+
/** Used to retain the full HTTP response. */
|
|
8477
|
+
sdkHttpResponse?: HttpResponse;
|
|
8478
|
+
}
|
|
8479
|
+
|
|
7766
8480
|
/** Configuration for upscaling an image.
|
|
7767
8481
|
|
|
7768
8482
|
For more information on this configuration, refer to
|
|
@@ -8108,4 +8822,12 @@ export declare interface WeightedPrompt {
|
|
|
8108
8822
|
weight?: number;
|
|
8109
8823
|
}
|
|
8110
8824
|
|
|
8825
|
+
/** Configuration for a white space chunking algorithm. */
|
|
8826
|
+
export declare interface WhiteSpaceConfig {
|
|
8827
|
+
/** Maximum number of tokens per chunk. */
|
|
8828
|
+
maxTokensPerChunk?: number;
|
|
8829
|
+
/** Maximum number of overlapping tokens between two adjacent chunks. */
|
|
8830
|
+
maxOverlapTokens?: number;
|
|
8831
|
+
}
|
|
8832
|
+
|
|
8111
8833
|
export { }
|