@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/genai.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;
|
|
@@ -3365,6 +3738,7 @@ export declare class GoogleGenAI {
|
|
|
3365
3738
|
readonly operations: Operations;
|
|
3366
3739
|
readonly authTokens: Tokens;
|
|
3367
3740
|
readonly tunings: Tunings;
|
|
3741
|
+
readonly fileSearchStores: FileSearchStores;
|
|
3368
3742
|
constructor(options: GoogleGenAIOptions);
|
|
3369
3743
|
}
|
|
3370
3744
|
|
|
@@ -3431,9 +3805,9 @@ export declare interface GoogleGenAIOptions {
|
|
|
3431
3805
|
httpOptions?: HttpOptions;
|
|
3432
3806
|
}
|
|
3433
3807
|
|
|
3434
|
-
/** Tool to
|
|
3808
|
+
/** Tool to retrieve public maps data for grounding, powered by Google. */
|
|
3435
3809
|
export declare interface GoogleMaps {
|
|
3436
|
-
/**
|
|
3810
|
+
/** The authentication config to access the API. Only API key is supported. This field is not supported in Gemini API. */
|
|
3437
3811
|
authConfig?: AuthConfig;
|
|
3438
3812
|
/** Optional. If true, include the widget context token in the response. */
|
|
3439
3813
|
enableWidget?: boolean;
|
|
@@ -3453,6 +3827,8 @@ export declare interface GoogleRpcStatus {
|
|
|
3453
3827
|
export declare interface GoogleSearch {
|
|
3454
3828
|
/** 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. */
|
|
3455
3829
|
excludeDomains?: string[];
|
|
3830
|
+
/** Optional. Sites with confidence level chosen & above this value will be blocked from the search results. This field is not supported in Gemini API. */
|
|
3831
|
+
blockingConfidence?: PhishBlockThreshold;
|
|
3456
3832
|
/** 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. */
|
|
3457
3833
|
timeRangeFilter?: Interval;
|
|
3458
3834
|
}
|
|
@@ -3489,11 +3865,11 @@ export declare interface GroundingChunkMaps {
|
|
|
3489
3865
|
placeAnswerSources?: GroundingChunkMapsPlaceAnswerSources;
|
|
3490
3866
|
/** This Place's resource name, in `places/{place_id}` format. Can be used to look up the Place. */
|
|
3491
3867
|
placeId?: string;
|
|
3492
|
-
/** Text of the
|
|
3868
|
+
/** Text of the place answer. */
|
|
3493
3869
|
text?: string;
|
|
3494
|
-
/** Title of the
|
|
3870
|
+
/** Title of the place. */
|
|
3495
3871
|
title?: string;
|
|
3496
|
-
/** URI reference of the
|
|
3872
|
+
/** URI reference of the place. */
|
|
3497
3873
|
uri?: string;
|
|
3498
3874
|
}
|
|
3499
3875
|
|
|
@@ -3735,6 +4111,31 @@ export declare enum HarmSeverity {
|
|
|
3735
4111
|
HARM_SEVERITY_HIGH = "HARM_SEVERITY_HIGH"
|
|
3736
4112
|
}
|
|
3737
4113
|
|
|
4114
|
+
/** The location of the API key. This enum is not supported in Gemini API. */
|
|
4115
|
+
export declare enum HttpElementLocation {
|
|
4116
|
+
HTTP_IN_UNSPECIFIED = "HTTP_IN_UNSPECIFIED",
|
|
4117
|
+
/**
|
|
4118
|
+
* Element is in the HTTP request query.
|
|
4119
|
+
*/
|
|
4120
|
+
HTTP_IN_QUERY = "HTTP_IN_QUERY",
|
|
4121
|
+
/**
|
|
4122
|
+
* Element is in the HTTP request header.
|
|
4123
|
+
*/
|
|
4124
|
+
HTTP_IN_HEADER = "HTTP_IN_HEADER",
|
|
4125
|
+
/**
|
|
4126
|
+
* Element is in the HTTP request path.
|
|
4127
|
+
*/
|
|
4128
|
+
HTTP_IN_PATH = "HTTP_IN_PATH",
|
|
4129
|
+
/**
|
|
4130
|
+
* Element is in the HTTP request body.
|
|
4131
|
+
*/
|
|
4132
|
+
HTTP_IN_BODY = "HTTP_IN_BODY",
|
|
4133
|
+
/**
|
|
4134
|
+
* Element is in the HTTP request cookie.
|
|
4135
|
+
*/
|
|
4136
|
+
HTTP_IN_COOKIE = "HTTP_IN_COOKIE"
|
|
4137
|
+
}
|
|
4138
|
+
|
|
3738
4139
|
/** HTTP options to be used in each of the requests. */
|
|
3739
4140
|
export declare interface HttpOptions {
|
|
3740
4141
|
/** The base URL for the AI platform service endpoint. */
|
|
@@ -3832,6 +4233,10 @@ export declare interface ImageConfig {
|
|
|
3832
4233
|
/** Aspect ratio of the generated images. Supported values are
|
|
3833
4234
|
"1:1", "2:3", "3:2", "3:4", "4:3", "9:16", "16:9", and "21:9". */
|
|
3834
4235
|
aspectRatio?: string;
|
|
4236
|
+
/** Optional. Specifies the size of generated images. Supported
|
|
4237
|
+
values are `1K`, `2K`, `4K`. If not specified, the model will use default
|
|
4238
|
+
value `1K`. */
|
|
4239
|
+
imageSize?: string;
|
|
3835
4240
|
}
|
|
3836
4241
|
|
|
3837
4242
|
/** Enum that specifies the language of the text in the prompt. */
|
|
@@ -3870,6 +4275,64 @@ export declare enum ImagePromptLanguage {
|
|
|
3870
4275
|
es = "es"
|
|
3871
4276
|
}
|
|
3872
4277
|
|
|
4278
|
+
/** Optional parameters for importing a file. */
|
|
4279
|
+
export declare interface ImportFileConfig {
|
|
4280
|
+
/** Used to override HTTP request options. */
|
|
4281
|
+
httpOptions?: HttpOptions;
|
|
4282
|
+
/** Abort signal which can be used to cancel the request.
|
|
4283
|
+
|
|
4284
|
+
NOTE: AbortSignal is a client-only operation. Using it to cancel an
|
|
4285
|
+
operation will not cancel the request in the service. You will still
|
|
4286
|
+
be charged usage for any applicable operations.
|
|
4287
|
+
*/
|
|
4288
|
+
abortSignal?: AbortSignal;
|
|
4289
|
+
/** User provided custom metadata stored as key-value pairs used for querying. */
|
|
4290
|
+
customMetadata?: CustomMetadata[];
|
|
4291
|
+
/** Config for telling the service how to chunk the file. */
|
|
4292
|
+
chunkingConfig?: ChunkingConfig;
|
|
4293
|
+
}
|
|
4294
|
+
|
|
4295
|
+
/** Long-running operation for importing a file to a FileSearchStore. */
|
|
4296
|
+
export declare class ImportFileOperation implements Operation<ImportFileResponse> {
|
|
4297
|
+
/** 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}`. */
|
|
4298
|
+
name?: string;
|
|
4299
|
+
/** 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. */
|
|
4300
|
+
metadata?: Record<string, unknown>;
|
|
4301
|
+
/** 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. */
|
|
4302
|
+
done?: boolean;
|
|
4303
|
+
/** The error result of the operation in case of failure or cancellation. */
|
|
4304
|
+
error?: Record<string, unknown>;
|
|
4305
|
+
/** The result of the ImportFile operation, available when the operation is done. */
|
|
4306
|
+
response?: ImportFileResponse;
|
|
4307
|
+
/**
|
|
4308
|
+
* Instantiates an Operation of the same type as the one being called with the fields set from the API response.
|
|
4309
|
+
* @internal
|
|
4310
|
+
*/
|
|
4311
|
+
_fromAPIResponse({ apiResponse, _isVertexAI, }: OperationFromAPIResponseParameters): Operation<ImportFileResponse>;
|
|
4312
|
+
/** The full HTTP response. */
|
|
4313
|
+
sdkHttpResponse?: HttpResponse;
|
|
4314
|
+
}
|
|
4315
|
+
|
|
4316
|
+
/** Config for file_search_stores.import_file parameters. */
|
|
4317
|
+
export declare interface ImportFileParameters {
|
|
4318
|
+
/** The resource name of the FileSearchStore. Example: `fileSearchStores/my-file-search-store-123` */
|
|
4319
|
+
fileSearchStoreName: string;
|
|
4320
|
+
/** The name of the File API File to import. Example: `files/abc-123` */
|
|
4321
|
+
fileName: string;
|
|
4322
|
+
/** Optional parameters for the request. */
|
|
4323
|
+
config?: ImportFileConfig;
|
|
4324
|
+
}
|
|
4325
|
+
|
|
4326
|
+
/** Response for ImportFile to import a File API file with a file search store. */
|
|
4327
|
+
export declare class ImportFileResponse {
|
|
4328
|
+
/** Used to retain the full HTTP response. */
|
|
4329
|
+
sdkHttpResponse?: HttpResponse;
|
|
4330
|
+
/** The name of the FileSearchStore containing Documents. */
|
|
4331
|
+
parent?: string;
|
|
4332
|
+
/** The identifier for the Document imported. */
|
|
4333
|
+
documentName?: string;
|
|
4334
|
+
}
|
|
4335
|
+
|
|
3873
4336
|
/** Config for `inlined_embedding_responses` parameter. */
|
|
3874
4337
|
export declare class InlinedEmbedContentResponse {
|
|
3875
4338
|
/** The response to the request.
|
|
@@ -4060,7 +4523,38 @@ export declare class ListCachedContentsResponse {
|
|
|
4060
4523
|
cachedContents?: CachedContent[];
|
|
4061
4524
|
}
|
|
4062
4525
|
|
|
4063
|
-
/**
|
|
4526
|
+
/** Config for optional parameters. */
|
|
4527
|
+
export declare interface ListDocumentsConfig {
|
|
4528
|
+
/** Used to override HTTP request options. */
|
|
4529
|
+
httpOptions?: HttpOptions;
|
|
4530
|
+
/** Abort signal which can be used to cancel the request.
|
|
4531
|
+
|
|
4532
|
+
NOTE: AbortSignal is a client-only operation. Using it to cancel an
|
|
4533
|
+
operation will not cancel the request in the service. You will still
|
|
4534
|
+
be charged usage for any applicable operations.
|
|
4535
|
+
*/
|
|
4536
|
+
abortSignal?: AbortSignal;
|
|
4537
|
+
pageSize?: number;
|
|
4538
|
+
pageToken?: string;
|
|
4539
|
+
}
|
|
4540
|
+
|
|
4541
|
+
/** Config for documents.list parameters. */
|
|
4542
|
+
export declare interface ListDocumentsParameters {
|
|
4543
|
+
/** The resource name of the FileSearchStores. Example: `fileSearchStore/file-search-store-foo` */
|
|
4544
|
+
parent: string;
|
|
4545
|
+
config?: ListDocumentsConfig;
|
|
4546
|
+
}
|
|
4547
|
+
|
|
4548
|
+
/** Config for documents.list return value. */
|
|
4549
|
+
export declare class ListDocumentsResponse {
|
|
4550
|
+
/** Used to retain the full HTTP response. */
|
|
4551
|
+
sdkHttpResponse?: HttpResponse;
|
|
4552
|
+
/** A token, which can be sent as `page_token` to retrieve the next page. If this field is omitted, there are no more pages. */
|
|
4553
|
+
nextPageToken?: string;
|
|
4554
|
+
/** The returned `Document`s. */
|
|
4555
|
+
documents?: Document_2[];
|
|
4556
|
+
}
|
|
4557
|
+
|
|
4064
4558
|
export declare interface ListFilesConfig {
|
|
4065
4559
|
/** Used to override HTTP request options. */
|
|
4066
4560
|
httpOptions?: HttpOptions;
|
|
@@ -4075,6 +4569,36 @@ export declare interface ListFilesConfig {
|
|
|
4075
4569
|
pageToken?: string;
|
|
4076
4570
|
}
|
|
4077
4571
|
|
|
4572
|
+
/** Optional parameters for listing FileSearchStore. */
|
|
4573
|
+
export declare interface ListFileSearchStoresConfig {
|
|
4574
|
+
/** Used to override HTTP request options. */
|
|
4575
|
+
httpOptions?: HttpOptions;
|
|
4576
|
+
/** Abort signal which can be used to cancel the request.
|
|
4577
|
+
|
|
4578
|
+
NOTE: AbortSignal is a client-only operation. Using it to cancel an
|
|
4579
|
+
operation will not cancel the request in the service. You will still
|
|
4580
|
+
be charged usage for any applicable operations.
|
|
4581
|
+
*/
|
|
4582
|
+
abortSignal?: AbortSignal;
|
|
4583
|
+
pageSize?: number;
|
|
4584
|
+
pageToken?: string;
|
|
4585
|
+
}
|
|
4586
|
+
|
|
4587
|
+
/** Config for file_search_stores.list parameters. */
|
|
4588
|
+
export declare interface ListFileSearchStoresParameters {
|
|
4589
|
+
/** Optional parameters for the list request. */
|
|
4590
|
+
config?: ListFileSearchStoresConfig;
|
|
4591
|
+
}
|
|
4592
|
+
|
|
4593
|
+
/** Config for file_search_stores.list return value. */
|
|
4594
|
+
export declare class ListFileSearchStoresResponse {
|
|
4595
|
+
/** Used to retain the full HTTP response. */
|
|
4596
|
+
sdkHttpResponse?: HttpResponse;
|
|
4597
|
+
nextPageToken?: string;
|
|
4598
|
+
/** The returned file search stores. */
|
|
4599
|
+
fileSearchStores?: FileSearchStore[];
|
|
4600
|
+
}
|
|
4601
|
+
|
|
4078
4602
|
/** Generates the parameters for the list method. */
|
|
4079
4603
|
export declare interface ListFilesParameters {
|
|
4080
4604
|
/** Used to override the default configuration. */
|
|
@@ -5108,6 +5632,28 @@ export declare interface Model {
|
|
|
5108
5632
|
defaultCheckpointId?: string;
|
|
5109
5633
|
/** The checkpoints of the model. */
|
|
5110
5634
|
checkpoints?: Checkpoint[];
|
|
5635
|
+
/** Temperature value used for sampling set when the dataset was saved.
|
|
5636
|
+
This value is used to tune the degree of randomness. */
|
|
5637
|
+
temperature?: number;
|
|
5638
|
+
/** The maximum temperature value used for sampling set when the
|
|
5639
|
+
dataset was saved. This value is used to tune the degree of randomness. */
|
|
5640
|
+
maxTemperature?: number;
|
|
5641
|
+
/** Optional. Specifies the nucleus sampling threshold. The model
|
|
5642
|
+
considers only the smallest set of tokens whose cumulative probability is
|
|
5643
|
+
at least `top_p`. This helps generate more diverse and less repetitive
|
|
5644
|
+
responses. For example, a `top_p` of 0.9 means the model considers tokens
|
|
5645
|
+
until the cumulative probability of the tokens to select from reaches 0.9.
|
|
5646
|
+
It's recommended to adjust either temperature or `top_p`, but not both. */
|
|
5647
|
+
topP?: number;
|
|
5648
|
+
/** Optional. Specifies the top-k sampling threshold. The model
|
|
5649
|
+
considers only the top k most probable tokens for the next token. This can
|
|
5650
|
+
be useful for generating more coherent and less random text. For example,
|
|
5651
|
+
a `top_k` of 40 means the model will choose the next word from the 40 most
|
|
5652
|
+
likely words. */
|
|
5653
|
+
topK?: number;
|
|
5654
|
+
/** Whether the model supports thinking features. If true, thoughts are
|
|
5655
|
+
returned only if the model supports thought and thoughts are available. */
|
|
5656
|
+
thinking?: boolean;
|
|
5111
5657
|
}
|
|
5112
5658
|
|
|
5113
5659
|
export declare class Models extends BaseModule {
|
|
@@ -5529,7 +6075,7 @@ export declare interface Operation<T> {
|
|
|
5529
6075
|
* Instantiates an Operation of the same type as the one being called with the fields set from the API response.
|
|
5530
6076
|
* @internal
|
|
5531
6077
|
*/
|
|
5532
|
-
_fromAPIResponse({ apiResponse,
|
|
6078
|
+
_fromAPIResponse({ apiResponse, _isVertexAI, }: OperationFromAPIResponseParameters): Operation<T>;
|
|
5533
6079
|
}
|
|
5534
6080
|
|
|
5535
6081
|
/** Parameters of the fromAPIResponse method of the Operation class. */
|
|
@@ -5537,7 +6083,7 @@ export declare interface OperationFromAPIResponseParameters {
|
|
|
5537
6083
|
/** The API response to be converted to an Operation. */
|
|
5538
6084
|
apiResponse: Record<string, unknown>;
|
|
5539
6085
|
/** Whether the API response is from Vertex AI. */
|
|
5540
|
-
|
|
6086
|
+
_isVertexAI: boolean;
|
|
5541
6087
|
}
|
|
5542
6088
|
|
|
5543
6089
|
/** Parameters for the get method of the operations module. */
|
|
@@ -5595,7 +6141,7 @@ export declare enum PagedItem {
|
|
|
5595
6141
|
PAGED_ITEM_TUNING_JOBS = "tuningJobs",
|
|
5596
6142
|
PAGED_ITEM_FILES = "files",
|
|
5597
6143
|
PAGED_ITEM_CACHED_CONTENTS = "cachedContents",
|
|
5598
|
-
|
|
6144
|
+
PAGED_ITEM_FILE_SEARCH_STORES = "fileSearchStores",
|
|
5599
6145
|
PAGED_ITEM_DOCUMENTS = "documents"
|
|
5600
6146
|
}
|
|
5601
6147
|
|
|
@@ -5615,7 +6161,7 @@ declare interface PagedItemResponse<T> {
|
|
|
5615
6161
|
tuningJobs?: T[];
|
|
5616
6162
|
files?: T[];
|
|
5617
6163
|
cachedContents?: T[];
|
|
5618
|
-
|
|
6164
|
+
fileSearchStores?: T[];
|
|
5619
6165
|
documents?: T[];
|
|
5620
6166
|
}
|
|
5621
6167
|
|
|
@@ -5780,6 +6326,38 @@ export declare enum PersonGeneration {
|
|
|
5780
6326
|
ALLOW_ALL = "ALLOW_ALL"
|
|
5781
6327
|
}
|
|
5782
6328
|
|
|
6329
|
+
/** Sites with confidence level chosen & above this value will be blocked from the search results. This enum is not supported in Gemini API. */
|
|
6330
|
+
export declare enum PhishBlockThreshold {
|
|
6331
|
+
/**
|
|
6332
|
+
* Defaults to unspecified.
|
|
6333
|
+
*/
|
|
6334
|
+
PHISH_BLOCK_THRESHOLD_UNSPECIFIED = "PHISH_BLOCK_THRESHOLD_UNSPECIFIED",
|
|
6335
|
+
/**
|
|
6336
|
+
* Blocks Low and above confidence URL that is risky.
|
|
6337
|
+
*/
|
|
6338
|
+
BLOCK_LOW_AND_ABOVE = "BLOCK_LOW_AND_ABOVE",
|
|
6339
|
+
/**
|
|
6340
|
+
* Blocks Medium and above confidence URL that is risky.
|
|
6341
|
+
*/
|
|
6342
|
+
BLOCK_MEDIUM_AND_ABOVE = "BLOCK_MEDIUM_AND_ABOVE",
|
|
6343
|
+
/**
|
|
6344
|
+
* Blocks High and above confidence URL that is risky.
|
|
6345
|
+
*/
|
|
6346
|
+
BLOCK_HIGH_AND_ABOVE = "BLOCK_HIGH_AND_ABOVE",
|
|
6347
|
+
/**
|
|
6348
|
+
* Blocks Higher and above confidence URL that is risky.
|
|
6349
|
+
*/
|
|
6350
|
+
BLOCK_HIGHER_AND_ABOVE = "BLOCK_HIGHER_AND_ABOVE",
|
|
6351
|
+
/**
|
|
6352
|
+
* Blocks Very high and above confidence URL that is risky.
|
|
6353
|
+
*/
|
|
6354
|
+
BLOCK_VERY_HIGH_AND_ABOVE = "BLOCK_VERY_HIGH_AND_ABOVE",
|
|
6355
|
+
/**
|
|
6356
|
+
* Blocks Extremely high confidence URL that is risky.
|
|
6357
|
+
*/
|
|
6358
|
+
BLOCK_ONLY_EXTREMELY_HIGH = "BLOCK_ONLY_EXTREMELY_HIGH"
|
|
6359
|
+
}
|
|
6360
|
+
|
|
5783
6361
|
/** The configuration for the prebuilt speaker to use. */
|
|
5784
6362
|
export declare interface PrebuiltVoiceConfig {
|
|
5785
6363
|
/** The name of the preset voice to use. */
|
|
@@ -5820,6 +6398,8 @@ export declare interface PreferenceOptimizationHyperParameters {
|
|
|
5820
6398
|
|
|
5821
6399
|
/** Preference optimization tuning spec for tuning. */
|
|
5822
6400
|
export declare interface PreferenceOptimizationSpec {
|
|
6401
|
+
/** 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. */
|
|
6402
|
+
exportLastCheckpointOnly?: boolean;
|
|
5823
6403
|
/** Optional. Hyperparameters for Preference Optimization. */
|
|
5824
6404
|
hyperParameters?: PreferenceOptimizationHyperParameters;
|
|
5825
6405
|
/** Required. Cloud Storage path to file containing training dataset for preference optimization tuning. The dataset must be formatted as a JSONL file. */
|
|
@@ -6542,11 +7122,11 @@ export declare interface SlidingWindow {
|
|
|
6542
7122
|
targetTokens?: string;
|
|
6543
7123
|
}
|
|
6544
7124
|
|
|
6545
|
-
/**
|
|
7125
|
+
/** Configuration for a single speaker in a multi speaker setup. */
|
|
6546
7126
|
export declare interface SpeakerVoiceConfig {
|
|
6547
|
-
/** Required. The name of the speaker
|
|
7127
|
+
/** Required. The name of the speaker. This should be the same as the speaker name used in the prompt. */
|
|
6548
7128
|
speaker?: string;
|
|
6549
|
-
/** Required. The configuration for the voice
|
|
7129
|
+
/** Required. The configuration for the voice of this speaker. */
|
|
6550
7130
|
voiceConfig?: VoiceConfig;
|
|
6551
7131
|
}
|
|
6552
7132
|
|
|
@@ -6578,6 +7158,12 @@ export declare enum StartSensitivity {
|
|
|
6578
7158
|
START_SENSITIVITY_LOW = "START_SENSITIVITY_LOW"
|
|
6579
7159
|
}
|
|
6580
7160
|
|
|
7161
|
+
/** User provided string values assigned to a single metadata key. This data type is not supported in Vertex AI. */
|
|
7162
|
+
export declare interface StringList {
|
|
7163
|
+
/** The string values of the metadata to store. */
|
|
7164
|
+
values?: string[];
|
|
7165
|
+
}
|
|
7166
|
+
|
|
6581
7167
|
/** Configuration for a Style reference image. */
|
|
6582
7168
|
export declare interface StyleReferenceConfig {
|
|
6583
7169
|
/** A text description of the style to use for the generated image. */
|
|
@@ -6869,19 +7455,20 @@ export declare interface Tool {
|
|
|
6869
7455
|
functionDeclarations?: FunctionDeclaration[];
|
|
6870
7456
|
/** 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. */
|
|
6871
7457
|
retrieval?: Retrieval;
|
|
6872
|
-
/** Optional.
|
|
7458
|
+
/** Optional. Specialized retrieval tool that is powered by Google Search. */
|
|
6873
7459
|
googleSearchRetrieval?: GoogleSearchRetrieval;
|
|
6874
|
-
/** Optional. Google Maps tool type. Specialized retrieval tool
|
|
6875
|
-
that is powered by Google Maps. */
|
|
6876
|
-
googleMaps?: GoogleMaps;
|
|
6877
7460
|
/** Optional. Tool to support the model interacting directly with the
|
|
6878
7461
|
computer. If enabled, it automatically populates computer-use specific
|
|
6879
7462
|
Function Declarations. */
|
|
6880
7463
|
computerUse?: ComputerUse;
|
|
7464
|
+
/** Optional. Tool to retrieve knowledge from the File Search Stores. */
|
|
7465
|
+
fileSearch?: FileSearch;
|
|
6881
7466
|
/** Optional. CodeExecution tool type. Enables the model to execute code as part of generation. */
|
|
6882
7467
|
codeExecution?: ToolCodeExecution;
|
|
6883
7468
|
/** Optional. Tool to support searching public web data, powered by Vertex AI Search and Sec4 compliance. This field is not supported in Gemini API. */
|
|
6884
7469
|
enterpriseWebSearch?: EnterpriseWebSearch;
|
|
7470
|
+
/** Optional. GoogleMaps tool type. Tool to support Google Maps in Model. */
|
|
7471
|
+
googleMaps?: GoogleMaps;
|
|
6885
7472
|
/** Optional. GoogleSearch tool type. Tool to support Google Search in Model. Powered by Google. */
|
|
6886
7473
|
googleSearch?: GoogleSearch;
|
|
6887
7474
|
/** Optional. Tool to support URL context retrieval. */
|
|
@@ -6906,14 +7493,14 @@ export declare type ToolListUnion = ToolUnion[];
|
|
|
6906
7493
|
|
|
6907
7494
|
export declare type ToolUnion = Tool | CallableTool;
|
|
6908
7495
|
|
|
6909
|
-
/** Output only.
|
|
7496
|
+
/** Output only. The traffic type for this request. This enum is not supported in Gemini API. */
|
|
6910
7497
|
export declare enum TrafficType {
|
|
6911
7498
|
/**
|
|
6912
7499
|
* Unspecified request traffic type.
|
|
6913
7500
|
*/
|
|
6914
7501
|
TRAFFIC_TYPE_UNSPECIFIED = "TRAFFIC_TYPE_UNSPECIFIED",
|
|
6915
7502
|
/**
|
|
6916
|
-
*
|
|
7503
|
+
* The request was processed using Pay-As-You-Go quota.
|
|
6917
7504
|
*/
|
|
6918
7505
|
ON_DEMAND = "ON_DEMAND",
|
|
6919
7506
|
/**
|
|
@@ -7054,7 +7641,7 @@ export declare interface TuningJob {
|
|
|
7054
7641
|
pipelineJob?: string;
|
|
7055
7642
|
/** 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. */
|
|
7056
7643
|
serviceAccount?: string;
|
|
7057
|
-
/** Optional. The display name of the TunedModel. The name can be up to 128 characters long and can consist of any UTF-8 characters. */
|
|
7644
|
+
/** 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. */
|
|
7058
7645
|
tunedModelDisplayName?: string;
|
|
7059
7646
|
/** Tuning Spec for Veo Tuning. */
|
|
7060
7647
|
veoTuningSpec?: VeoTuningSpec;
|
|
@@ -7166,7 +7753,11 @@ export declare enum TuningTask {
|
|
|
7166
7753
|
/**
|
|
7167
7754
|
* Tuning task for text to video.
|
|
7168
7755
|
*/
|
|
7169
|
-
TUNING_TASK_T2V = "TUNING_TASK_T2V"
|
|
7756
|
+
TUNING_TASK_T2V = "TUNING_TASK_T2V",
|
|
7757
|
+
/**
|
|
7758
|
+
* Tuning task for reference to video.
|
|
7759
|
+
*/
|
|
7760
|
+
TUNING_TASK_R2V = "TUNING_TASK_R2V"
|
|
7170
7761
|
}
|
|
7171
7762
|
|
|
7172
7763
|
export declare interface TuningValidationDataset {
|
|
@@ -7266,8 +7857,10 @@ declare namespace types {
|
|
|
7266
7857
|
FunctionResponseScheduling,
|
|
7267
7858
|
Type,
|
|
7268
7859
|
Mode,
|
|
7269
|
-
AuthType,
|
|
7270
7860
|
ApiSpec,
|
|
7861
|
+
AuthType,
|
|
7862
|
+
HttpElementLocation,
|
|
7863
|
+
PhishBlockThreshold,
|
|
7271
7864
|
HarmCategory,
|
|
7272
7865
|
HarmBlockMethod,
|
|
7273
7866
|
HarmBlockThreshold,
|
|
@@ -7300,6 +7893,7 @@ declare namespace types {
|
|
|
7300
7893
|
VideoGenerationMaskMode,
|
|
7301
7894
|
VideoCompressionQuality,
|
|
7302
7895
|
TuningMethod,
|
|
7896
|
+
DocumentState,
|
|
7303
7897
|
FileState,
|
|
7304
7898
|
FileSource,
|
|
7305
7899
|
TurnCompleteReason,
|
|
@@ -7329,16 +7923,16 @@ declare namespace types {
|
|
|
7329
7923
|
FunctionDeclaration,
|
|
7330
7924
|
DynamicRetrievalConfig,
|
|
7331
7925
|
GoogleSearchRetrieval,
|
|
7926
|
+
ComputerUse,
|
|
7927
|
+
FileSearch,
|
|
7928
|
+
ApiAuthApiKeyConfig,
|
|
7929
|
+
ApiAuth,
|
|
7332
7930
|
ApiKeyConfig,
|
|
7333
7931
|
AuthConfigGoogleServiceAccountConfig,
|
|
7334
7932
|
AuthConfigHttpBasicAuthConfig,
|
|
7335
7933
|
AuthConfigOauthConfig,
|
|
7336
7934
|
AuthConfigOidcConfig,
|
|
7337
7935
|
AuthConfig,
|
|
7338
|
-
GoogleMaps,
|
|
7339
|
-
ComputerUse,
|
|
7340
|
-
ApiAuthApiKeyConfig,
|
|
7341
|
-
ApiAuth,
|
|
7342
7936
|
ExternalApiElasticSearchParams,
|
|
7343
7937
|
ExternalApiSimpleSearchParams,
|
|
7344
7938
|
ExternalApi,
|
|
@@ -7355,6 +7949,7 @@ declare namespace types {
|
|
|
7355
7949
|
Retrieval,
|
|
7356
7950
|
ToolCodeExecution,
|
|
7357
7951
|
EnterpriseWebSearch,
|
|
7952
|
+
GoogleMaps,
|
|
7358
7953
|
Interval,
|
|
7359
7954
|
GoogleSearch,
|
|
7360
7955
|
UrlContext,
|
|
@@ -7524,6 +8119,35 @@ declare namespace types {
|
|
|
7524
8119
|
ListCachedContentsConfig,
|
|
7525
8120
|
ListCachedContentsParameters,
|
|
7526
8121
|
ListCachedContentsResponse,
|
|
8122
|
+
GetDocumentConfig,
|
|
8123
|
+
GetDocumentParameters,
|
|
8124
|
+
StringList,
|
|
8125
|
+
CustomMetadata,
|
|
8126
|
+
Document_2 as Document,
|
|
8127
|
+
DeleteDocumentConfig,
|
|
8128
|
+
DeleteDocumentParameters,
|
|
8129
|
+
ListDocumentsConfig,
|
|
8130
|
+
ListDocumentsParameters,
|
|
8131
|
+
ListDocumentsResponse,
|
|
8132
|
+
CreateFileSearchStoreConfig,
|
|
8133
|
+
CreateFileSearchStoreParameters,
|
|
8134
|
+
FileSearchStore,
|
|
8135
|
+
GetFileSearchStoreConfig,
|
|
8136
|
+
GetFileSearchStoreParameters,
|
|
8137
|
+
DeleteFileSearchStoreConfig,
|
|
8138
|
+
DeleteFileSearchStoreParameters,
|
|
8139
|
+
ListFileSearchStoresConfig,
|
|
8140
|
+
ListFileSearchStoresParameters,
|
|
8141
|
+
ListFileSearchStoresResponse,
|
|
8142
|
+
WhiteSpaceConfig,
|
|
8143
|
+
ChunkingConfig,
|
|
8144
|
+
UploadToFileSearchStoreConfig,
|
|
8145
|
+
UploadToFileSearchStoreParameters,
|
|
8146
|
+
UploadToFileSearchStoreResumableResponse,
|
|
8147
|
+
ImportFileConfig,
|
|
8148
|
+
ImportFileParameters,
|
|
8149
|
+
ImportFileResponse,
|
|
8150
|
+
ImportFileOperation,
|
|
7527
8151
|
ListFilesConfig,
|
|
7528
8152
|
ListFilesParameters,
|
|
7529
8153
|
FileStatus,
|
|
@@ -7546,6 +8170,7 @@ declare namespace types {
|
|
|
7546
8170
|
BatchJobDestination,
|
|
7547
8171
|
CreateBatchJobConfig,
|
|
7548
8172
|
CreateBatchJobParameters,
|
|
8173
|
+
CompletionStats,
|
|
7549
8174
|
BatchJob,
|
|
7550
8175
|
EmbedContentBatch,
|
|
7551
8176
|
EmbeddingsBatchJobSource,
|
|
@@ -7638,6 +8263,8 @@ declare namespace types {
|
|
|
7638
8263
|
CreateAuthTokenParameters,
|
|
7639
8264
|
OperationGetParameters,
|
|
7640
8265
|
CreateTuningJobParameters,
|
|
8266
|
+
UploadToFileSearchStoreResponse,
|
|
8267
|
+
UploadToFileSearchStoreOperation,
|
|
7641
8268
|
BlobImageUnion,
|
|
7642
8269
|
PartUnion,
|
|
7643
8270
|
PartListUnion,
|
|
@@ -7713,6 +8340,17 @@ declare interface Uploader {
|
|
|
7713
8340
|
* @return A Promise that resolves to types.File.
|
|
7714
8341
|
*/
|
|
7715
8342
|
upload(file: string | Blob, uploadUrl: string, apiClient: ApiClient): Promise<File_2>;
|
|
8343
|
+
/**
|
|
8344
|
+
* Uploads a file to file search store via the given upload url.
|
|
8345
|
+
*
|
|
8346
|
+
* @param file The file to upload. file is in string type or a Blob.
|
|
8347
|
+
* @param uploadUrl The upload URL as a string is where the file will be
|
|
8348
|
+
* uploaded to. The uploadUrl must be a url that was returned by the
|
|
8349
|
+
* https://generativelanguage.googleapis.com/upload/v1beta/{file_search_store_name}:uploadToFileSearchStore endpoint
|
|
8350
|
+
* @param apiClient The ApiClient to use for uploading.
|
|
8351
|
+
* @return A Promise that resolves to types.UploadToFileSearchStoreOperation.
|
|
8352
|
+
*/
|
|
8353
|
+
uploadToFileSearchStore(file: string | Blob, uploadUrl: string, apiClient: ApiClient): Promise<UploadToFileSearchStoreOperation>;
|
|
7716
8354
|
/**
|
|
7717
8355
|
* Returns the file's mimeType and the size of a given file. If the file is a
|
|
7718
8356
|
* string path, the file type is determined by the file extension. If the
|
|
@@ -7751,6 +8389,82 @@ export declare interface UploadFileParameters {
|
|
|
7751
8389
|
config?: UploadFileConfig;
|
|
7752
8390
|
}
|
|
7753
8391
|
|
|
8392
|
+
/** Optional parameters for uploading a file to a FileSearchStore. */
|
|
8393
|
+
export declare interface UploadToFileSearchStoreConfig {
|
|
8394
|
+
/** Used to override HTTP request options. */
|
|
8395
|
+
httpOptions?: HttpOptions;
|
|
8396
|
+
/** Abort signal which can be used to cancel the request.
|
|
8397
|
+
|
|
8398
|
+
NOTE: AbortSignal is a client-only operation. Using it to cancel an
|
|
8399
|
+
operation will not cancel the request in the service. You will still
|
|
8400
|
+
be charged usage for any applicable operations.
|
|
8401
|
+
*/
|
|
8402
|
+
abortSignal?: AbortSignal;
|
|
8403
|
+
/** MIME type of the file to be uploaded. If not provided, it will be inferred from the file extension. */
|
|
8404
|
+
mimeType?: string;
|
|
8405
|
+
/** Display name of the created document. */
|
|
8406
|
+
displayName?: string;
|
|
8407
|
+
/** User provided custom metadata stored as key-value pairs used for querying. */
|
|
8408
|
+
customMetadata?: CustomMetadata[];
|
|
8409
|
+
/** Config for telling the service how to chunk the file. */
|
|
8410
|
+
chunkingConfig?: ChunkingConfig;
|
|
8411
|
+
}
|
|
8412
|
+
|
|
8413
|
+
/** Long-running operation for uploading a file to a FileSearchStore. */
|
|
8414
|
+
export declare class UploadToFileSearchStoreOperation implements Operation<UploadToFileSearchStoreResponse> {
|
|
8415
|
+
/** 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}`. */
|
|
8416
|
+
name?: string;
|
|
8417
|
+
/** 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. */
|
|
8418
|
+
metadata?: Record<string, unknown>;
|
|
8419
|
+
/** 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. */
|
|
8420
|
+
done?: boolean;
|
|
8421
|
+
/** The error result of the operation in case of failure or cancellation. */
|
|
8422
|
+
error?: Record<string, unknown>;
|
|
8423
|
+
/** The result of the UploadToFileSearchStore operation, available when the operation is done. */
|
|
8424
|
+
response?: UploadToFileSearchStoreResponse;
|
|
8425
|
+
/**
|
|
8426
|
+
* Instantiates an Operation of the same type as the one being called with the fields set from the API response.
|
|
8427
|
+
* @internal
|
|
8428
|
+
*/
|
|
8429
|
+
_fromAPIResponse({ apiResponse, _isVertexAI, }: OperationFromAPIResponseParameters): Operation<UploadToFileSearchStoreResponse>;
|
|
8430
|
+
/** The full HTTP response. */
|
|
8431
|
+
sdkHttpResponse?: HttpResponse;
|
|
8432
|
+
}
|
|
8433
|
+
|
|
8434
|
+
/** Generates the parameters for the private _upload_to_file_search_store method. */
|
|
8435
|
+
export declare interface UploadToFileSearchStoreParameters {
|
|
8436
|
+
/** The resource name of the FileSearchStore. Example: `fileSearchStores/my-file-search-store-123` */
|
|
8437
|
+
fileSearchStoreName: string;
|
|
8438
|
+
/** Used to override the default configuration. */
|
|
8439
|
+
config?: UploadToFileSearchStoreConfig;
|
|
8440
|
+
}
|
|
8441
|
+
|
|
8442
|
+
/** Parameters for the upload file to file search store method. */
|
|
8443
|
+
export declare interface UploadToFileSearchStoreParameters {
|
|
8444
|
+
/** The name of the file search store to upload. */
|
|
8445
|
+
fileSearchStoreName: string;
|
|
8446
|
+
/** The string path to the file to be uploaded or a Blob object. */
|
|
8447
|
+
file: string | globalThis.Blob;
|
|
8448
|
+
/** Configuration that contains optional parameters. */
|
|
8449
|
+
config?: UploadToFileSearchStoreConfig;
|
|
8450
|
+
}
|
|
8451
|
+
|
|
8452
|
+
/** The response when long-running operation for uploading a file to a FileSearchStore complete. */
|
|
8453
|
+
export declare class UploadToFileSearchStoreResponse {
|
|
8454
|
+
/** Used to retain the full HTTP response. */
|
|
8455
|
+
sdkHttpResponse?: HttpResponse;
|
|
8456
|
+
/** The name of the FileSearchStore containing Documents. */
|
|
8457
|
+
parent?: string;
|
|
8458
|
+
/** The identifier for the Document imported. */
|
|
8459
|
+
documentName?: string;
|
|
8460
|
+
}
|
|
8461
|
+
|
|
8462
|
+
/** Response for the resumable upload method. */
|
|
8463
|
+
export declare class UploadToFileSearchStoreResumableResponse {
|
|
8464
|
+
/** Used to retain the full HTTP response. */
|
|
8465
|
+
sdkHttpResponse?: HttpResponse;
|
|
8466
|
+
}
|
|
8467
|
+
|
|
7754
8468
|
/** Configuration for upscaling an image.
|
|
7755
8469
|
|
|
7756
8470
|
For more information on this configuration, refer to
|
|
@@ -8096,4 +8810,12 @@ export declare interface WeightedPrompt {
|
|
|
8096
8810
|
weight?: number;
|
|
8097
8811
|
}
|
|
8098
8812
|
|
|
8813
|
+
/** Configuration for a white space chunking algorithm. */
|
|
8814
|
+
export declare interface WhiteSpaceConfig {
|
|
8815
|
+
/** Maximum number of tokens per chunk. */
|
|
8816
|
+
maxTokensPerChunk?: number;
|
|
8817
|
+
/** Maximum number of overlapping tokens between two adjacent chunks. */
|
|
8818
|
+
maxOverlapTokens?: number;
|
|
8819
|
+
}
|
|
8820
|
+
|
|
8099
8821
|
export { }
|