VectorSearchService provides methods for managing Collection resources, and Collection Index resources. The primary resources offered by this service are Collections which are a container for a set of related JSON data objects, and Collection Indexes which enable efficient ANN search across data objects within a Collection. v1beta
Package
@google-cloud/vectorsearchConstructors
(constructor)(opts, gaxInstance)
constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback);Construct an instance of VectorSearchServiceClient.
| Parameters | |
|---|---|
| Name | Description |
opts |
ClientOptions
|
gaxInstance |
typeof gax | typeof fallback
: loaded instance of |
Properties
apiEndpoint
get apiEndpoint(): string;The DNS address for this API service.
apiEndpoint
static get apiEndpoint(): string;The DNS address for this API service - same as servicePath.
auth
auth: gax.GoogleAuth;descriptors
descriptors: Descriptors;innerApiCalls
innerApiCalls: {
[name: string]: Function;
};locationsClient
locationsClient: LocationsClient;operationsClient
operationsClient: gax.OperationsClient;pathTemplates
pathTemplates: {
[name: string]: gax.PathTemplate;
};port
static get port(): number;The port for this API service.
scopes
static get scopes(): string[];The scopes needed to make gRPC calls for every method defined in this service.
servicePath
static get servicePath(): string;The DNS address for this API service.
universeDomain
get universeDomain(): string;vectorSearchServiceStub
vectorSearchServiceStub?: Promise<{
[name: string]: Function;
}>;warn
warn: (code: string, message: string, warnType?: string) => void;Methods
cancelOperation(request, optionsOrCallback, callback)
cancelOperation(request: protos.google.longrunning.CancelOperationRequest, optionsOrCallback?: gax.CallOptions | Callback<protos.google.longrunning.CancelOperationRequest, protos.google.protobuf.Empty, {} | undefined | null>, callback?: Callback<protos.google.longrunning.CancelOperationRequest, protos.google.protobuf.Empty, {} | undefined | null>): Promise<protos.google.protobuf.Empty>;Starts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed. If the server doesn't support this method, it returns google.rpc.Code.UNIMPLEMENTED. Clients can use or other methods to check whether the cancellation succeeded or whether the operation completed despite cancellation. On successful cancellation, the operation is not deleted; instead, it becomes an operation with an value with a of 1, corresponding to Code.CANCELLED.
| Parameters | |
|---|---|
| Name | Description |
request |
CancelOperationRequest
The request object that will be sent. |
optionsOrCallback |
CallOptions | Callback<protos.google.longrunning.CancelOperationRequest, protos.google.protobuf.Empty, {} | undefined | null>
|
callback |
Callback<protos.google.longrunning.CancelOperationRequest, protos.google.protobuf.Empty, {} | undefined | null>
The function which will be called with the result of the API call. {Promise} - The promise which resolves when API call finishes. The promise has a method named "cancel" which cancels the ongoing API call. |
| Returns | |
|---|---|
| Type | Description |
Promise<protos.google.protobuf.Empty> |
|
const client = longrunning.operationsClient();
await client.cancelOperation({name: ''});
checkCreateCollectionProgress(name)
checkCreateCollectionProgress(name: string): Promise<LROperation<protos.google.cloud.vectorsearch.v1beta.Collection, protos.google.cloud.vectorsearch.v1beta.OperationMetadata>>;Check the status of the long running operation returned by createCollection().
| Parameter | |
|---|---|
| Name | Description |
name |
string
The operation name that will be passed. |
| Returns | |
|---|---|
| Type | Description |
Promise<LROperation<protos.google.cloud.vectorsearch.v1beta.Collection, protos.google.cloud.vectorsearch.v1beta.OperationMetadata>> |
{Promise} - The promise which resolves to an object. The decoded operation object has result and metadata field to get information from. Please see the documentation for more details and examples. |
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. Value for parent.
*/
// const parent = 'abc123'
/**
* Required. ID of the Collection to create.
* The id must be 1-63 characters long, and comply with
* RFC1035.
* Specifically, it must be 1-63 characters long and match the regular
* expression `[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?`.
*/
// const collectionId = 'abc123'
/**
* Required. The resource being created
*/
// const collection = {}
/**
* Optional. An optional request ID to identify requests. Specify a unique
* request ID so that if you must retry your request, the server will know to
* ignore the request if it has already been completed. The server will
* guarantee that for at least 60 minutes since the first request.
* For example, consider a situation where you make an initial request and the
* request times out. If you make the request again with the same request
* ID, the server can check if original operation with the same request ID
* was received, and if so, will ignore the second request. This prevents
* clients from accidentally creating duplicate commitments.
* The request ID must be a valid UUID with the exception that zero UUID is
* not supported (00000000-0000-0000-0000-000000000000).
*/
// const requestId = 'abc123'
// Imports the Vectorsearch library
const {VectorSearchServiceClient} = require('@google-cloud/vectorsearch').v1beta;
// Instantiates a client
const vectorsearchClient = new VectorSearchServiceClient();
async function callCreateCollection() {
// Construct request
const request = {
parent,
collectionId,
collection,
};
// Run request
const [operation] = await vectorsearchClient.createCollection(request);
const [response] = await operation.promise();
console.log(response);
}
callCreateCollection();
checkCreateIndexProgress(name)
checkCreateIndexProgress(name: string): Promise<LROperation<protos.google.cloud.vectorsearch.v1beta.Index, protos.google.cloud.vectorsearch.v1beta.OperationMetadata>>;Check the status of the long running operation returned by createIndex().
| Parameter | |
|---|---|
| Name | Description |
name |
string
The operation name that will be passed. |
| Returns | |
|---|---|
| Type | Description |
Promise<LROperation<protos.google.cloud.vectorsearch.v1beta.Index, protos.google.cloud.vectorsearch.v1beta.OperationMetadata>> |
{Promise} - The promise which resolves to an object. The decoded operation object has result and metadata field to get information from. Please see the documentation for more details and examples. |
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. The resource name of the Collection for which to create the
* Index. Format:
* `projects/{project}/locations/{location}/collections/{collection}`
*/
// const parent = 'abc123'
/**
* Required. ID of the Index to create.
* The id must be 1-63 characters long, and comply with
* RFC1035.
* Specifically, it must be 1-63 characters long and match the regular
* expression `[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?`.
*/
// const indexId = 'abc123'
/**
* Required. The resource being created
*/
// const index = {}
/**
* Optional. An optional request ID to identify requests. Specify a unique
* request ID so that if you must retry your request, the server will know to
* ignore the request if it has already been completed. The server will
* guarantee that for at least 60 minutes since the first request.
* For example, consider a situation where you make an initial request and the
* request times out. If you make the request again with the same request
* ID, the server can check if original operation with the same request ID
* was received, and if so, will ignore the second request. This prevents
* clients from accidentally creating duplicate commitments.
* The request ID must be a valid UUID with the exception that zero UUID is
* not supported (00000000-0000-0000-0000-000000000000).
*/
// const requestId = 'abc123'
// Imports the Vectorsearch library
const {VectorSearchServiceClient} = require('@google-cloud/vectorsearch').v1beta;
// Instantiates a client
const vectorsearchClient = new VectorSearchServiceClient();
async function callCreateIndex() {
// Construct request
const request = {
parent,
indexId,
index,
};
// Run request
const [operation] = await vectorsearchClient.createIndex(request);
const [response] = await operation.promise();
console.log(response);
}
callCreateIndex();
checkDeleteCollectionProgress(name)
checkDeleteCollectionProgress(name: string): Promise<LROperation<protos.google.protobuf.Empty, protos.google.cloud.vectorsearch.v1beta.OperationMetadata>>;Check the status of the long running operation returned by deleteCollection().
| Parameter | |
|---|---|
| Name | Description |
name |
string
The operation name that will be passed. |
| Returns | |
|---|---|
| Type | Description |
Promise<LROperation<protos.google.protobuf.Empty, protos.google.cloud.vectorsearch.v1beta.OperationMetadata>> |
{Promise} - The promise which resolves to an object. The decoded operation object has result and metadata field to get information from. Please see the documentation for more details and examples. |
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. Name of the resource
*/
// const name = 'abc123'
/**
* Optional. An optional request ID to identify requests. Specify a unique
* request ID so that if you must retry your request, the server will know to
* ignore the request if it has already been completed. The server will
* guarantee that for at least 60 minutes after the first request.
* For example, consider a situation where you make an initial request and the
* request times out. If you make the request again with the same request
* ID, the server can check if original operation with the same request ID
* was received, and if so, will ignore the second request. This prevents
* clients from accidentally creating duplicate commitments.
* The request ID must be a valid UUID with the exception that zero UUID is
* not supported (00000000-0000-0000-0000-000000000000).
*/
// const requestId = 'abc123'
// Imports the Vectorsearch library
const {VectorSearchServiceClient} = require('@google-cloud/vectorsearch').v1beta;
// Instantiates a client
const vectorsearchClient = new VectorSearchServiceClient();
async function callDeleteCollection() {
// Construct request
const request = {
name,
};
// Run request
const [operation] = await vectorsearchClient.deleteCollection(request);
const [response] = await operation.promise();
console.log(response);
}
callDeleteCollection();
checkDeleteIndexProgress(name)
checkDeleteIndexProgress(name: string): Promise<LROperation<protos.google.protobuf.Empty, protos.google.cloud.vectorsearch.v1beta.OperationMetadata>>;Check the status of the long running operation returned by deleteIndex().
| Parameter | |
|---|---|
| Name | Description |
name |
string
The operation name that will be passed. |
| Returns | |
|---|---|
| Type | Description |
Promise<LROperation<protos.google.protobuf.Empty, protos.google.cloud.vectorsearch.v1beta.OperationMetadata>> |
{Promise} - The promise which resolves to an object. The decoded operation object has result and metadata field to get information from. Please see the documentation for more details and examples. |
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. The resource name of the Index to delete.
* Format:
* `projects/{project}/locations/{location}/collections/{collection}/indexes/{index}`
*/
// const name = 'abc123'
/**
* Optional. An optional request ID to identify requests. Specify a unique
* request ID so that if you must retry your request, the server will know to
* ignore the request if it has already been completed. The server will
* guarantee that for at least 60 minutes since the first request.
* For example, consider a situation where you make an initial request and the
* request times out. If you make the request again with the same request
* ID, the server can check if original operation with the same request ID
* was received, and if so, will ignore the second request. This prevents
* clients from accidentally creating duplicate commitments.
* The request ID must be a valid UUID with the exception that zero UUID is
* not supported (00000000-0000-0000-0000-000000000000).
*/
// const requestId = 'abc123'
// Imports the Vectorsearch library
const {VectorSearchServiceClient} = require('@google-cloud/vectorsearch').v1beta;
// Instantiates a client
const vectorsearchClient = new VectorSearchServiceClient();
async function callDeleteIndex() {
// Construct request
const request = {
name,
};
// Run request
const [operation] = await vectorsearchClient.deleteIndex(request);
const [response] = await operation.promise();
console.log(response);
}
callDeleteIndex();
checkImportDataObjectsProgress(name)
checkImportDataObjectsProgress(name: string): Promise<LROperation<protos.google.cloud.vectorsearch.v1beta.ImportDataObjectsResponse, protos.google.cloud.vectorsearch.v1beta.ImportDataObjectsMetadata>>;Check the status of the long running operation returned by importDataObjects().
| Parameter | |
|---|---|
| Name | Description |
name |
string
The operation name that will be passed. |
| Returns | |
|---|---|
| Type | Description |
Promise<LROperation<protos.google.cloud.vectorsearch.v1beta.ImportDataObjectsResponse, protos.google.cloud.vectorsearch.v1beta.ImportDataObjectsMetadata>> |
{Promise} - The promise which resolves to an object. The decoded operation object has result and metadata field to get information from. Please see the documentation for more details and examples. |
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* The Cloud Storage location of the input content.
*/
// const gcsImport = {}
/**
* Required. The resource name of the Collection to import DataObjects into.
* Format: `projects/{project}/locations/{location}/collections/{collection}`.
*/
// const name = 'abc123'
// Imports the Vectorsearch library
const {VectorSearchServiceClient} = require('@google-cloud/vectorsearch').v1beta;
// Instantiates a client
const vectorsearchClient = new VectorSearchServiceClient();
async function callImportDataObjects() {
// Construct request
const request = {
name,
};
// Run request
const [operation] = await vectorsearchClient.importDataObjects(request);
const [response] = await operation.promise();
console.log(response);
}
callImportDataObjects();
checkUpdateCollectionProgress(name)
checkUpdateCollectionProgress(name: string): Promise<LROperation<protos.google.cloud.vectorsearch.v1beta.Collection, protos.google.cloud.vectorsearch.v1beta.OperationMetadata>>;Check the status of the long running operation returned by updateCollection().
| Parameter | |
|---|---|
| Name | Description |
name |
string
The operation name that will be passed. |
| Returns | |
|---|---|
| Type | Description |
Promise<LROperation<protos.google.cloud.vectorsearch.v1beta.Collection, protos.google.cloud.vectorsearch.v1beta.OperationMetadata>> |
{Promise} - The promise which resolves to an object. The decoded operation object has result and metadata field to get information from. Please see the documentation for more details and examples. |
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Optional. Field mask is used to specify the fields to be overwritten in the
* Collection resource by the update.
* The fields specified in the update_mask are relative to the resource, not
* the full request. A field will be overwritten if it is in the mask. If the
* user does not provide a mask then all fields present in the request will be
* overwritten.
* The following fields support update: `display_name`, `description`,
* `labels`, `data_schema`, `vector_schema`.
* For `data_schema` and `vector_schema`, fields can only be added, not
* modified or deleted.
* Partial updates for `data_schema` and `vector_schema` are also supported
* by using sub-field paths in `update_mask`, e.g.
* `data_schema.properties.foo` or `vector_schema.my_vector_field`.
* If `*` is provided in the update_mask, full replacement will be performed.
*/
// const updateMask = {}
/**
* Required. The resource being updated
*/
// const collection = {}
/**
* Optional. An optional request ID to identify requests. Specify a unique
* request ID so that if you must retry your request, the server will know to
* ignore the request if it has already been completed. The server will
* guarantee that for at least 60 minutes since the first request.
* For example, consider a situation where you make an initial request and the
* request times out. If you make the request again with the same request
* ID, the server can check if original operation with the same request ID
* was received, and if so, will ignore the second request. This prevents
* clients from accidentally creating duplicate commitments.
* The request ID must be a valid UUID with the exception that zero UUID is
* not supported (00000000-0000-0000-0000-000000000000).
*/
// const requestId = 'abc123'
// Imports the Vectorsearch library
const {VectorSearchServiceClient} = require('@google-cloud/vectorsearch').v1beta;
// Instantiates a client
const vectorsearchClient = new VectorSearchServiceClient();
async function callUpdateCollection() {
// Construct request
const request = {
collection,
};
// Run request
const [operation] = await vectorsearchClient.updateCollection(request);
const [response] = await operation.promise();
console.log(response);
}
callUpdateCollection();
close()
close(): Promise<void>;Terminate the gRPC channel and close the client.
The client will no longer be usable and all future behavior is undefined.
| Returns | |
|---|---|
| Type | Description |
Promise<void> |
{Promise} A promise that resolves when the client is closed. |
collectionPath(project, location, collection)
collectionPath(project: string, location: string, collection: string): string;Return a fully-qualified collection resource name string.
| Parameters | |
|---|---|
| Name | Description |
project |
string
|
location |
string
|
collection |
string
|
| Returns | |
|---|---|
| Type | Description |
string |
{string} Resource name string. |
createCollection(request, options)
createCollection(request?: protos.google.cloud.vectorsearch.v1beta.ICreateCollectionRequest, options?: CallOptions): Promise<[
LROperation<protos.google.cloud.vectorsearch.v1beta.ICollection, protos.google.cloud.vectorsearch.v1beta.IOperationMetadata>,
protos.google.longrunning.IOperation | undefined,
{} | undefined
]>;Creates a new Collection in a given project and location.
| Parameters | |
|---|---|
| Name | Description |
request |
ICreateCollectionRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
| Returns | |
|---|---|
| Type | Description |
Promise<[
LROperation<protos.google.cloud.vectorsearch.v1beta.ICollection, protos.google.cloud.vectorsearch.v1beta.IOperationMetadata>,
protos.google.longrunning.IOperation | undefined,
{} | undefined
]> |
{Promise} - The promise which resolves to an array. The first element of the array is an object representing a long running operation. Its |
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. Value for parent.
*/
// const parent = 'abc123'
/**
* Required. ID of the Collection to create.
* The id must be 1-63 characters long, and comply with
* RFC1035.
* Specifically, it must be 1-63 characters long and match the regular
* expression `[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?`.
*/
// const collectionId = 'abc123'
/**
* Required. The resource being created
*/
// const collection = {}
/**
* Optional. An optional request ID to identify requests. Specify a unique
* request ID so that if you must retry your request, the server will know to
* ignore the request if it has already been completed. The server will
* guarantee that for at least 60 minutes since the first request.
* For example, consider a situation where you make an initial request and the
* request times out. If you make the request again with the same request
* ID, the server can check if original operation with the same request ID
* was received, and if so, will ignore the second request. This prevents
* clients from accidentally creating duplicate commitments.
* The request ID must be a valid UUID with the exception that zero UUID is
* not supported (00000000-0000-0000-0000-000000000000).
*/
// const requestId = 'abc123'
// Imports the Vectorsearch library
const {VectorSearchServiceClient} = require('@google-cloud/vectorsearch').v1beta;
// Instantiates a client
const vectorsearchClient = new VectorSearchServiceClient();
async function callCreateCollection() {
// Construct request
const request = {
parent,
collectionId,
collection,
};
// Run request
const [operation] = await vectorsearchClient.createCollection(request);
const [response] = await operation.promise();
console.log(response);
}
callCreateCollection();
createCollection(request, options, callback)
createCollection(request: protos.google.cloud.vectorsearch.v1beta.ICreateCollectionRequest, options: CallOptions, callback: Callback<LROperation<protos.google.cloud.vectorsearch.v1beta.ICollection, protos.google.cloud.vectorsearch.v1beta.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;| Parameters | |
|---|---|
| Name | Description |
request |
ICreateCollectionRequest
|
options |
CallOptions
|
callback |
Callback<LROperation<protos.google.cloud.vectorsearch.v1beta.ICollection, protos.google.cloud.vectorsearch.v1beta.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
|
| Returns | |
|---|---|
| Type | Description |
void |
|
createCollection(request, callback)
createCollection(request: protos.google.cloud.vectorsearch.v1beta.ICreateCollectionRequest, callback: Callback<LROperation<protos.google.cloud.vectorsearch.v1beta.ICollection, protos.google.cloud.vectorsearch.v1beta.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;| Parameters | |
|---|---|
| Name | Description |
request |
ICreateCollectionRequest
|
callback |
Callback<LROperation<protos.google.cloud.vectorsearch.v1beta.ICollection, protos.google.cloud.vectorsearch.v1beta.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
|
| Returns | |
|---|---|
| Type | Description |
void |
|
createIndex(request, options)
createIndex(request?: protos.google.cloud.vectorsearch.v1beta.ICreateIndexRequest, options?: CallOptions): Promise<[
LROperation<protos.google.cloud.vectorsearch.v1beta.IIndex, protos.google.cloud.vectorsearch.v1beta.IOperationMetadata>,
protos.google.longrunning.IOperation | undefined,
{} | undefined
]>;Creates a new Index in a given project and location.
| Parameters | |
|---|---|
| Name | Description |
request |
ICreateIndexRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
| Returns | |
|---|---|
| Type | Description |
Promise<[
LROperation<protos.google.cloud.vectorsearch.v1beta.IIndex, protos.google.cloud.vectorsearch.v1beta.IOperationMetadata>,
protos.google.longrunning.IOperation | undefined,
{} | undefined
]> |
{Promise} - The promise which resolves to an array. The first element of the array is an object representing a long running operation. Its |
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. The resource name of the Collection for which to create the
* Index. Format:
* `projects/{project}/locations/{location}/collections/{collection}`
*/
// const parent = 'abc123'
/**
* Required. ID of the Index to create.
* The id must be 1-63 characters long, and comply with
* RFC1035.
* Specifically, it must be 1-63 characters long and match the regular
* expression `[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?`.
*/
// const indexId = 'abc123'
/**
* Required. The resource being created
*/
// const index = {}
/**
* Optional. An optional request ID to identify requests. Specify a unique
* request ID so that if you must retry your request, the server will know to
* ignore the request if it has already been completed. The server will
* guarantee that for at least 60 minutes since the first request.
* For example, consider a situation where you make an initial request and the
* request times out. If you make the request again with the same request
* ID, the server can check if original operation with the same request ID
* was received, and if so, will ignore the second request. This prevents
* clients from accidentally creating duplicate commitments.
* The request ID must be a valid UUID with the exception that zero UUID is
* not supported (00000000-0000-0000-0000-000000000000).
*/
// const requestId = 'abc123'
// Imports the Vectorsearch library
const {VectorSearchServiceClient} = require('@google-cloud/vectorsearch').v1beta;
// Instantiates a client
const vectorsearchClient = new VectorSearchServiceClient();
async function callCreateIndex() {
// Construct request
const request = {
parent,
indexId,
index,
};
// Run request
const [operation] = await vectorsearchClient.createIndex(request);
const [response] = await operation.promise();
console.log(response);
}
callCreateIndex();
createIndex(request, options, callback)
createIndex(request: protos.google.cloud.vectorsearch.v1beta.ICreateIndexRequest, options: CallOptions, callback: Callback<LROperation<protos.google.cloud.vectorsearch.v1beta.IIndex, protos.google.cloud.vectorsearch.v1beta.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;| Parameters | |
|---|---|
| Name | Description |
request |
ICreateIndexRequest
|
options |
CallOptions
|
callback |
Callback<LROperation<protos.google.cloud.vectorsearch.v1beta.IIndex, protos.google.cloud.vectorsearch.v1beta.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
|
| Returns | |
|---|---|
| Type | Description |
void |
|
createIndex(request, callback)
createIndex(request: protos.google.cloud.vectorsearch.v1beta.ICreateIndexRequest, callback: Callback<LROperation<protos.google.cloud.vectorsearch.v1beta.IIndex, protos.google.cloud.vectorsearch.v1beta.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;| Parameters | |
|---|---|
| Name | Description |
request |
ICreateIndexRequest
|
callback |
Callback<LROperation<protos.google.cloud.vectorsearch.v1beta.IIndex, protos.google.cloud.vectorsearch.v1beta.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
|
| Returns | |
|---|---|
| Type | Description |
void |
|
dataObjectPath(project, location, collection, dataObject)
dataObjectPath(project: string, location: string, collection: string, dataObject: string): string;Return a fully-qualified dataObject resource name string.
| Parameters | |
|---|---|
| Name | Description |
project |
string
|
location |
string
|
collection |
string
|
dataObject |
string
|
| Returns | |
|---|---|
| Type | Description |
string |
{string} Resource name string. |
deleteCollection(request, options)
deleteCollection(request?: protos.google.cloud.vectorsearch.v1beta.IDeleteCollectionRequest, options?: CallOptions): Promise<[
LROperation<protos.google.protobuf.IEmpty, protos.google.cloud.vectorsearch.v1beta.IOperationMetadata>,
protos.google.longrunning.IOperation | undefined,
{} | undefined
]>;Deletes a single Collection.
| Parameters | |
|---|---|
| Name | Description |
request |
IDeleteCollectionRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
| Returns | |
|---|---|
| Type | Description |
Promise<[
LROperation<protos.google.protobuf.IEmpty, protos.google.cloud.vectorsearch.v1beta.IOperationMetadata>,
protos.google.longrunning.IOperation | undefined,
{} | undefined
]> |
{Promise} - The promise which resolves to an array. The first element of the array is an object representing a long running operation. Its |
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. Name of the resource
*/
// const name = 'abc123'
/**
* Optional. An optional request ID to identify requests. Specify a unique
* request ID so that if you must retry your request, the server will know to
* ignore the request if it has already been completed. The server will
* guarantee that for at least 60 minutes after the first request.
* For example, consider a situation where you make an initial request and the
* request times out. If you make the request again with the same request
* ID, the server can check if original operation with the same request ID
* was received, and if so, will ignore the second request. This prevents
* clients from accidentally creating duplicate commitments.
* The request ID must be a valid UUID with the exception that zero UUID is
* not supported (00000000-0000-0000-0000-000000000000).
*/
// const requestId = 'abc123'
// Imports the Vectorsearch library
const {VectorSearchServiceClient} = require('@google-cloud/vectorsearch').v1beta;
// Instantiates a client
const vectorsearchClient = new VectorSearchServiceClient();
async function callDeleteCollection() {
// Construct request
const request = {
name,
};
// Run request
const [operation] = await vectorsearchClient.deleteCollection(request);
const [response] = await operation.promise();
console.log(response);
}
callDeleteCollection();
deleteCollection(request, options, callback)
deleteCollection(request: protos.google.cloud.vectorsearch.v1beta.IDeleteCollectionRequest, options: CallOptions, callback: Callback<LROperation<protos.google.protobuf.IEmpty, protos.google.cloud.vectorsearch.v1beta.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;| Parameters | |
|---|---|
| Name | Description |
request |
IDeleteCollectionRequest
|
options |
CallOptions
|
callback |
Callback<LROperation<protos.google.protobuf.IEmpty, protos.google.cloud.vectorsearch.v1beta.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
|
| Returns | |
|---|---|
| Type | Description |
void |
|
deleteCollection(request, callback)
deleteCollection(request: protos.google.cloud.vectorsearch.v1beta.IDeleteCollectionRequest, callback: Callback<LROperation<protos.google.protobuf.IEmpty, protos.google.cloud.vectorsearch.v1beta.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;| Parameters | |
|---|---|
| Name | Description |
request |
IDeleteCollectionRequest
|
callback |
Callback<LROperation<protos.google.protobuf.IEmpty, protos.google.cloud.vectorsearch.v1beta.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
|
| Returns | |
|---|---|
| Type | Description |
void |
|
deleteIndex(request, options)
deleteIndex(request?: protos.google.cloud.vectorsearch.v1beta.IDeleteIndexRequest, options?: CallOptions): Promise<[
LROperation<protos.google.protobuf.IEmpty, protos.google.cloud.vectorsearch.v1beta.IOperationMetadata>,
protos.google.longrunning.IOperation | undefined,
{} | undefined
]>;Deletes a single Index.
| Parameters | |
|---|---|
| Name | Description |
request |
IDeleteIndexRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
| Returns | |
|---|---|
| Type | Description |
Promise<[
LROperation<protos.google.protobuf.IEmpty, protos.google.cloud.vectorsearch.v1beta.IOperationMetadata>,
protos.google.longrunning.IOperation | undefined,
{} | undefined
]> |
{Promise} - The promise which resolves to an array. The first element of the array is an object representing a long running operation. Its |
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. The resource name of the Index to delete.
* Format:
* `projects/{project}/locations/{location}/collections/{collection}/indexes/{index}`
*/
// const name = 'abc123'
/**
* Optional. An optional request ID to identify requests. Specify a unique
* request ID so that if you must retry your request, the server will know to
* ignore the request if it has already been completed. The server will
* guarantee that for at least 60 minutes since the first request.
* For example, consider a situation where you make an initial request and the
* request times out. If you make the request again with the same request
* ID, the server can check if original operation with the same request ID
* was received, and if so, will ignore the second request. This prevents
* clients from accidentally creating duplicate commitments.
* The request ID must be a valid UUID with the exception that zero UUID is
* not supported (00000000-0000-0000-0000-000000000000).
*/
// const requestId = 'abc123'
// Imports the Vectorsearch library
const {VectorSearchServiceClient} = require('@google-cloud/vectorsearch').v1beta;
// Instantiates a client
const vectorsearchClient = new VectorSearchServiceClient();
async function callDeleteIndex() {
// Construct request
const request = {
name,
};
// Run request
const [operation] = await vectorsearchClient.deleteIndex(request);
const [response] = await operation.promise();
console.log(response);
}
callDeleteIndex();
deleteIndex(request, options, callback)
deleteIndex(request: protos.google.cloud.vectorsearch.v1beta.IDeleteIndexRequest, options: CallOptions, callback: Callback<LROperation<protos.google.protobuf.IEmpty, protos.google.cloud.vectorsearch.v1beta.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;| Parameters | |
|---|---|
| Name | Description |
request |
IDeleteIndexRequest
|
options |
CallOptions
|
callback |
Callback<LROperation<protos.google.protobuf.IEmpty, protos.google.cloud.vectorsearch.v1beta.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
|
| Returns | |
|---|---|
| Type | Description |
void |
|
deleteIndex(request, callback)
deleteIndex(request: protos.google.cloud.vectorsearch.v1beta.IDeleteIndexRequest, callback: Callback<LROperation<protos.google.protobuf.IEmpty, protos.google.cloud.vectorsearch.v1beta.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;| Parameters | |
|---|---|
| Name | Description |
request |
IDeleteIndexRequest
|
callback |
Callback<LROperation<protos.google.protobuf.IEmpty, protos.google.cloud.vectorsearch.v1beta.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
|
| Returns | |
|---|---|
| Type | Description |
void |
|
deleteOperation(request, optionsOrCallback, callback)
deleteOperation(request: protos.google.longrunning.DeleteOperationRequest, optionsOrCallback?: gax.CallOptions | Callback<protos.google.protobuf.Empty, protos.google.longrunning.DeleteOperationRequest, {} | null | undefined>, callback?: Callback<protos.google.protobuf.Empty, protos.google.longrunning.DeleteOperationRequest, {} | null | undefined>): Promise<protos.google.protobuf.Empty>;Deletes a long-running operation. This method indicates that the client is no longer interested in the operation result. It does not cancel the operation. If the server doesn't support this method, it returns google.rpc.Code.UNIMPLEMENTED.
| Parameters | |
|---|---|
| Name | Description |
request |
DeleteOperationRequest
The request object that will be sent. |
optionsOrCallback |
CallOptions | Callback<protos.google.protobuf.Empty, protos.google.longrunning.DeleteOperationRequest, {} | null | undefined>
|
callback |
Callback<protos.google.protobuf.Empty, protos.google.longrunning.DeleteOperationRequest, {} | null | undefined>
The function which will be called with the result of the API call. {Promise} - The promise which resolves when API call finishes. The promise has a method named "cancel" which cancels the ongoing API call. |
| Returns | |
|---|---|
| Type | Description |
Promise<protos.google.protobuf.Empty> |
|
const client = longrunning.operationsClient();
await client.deleteOperation({name: ''});
getCollection(request, options)
getCollection(request?: protos.google.cloud.vectorsearch.v1beta.IGetCollectionRequest, options?: CallOptions): Promise<[
protos.google.cloud.vectorsearch.v1beta.ICollection,
protos.google.cloud.vectorsearch.v1beta.IGetCollectionRequest | undefined,
{} | undefined
]>;Gets details of a single Collection.
| Parameters | |
|---|---|
| Name | Description |
request |
IGetCollectionRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
| Returns | |
|---|---|
| Type | Description |
Promise<[
protos.google.cloud.vectorsearch.v1beta.ICollection,
protos.google.cloud.vectorsearch.v1beta.IGetCollectionRequest | undefined,
{} | undefined
]> |
{Promise} - The promise which resolves to an array. The first element of the array is an object representing Collection. Please see the documentation for more details and examples. |
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. Name of the resource
*/
// const name = 'abc123'
// Imports the Vectorsearch library
const {VectorSearchServiceClient} = require('@google-cloud/vectorsearch').v1beta;
// Instantiates a client
const vectorsearchClient = new VectorSearchServiceClient();
async function callGetCollection() {
// Construct request
const request = {
name,
};
// Run request
const response = await vectorsearchClient.getCollection(request);
console.log(response);
}
callGetCollection();
getCollection(request, options, callback)
getCollection(request: protos.google.cloud.vectorsearch.v1beta.IGetCollectionRequest, options: CallOptions, callback: Callback<protos.google.cloud.vectorsearch.v1beta.ICollection, protos.google.cloud.vectorsearch.v1beta.IGetCollectionRequest | null | undefined, {} | null | undefined>): void;| Parameters | |
|---|---|
| Name | Description |
request |
IGetCollectionRequest
|
options |
CallOptions
|
callback |
Callback<protos.google.cloud.vectorsearch.v1beta.ICollection, protos.google.cloud.vectorsearch.v1beta.IGetCollectionRequest | null | undefined, {} | null | undefined>
|
| Returns | |
|---|---|
| Type | Description |
void |
|
getCollection(request, callback)
getCollection(request: protos.google.cloud.vectorsearch.v1beta.IGetCollectionRequest, callback: Callback<protos.google.cloud.vectorsearch.v1beta.ICollection, protos.google.cloud.vectorsearch.v1beta.IGetCollectionRequest | null | undefined, {} | null | undefined>): void;| Parameters | |
|---|---|
| Name | Description |
request |
IGetCollectionRequest
|
callback |
Callback<protos.google.cloud.vectorsearch.v1beta.ICollection, protos.google.cloud.vectorsearch.v1beta.IGetCollectionRequest | null | undefined, {} | null | undefined>
|
| Returns | |
|---|---|
| Type | Description |
void |
|
getIndex(request, options)
getIndex(request?: protos.google.cloud.vectorsearch.v1beta.IGetIndexRequest, options?: CallOptions): Promise<[
protos.google.cloud.vectorsearch.v1beta.IIndex,
protos.google.cloud.vectorsearch.v1beta.IGetIndexRequest | undefined,
{} | undefined
]>;Gets details of a single Index.
| Parameters | |
|---|---|
| Name | Description |
request |
IGetIndexRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
| Returns | |
|---|---|
| Type | Description |
Promise<[
protos.google.cloud.vectorsearch.v1beta.IIndex,
protos.google.cloud.vectorsearch.v1beta.IGetIndexRequest | undefined,
{} | undefined
]> |
{Promise} - The promise which resolves to an array. The first element of the array is an object representing Index. Please see the documentation for more details and examples. |
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. Name of the resource
*/
// const name = 'abc123'
// Imports the Vectorsearch library
const {VectorSearchServiceClient} = require('@google-cloud/vectorsearch').v1beta;
// Instantiates a client
const vectorsearchClient = new VectorSearchServiceClient();
async function callGetIndex() {
// Construct request
const request = {
name,
};
// Run request
const response = await vectorsearchClient.getIndex(request);
console.log(response);
}
callGetIndex();
getIndex(request, options, callback)
getIndex(request: protos.google.cloud.vectorsearch.v1beta.IGetIndexRequest, options: CallOptions, callback: Callback<protos.google.cloud.vectorsearch.v1beta.IIndex, protos.google.cloud.vectorsearch.v1beta.IGetIndexRequest | null | undefined, {} | null | undefined>): void;| Parameters | |
|---|---|
| Name | Description |
request |
IGetIndexRequest
|
options |
CallOptions
|
callback |
Callback<protos.google.cloud.vectorsearch.v1beta.IIndex, protos.google.cloud.vectorsearch.v1beta.IGetIndexRequest | null | undefined, {} | null | undefined>
|
| Returns | |
|---|---|
| Type | Description |
void |
|
getIndex(request, callback)
getIndex(request: protos.google.cloud.vectorsearch.v1beta.IGetIndexRequest, callback: Callback<protos.google.cloud.vectorsearch.v1beta.IIndex, protos.google.cloud.vectorsearch.v1beta.IGetIndexRequest | null | undefined, {} | null | undefined>): void;| Parameters | |
|---|---|
| Name | Description |
request |
IGetIndexRequest
|
callback |
Callback<protos.google.cloud.vectorsearch.v1beta.IIndex, protos.google.cloud.vectorsearch.v1beta.IGetIndexRequest | null | undefined, {} | null | undefined>
|
| Returns | |
|---|---|
| Type | Description |
void |
|
getLocation(request, options, callback)
getLocation(request: LocationProtos.google.cloud.location.IGetLocationRequest, options?: gax.CallOptions | Callback<LocationProtos.google.cloud.location.ILocation, LocationProtos.google.cloud.location.IGetLocationRequest | null | undefined, {} | null | undefined>, callback?: Callback<LocationProtos.google.cloud.location.ILocation, LocationProtos.google.cloud.location.IGetLocationRequest | null | undefined, {} | null | undefined>): Promise<LocationProtos.google.cloud.location.ILocation>;Gets information about a location.
| Parameters | |
|---|---|
| Name | Description |
request |
LocationProtos.google.cloud.location.IGetLocationRequest
The request object that will be sent. |
options |
CallOptions | Callback<google.cloud.location.ILocation, google.cloud.location.IGetLocationRequest | null | undefined, {} | null | undefined>
Call options. See CallOptions for more details. |
callback |
Callback<google.cloud.location.ILocation, google.cloud.location.IGetLocationRequest | null | undefined, {} | null | undefined>
|
| Returns | |
|---|---|
| Type | Description |
Promise<google.cloud.location.ILocation> |
{Promise} - The promise which resolves to an array. The first element of the array is an object representing . Please see the documentation for more details and examples. |
const [response] = await client.getLocation(request);
getOperation(request, optionsOrCallback, callback)
getOperation(request: protos.google.longrunning.GetOperationRequest, optionsOrCallback?: gax.CallOptions | Callback<protos.google.longrunning.Operation, protos.google.longrunning.GetOperationRequest, {} | null | undefined>, callback?: Callback<protos.google.longrunning.Operation, protos.google.longrunning.GetOperationRequest, {} | null | undefined>): Promise<[protos.google.longrunning.Operation]>;Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service.
| Parameters | |
|---|---|
| Name | Description |
request |
GetOperationRequest
The request object that will be sent. |
optionsOrCallback |
CallOptions | Callback<protos.google.longrunning.Operation, protos.google.longrunning.GetOperationRequest, {} | null | undefined>
|
callback |
Callback<protos.google.longrunning.Operation, protos.google.longrunning.GetOperationRequest, {} | null | undefined>
The function which will be called with the result of the API call. The second parameter to the callback is an object representing . {Promise} - The promise which resolves to an array. The first element of the array is an object representing . The promise has a method named "cancel" which cancels the ongoing API call. |
| Returns | |
|---|---|
| Type | Description |
Promise<[protos.google.longrunning.Operation]> |
|
const client = longrunning.operationsClient();
const name = '';
const [response] = await client.getOperation({name});
// doThingsWith(response)
getProjectId()
getProjectId(): Promise<string>;| Returns | |
|---|---|
| Type | Description |
Promise<string> |
|
getProjectId(callback)
getProjectId(callback: Callback<string, undefined, undefined>): void;| Parameter | |
|---|---|
| Name | Description |
callback |
Callback<string, undefined, undefined>
|
| Returns | |
|---|---|
| Type | Description |
void |
|
importDataObjects(request, options)
importDataObjects(request?: protos.google.cloud.vectorsearch.v1beta.IImportDataObjectsRequest, options?: CallOptions): Promise<[
LROperation<protos.google.cloud.vectorsearch.v1beta.IImportDataObjectsResponse, protos.google.cloud.vectorsearch.v1beta.IImportDataObjectsMetadata>,
protos.google.longrunning.IOperation | undefined,
{} | undefined
]>;Initiates a Long-Running Operation to import DataObjects into a Collection.
| Parameters | |
|---|---|
| Name | Description |
request |
IImportDataObjectsRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
| Returns | |
|---|---|
| Type | Description |
Promise<[
LROperation<protos.google.cloud.vectorsearch.v1beta.IImportDataObjectsResponse, protos.google.cloud.vectorsearch.v1beta.IImportDataObjectsMetadata>,
protos.google.longrunning.IOperation | undefined,
{} | undefined
]> |
{Promise} - The promise which resolves to an array. The first element of the array is an object representing a long running operation. Its |
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* The Cloud Storage location of the input content.
*/
// const gcsImport = {}
/**
* Required. The resource name of the Collection to import DataObjects into.
* Format: `projects/{project}/locations/{location}/collections/{collection}`.
*/
// const name = 'abc123'
// Imports the Vectorsearch library
const {VectorSearchServiceClient} = require('@google-cloud/vectorsearch').v1beta;
// Instantiates a client
const vectorsearchClient = new VectorSearchServiceClient();
async function callImportDataObjects() {
// Construct request
const request = {
name,
};
// Run request
const [operation] = await vectorsearchClient.importDataObjects(request);
const [response] = await operation.promise();
console.log(response);
}
callImportDataObjects();
importDataObjects(request, options, callback)
importDataObjects(request: protos.google.cloud.vectorsearch.v1beta.IImportDataObjectsRequest, options: CallOptions, callback: Callback<LROperation<protos.google.cloud.vectorsearch.v1beta.IImportDataObjectsResponse, protos.google.cloud.vectorsearch.v1beta.IImportDataObjectsMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;| Parameters | |
|---|---|
| Name | Description |
request |
IImportDataObjectsRequest
|
options |
CallOptions
|
callback |
Callback<LROperation<protos.google.cloud.vectorsearch.v1beta.IImportDataObjectsResponse, protos.google.cloud.vectorsearch.v1beta.IImportDataObjectsMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
|
| Returns | |
|---|---|
| Type | Description |
void |
|
importDataObjects(request, callback)
importDataObjects(request: protos.google.cloud.vectorsearch.v1beta.IImportDataObjectsRequest, callback: Callback<LROperation<protos.google.cloud.vectorsearch.v1beta.IImportDataObjectsResponse, protos.google.cloud.vectorsearch.v1beta.IImportDataObjectsMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;| Parameters | |
|---|---|
| Name | Description |
request |
IImportDataObjectsRequest
|
callback |
Callback<LROperation<protos.google.cloud.vectorsearch.v1beta.IImportDataObjectsResponse, protos.google.cloud.vectorsearch.v1beta.IImportDataObjectsMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
|
| Returns | |
|---|---|
| Type | Description |
void |
|
indexPath(project, location, collection, index)
indexPath(project: string, location: string, collection: string, index: string): string;Return a fully-qualified index resource name string.
| Parameters | |
|---|---|
| Name | Description |
project |
string
|
location |
string
|
collection |
string
|
index |
string
|
| Returns | |
|---|---|
| Type | Description |
string |
{string} Resource name string. |
initialize()
initialize(): Promise<{
[name: string]: Function;
}>;Initialize the client. Performs asynchronous operations (such as authentication) and prepares the client. This function will be called automatically when any class method is called for the first time, but if you need to initialize it before calling an actual method, feel free to call initialize() directly.
You can await on this method if you want to make sure the client is initialized.
| Returns | |
|---|---|
| Type | Description |
Promise<{
[name: string]: Function;
}> |
{Promise} A promise that resolves to an authenticated service stub. |
listCollections(request, options)
listCollections(request?: protos.google.cloud.vectorsearch.v1beta.IListCollectionsRequest, options?: CallOptions): Promise<[
protos.google.cloud.vectorsearch.v1beta.ICollection[],
protos.google.cloud.vectorsearch.v1beta.IListCollectionsRequest | null,
protos.google.cloud.vectorsearch.v1beta.IListCollectionsResponse
]>;Lists Collections in a given project and location.
| Parameters | |
|---|---|
| Name | Description |
request |
IListCollectionsRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
| Returns | |
|---|---|
| Type | Description |
Promise<[
protos.google.cloud.vectorsearch.v1beta.ICollection[],
protos.google.cloud.vectorsearch.v1beta.IListCollectionsRequest | null,
protos.google.cloud.vectorsearch.v1beta.IListCollectionsResponse
]> |
{Promise} - The promise which resolves to an array. The first element of the array is Array of Collection. The client library will perform auto-pagination by default: it will call the API as many times as needed and will merge results from all the pages into this array. Note that it can affect your quota. We recommend using |
listCollections(request, options, callback)
listCollections(request: protos.google.cloud.vectorsearch.v1beta.IListCollectionsRequest, options: CallOptions, callback: PaginationCallback<protos.google.cloud.vectorsearch.v1beta.IListCollectionsRequest, protos.google.cloud.vectorsearch.v1beta.IListCollectionsResponse | null | undefined, protos.google.cloud.vectorsearch.v1beta.ICollection>): void;| Parameters | |
|---|---|
| Name | Description |
request |
IListCollectionsRequest
|
options |
CallOptions
|
callback |
PaginationCallback<protos.google.cloud.vectorsearch.v1beta.IListCollectionsRequest, protos.google.cloud.vectorsearch.v1beta.IListCollectionsResponse | null | undefined, protos.google.cloud.vectorsearch.v1beta.ICollection>
|
| Returns | |
|---|---|
| Type | Description |
void |
|
listCollections(request, callback)
listCollections(request: protos.google.cloud.vectorsearch.v1beta.IListCollectionsRequest, callback: PaginationCallback<protos.google.cloud.vectorsearch.v1beta.IListCollectionsRequest, protos.google.cloud.vectorsearch.v1beta.IListCollectionsResponse | null | undefined, protos.google.cloud.vectorsearch.v1beta.ICollection>): void;| Parameters | |
|---|---|
| Name | Description |
request |
IListCollectionsRequest
|
callback |
PaginationCallback<protos.google.cloud.vectorsearch.v1beta.IListCollectionsRequest, protos.google.cloud.vectorsearch.v1beta.IListCollectionsResponse | null | undefined, protos.google.cloud.vectorsearch.v1beta.ICollection>
|
| Returns | |
|---|---|
| Type | Description |
void |
|
listCollectionsAsync(request, options)
listCollectionsAsync(request?: protos.google.cloud.vectorsearch.v1beta.IListCollectionsRequest, options?: CallOptions): AsyncIterable<protos.google.cloud.vectorsearch.v1beta.ICollection>;Equivalent to listCollections, but returns an iterable object.
for-await-of syntax is used with the iterable to get response elements on-demand.
| Parameters | |
|---|---|
| Name | Description |
request |
IListCollectionsRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
| Returns | |
|---|---|
| Type | Description |
AsyncIterable<protos.google.cloud.vectorsearch.v1beta.ICollection> |
{Object} An iterable Object that allows async iteration. When you iterate the returned iterable, each element will be an object representing Collection. The API will be called under the hood as needed, once per the page, so you can stop the iteration when you don't need more results. Please see the documentation for more details and examples. |
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. Parent value for ListCollectionsRequest
*/
// const parent = 'abc123'
/**
* Optional. Requested page size. Server may return fewer items than
* requested. If unspecified, server will pick an appropriate default.
*/
// const pageSize = 1234
/**
* Optional. A token identifying a page of results the server should return.
*/
// const pageToken = 'abc123'
/**
* Optional. Filtering results
*/
// const filter = 'abc123'
/**
* Optional. Hint for how to order the results
*/
// const orderBy = 'abc123'
// Imports the Vectorsearch library
const {VectorSearchServiceClient} = require('@google-cloud/vectorsearch').v1beta;
// Instantiates a client
const vectorsearchClient = new VectorSearchServiceClient();
async function callListCollections() {
// Construct request
const request = {
parent,
};
// Run request
const iterable = vectorsearchClient.listCollectionsAsync(request);
for await (const response of iterable) {
console.log(response);
}
}
callListCollections();
listCollectionsStream(request, options)
listCollectionsStream(request?: protos.google.cloud.vectorsearch.v1beta.IListCollectionsRequest, options?: CallOptions): Transform;Equivalent to listCollections, but returns a NodeJS Stream object.
| Parameters | |
|---|---|
| Name | Description |
request |
IListCollectionsRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
| Returns | |
|---|---|
| Type | Description |
Transform |
{Stream} An object stream which emits an object representing Collection on 'data' event. The client library will perform auto-pagination by default: it will call the API as many times as needed. Note that it can affect your quota. We recommend using |
listIndexes(request, options)
listIndexes(request?: protos.google.cloud.vectorsearch.v1beta.IListIndexesRequest, options?: CallOptions): Promise<[
protos.google.cloud.vectorsearch.v1beta.IIndex[],
protos.google.cloud.vectorsearch.v1beta.IListIndexesRequest | null,
protos.google.cloud.vectorsearch.v1beta.IListIndexesResponse
]>;Lists Indexes in a given project and location.
| Parameters | |
|---|---|
| Name | Description |
request |
IListIndexesRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
| Returns | |
|---|---|
| Type | Description |
Promise<[
protos.google.cloud.vectorsearch.v1beta.IIndex[],
protos.google.cloud.vectorsearch.v1beta.IListIndexesRequest | null,
protos.google.cloud.vectorsearch.v1beta.IListIndexesResponse
]> |
{Promise} - The promise which resolves to an array. The first element of the array is Array of Index. The client library will perform auto-pagination by default: it will call the API as many times as needed and will merge results from all the pages into this array. Note that it can affect your quota. We recommend using |
listIndexes(request, options, callback)
listIndexes(request: protos.google.cloud.vectorsearch.v1beta.IListIndexesRequest, options: CallOptions, callback: PaginationCallback<protos.google.cloud.vectorsearch.v1beta.IListIndexesRequest, protos.google.cloud.vectorsearch.v1beta.IListIndexesResponse | null | undefined, protos.google.cloud.vectorsearch.v1beta.IIndex>): void;| Parameters | |
|---|---|
| Name | Description |
request |
IListIndexesRequest
|
options |
CallOptions
|
callback |
PaginationCallback<protos.google.cloud.vectorsearch.v1beta.IListIndexesRequest, protos.google.cloud.vectorsearch.v1beta.IListIndexesResponse | null | undefined, protos.google.cloud.vectorsearch.v1beta.IIndex>
|
| Returns | |
|---|---|
| Type | Description |
void |
|
listIndexes(request, callback)
listIndexes(request: protos.google.cloud.vectorsearch.v1beta.IListIndexesRequest, callback: PaginationCallback<protos.google.cloud.vectorsearch.v1beta.IListIndexesRequest, protos.google.cloud.vectorsearch.v1beta.IListIndexesResponse | null | undefined, protos.google.cloud.vectorsearch.v1beta.IIndex>): void;| Parameters | |
|---|---|
| Name | Description |
request |
IListIndexesRequest
|
callback |
PaginationCallback<protos.google.cloud.vectorsearch.v1beta.IListIndexesRequest, protos.google.cloud.vectorsearch.v1beta.IListIndexesResponse | null | undefined, protos.google.cloud.vectorsearch.v1beta.IIndex>
|
| Returns | |
|---|---|
| Type | Description |
void |
|
listIndexesAsync(request, options)
listIndexesAsync(request?: protos.google.cloud.vectorsearch.v1beta.IListIndexesRequest, options?: CallOptions): AsyncIterable<protos.google.cloud.vectorsearch.v1beta.IIndex>;Equivalent to listIndexes, but returns an iterable object.
for-await-of syntax is used with the iterable to get response elements on-demand.
| Parameters | |
|---|---|
| Name | Description |
request |
IListIndexesRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
| Returns | |
|---|---|
| Type | Description |
AsyncIterable<protos.google.cloud.vectorsearch.v1beta.IIndex> |
{Object} An iterable Object that allows async iteration. When you iterate the returned iterable, each element will be an object representing Index. The API will be called under the hood as needed, once per the page, so you can stop the iteration when you don't need more results. Please see the documentation for more details and examples. |
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. Parent value for ListIndexesRequest
*/
// const parent = 'abc123'
/**
* Optional. Requested page size. Server may return fewer items than
* requested. If unspecified, server will pick an appropriate default.
*/
// const pageSize = 1234
/**
* Optional. A token identifying a page of results the server should return.
*/
// const pageToken = 'abc123'
/**
* Optional. Filtering results
*/
// const filter = 'abc123'
/**
* Optional. Hint for how to order the results
*/
// const orderBy = 'abc123'
// Imports the Vectorsearch library
const {VectorSearchServiceClient} = require('@google-cloud/vectorsearch').v1beta;
// Instantiates a client
const vectorsearchClient = new VectorSearchServiceClient();
async function callListIndexes() {
// Construct request
const request = {
parent,
};
// Run request
const iterable = vectorsearchClient.listIndexesAsync(request);
for await (const response of iterable) {
console.log(response);
}
}
callListIndexes();
listIndexesStream(request, options)
listIndexesStream(request?: protos.google.cloud.vectorsearch.v1beta.IListIndexesRequest, options?: CallOptions): Transform;Equivalent to listIndexes, but returns a NodeJS Stream object.
| Parameters | |
|---|---|
| Name | Description |
request |
IListIndexesRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
| Returns | |
|---|---|
| Type | Description |
Transform |
{Stream} An object stream which emits an object representing Index on 'data' event. The client library will perform auto-pagination by default: it will call the API as many times as needed. Note that it can affect your quota. We recommend using |
listLocationsAsync(request, options)
listLocationsAsync(request: LocationProtos.google.cloud.location.IListLocationsRequest, options?: CallOptions): AsyncIterable<LocationProtos.google.cloud.location.ILocation>;Lists information about the supported locations for this service. Returns an iterable object.
for-await-of syntax is used with the iterable to get response elements on-demand.
| Parameters | |
|---|---|
| Name | Description |
request |
LocationProtos.google.cloud.location.IListLocationsRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
| Returns | |
|---|---|
| Type | Description |
AsyncIterable<google.cloud.location.ILocation> |
{Object} An iterable Object that allows async iteration. When you iterate the returned iterable, each element will be an object representing . The API will be called under the hood as needed, once per the page, so you can stop the iteration when you don't need more results. Please see the documentation for more details and examples. |
const iterable = client.listLocationsAsync(request);
for await (const response of iterable) {
// process response
}
listOperationsAsync(request, options)
listOperationsAsync(request: protos.google.longrunning.ListOperationsRequest, options?: gax.CallOptions): AsyncIterable<protos.google.longrunning.IOperation>;Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns UNIMPLEMENTED. Returns an iterable object.
For-await-of syntax is used with the iterable to recursively get response element on-demand.
| Parameters | |
|---|---|
| Name | Description |
request |
ListOperationsRequest
The request object that will be sent. |
options |
CallOptions
Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details. |
| Returns | |
|---|---|
| Type | Description |
AsyncIterable<protos.google.longrunning.IOperation> |
{Object} An iterable Object that conforms to iteration protocols. |
const client = longrunning.operationsClient();
for await (const response of client.listOperationsAsync(request));
// doThingsWith(response)
locationPath(project, location)
locationPath(project: string, location: string): string;Return a fully-qualified location resource name string.
| Parameters | |
|---|---|
| Name | Description |
project |
string
|
location |
string
|
| Returns | |
|---|---|
| Type | Description |
string |
{string} Resource name string. |
matchCollectionFromCollectionName(collectionName)
matchCollectionFromCollectionName(collectionName: string): string | number;Parse the collection from Collection resource.
| Parameter | |
|---|---|
| Name | Description |
collectionName |
string
A fully-qualified path representing Collection resource. |
| Returns | |
|---|---|
| Type | Description |
string | number |
{string} A string representing the collection. |
matchCollectionFromDataObjectName(dataObjectName)
matchCollectionFromDataObjectName(dataObjectName: string): string | number;Parse the collection from DataObject resource.
| Parameter | |
|---|---|
| Name | Description |
dataObjectName |
string
A fully-qualified path representing DataObject resource. |
| Returns | |
|---|---|
| Type | Description |
string | number |
{string} A string representing the collection. |
matchCollectionFromIndexName(indexName)
matchCollectionFromIndexName(indexName: string): string | number;Parse the collection from Index resource.
| Parameter | |
|---|---|
| Name | Description |
indexName |
string
A fully-qualified path representing Index resource. |
| Returns | |
|---|---|
| Type | Description |
string | number |
{string} A string representing the collection. |
matchDataObjectFromDataObjectName(dataObjectName)
matchDataObjectFromDataObjectName(dataObjectName: string): string | number;Parse the dataObject from DataObject resource.
| Parameter | |
|---|---|
| Name | Description |
dataObjectName |
string
A fully-qualified path representing DataObject resource. |
| Returns | |
|---|---|
| Type | Description |
string | number |
{string} A string representing the dataObject. |
matchIndexFromIndexName(indexName)
matchIndexFromIndexName(indexName: string): string | number;Parse the index from Index resource.
| Parameter | |
|---|---|
| Name | Description |
indexName |
string
A fully-qualified path representing Index resource. |
| Returns | |
|---|---|
| Type | Description |
string | number |
{string} A string representing the index. |
matchLocationFromCollectionName(collectionName)
matchLocationFromCollectionName(collectionName: string): string | number;Parse the location from Collection resource.
| Parameter | |
|---|---|
| Name | Description |
collectionName |
string
A fully-qualified path representing Collection resource. |
| Returns | |
|---|---|
| Type | Description |
string | number |
{string} A string representing the location. |
matchLocationFromDataObjectName(dataObjectName)
matchLocationFromDataObjectName(dataObjectName: string): string | number;Parse the location from DataObject resource.
| Parameter | |
|---|---|
| Name | Description |
dataObjectName |
string
A fully-qualified path representing DataObject resource. |
| Returns | |
|---|---|
| Type | Description |
string | number |
{string} A string representing the location. |
matchLocationFromIndexName(indexName)
matchLocationFromIndexName(indexName: string): string | number;Parse the location from Index resource.
| Parameter | |
|---|---|
| Name | Description |
indexName |
string
A fully-qualified path representing Index resource. |
| Returns | |
|---|---|
| Type | Description |
string | number |
{string} A string representing the location. |
matchLocationFromLocationName(locationName)
matchLocationFromLocationName(locationName: string): string | number;Parse the location from Location resource.
| Parameter | |
|---|---|
| Name | Description |
locationName |
string
A fully-qualified path representing Location resource. |
| Returns | |
|---|---|
| Type | Description |
string | number |
{string} A string representing the location. |
matchProjectFromCollectionName(collectionName)
matchProjectFromCollectionName(collectionName: string): string | number;Parse the project from Collection resource.
| Parameter | |
|---|---|
| Name | Description |
collectionName |
string
A fully-qualified path representing Collection resource. |
| Returns | |
|---|---|
| Type | Description |
string | number |
{string} A string representing the project. |
matchProjectFromDataObjectName(dataObjectName)
matchProjectFromDataObjectName(dataObjectName: string): string | number;Parse the project from DataObject resource.
| Parameter | |
|---|---|
| Name | Description |
dataObjectName |
string
A fully-qualified path representing DataObject resource. |
| Returns | |
|---|---|
| Type | Description |
string | number |
{string} A string representing the project. |
matchProjectFromIndexName(indexName)
matchProjectFromIndexName(indexName: string): string | number;Parse the project from Index resource.
| Parameter | |
|---|---|
| Name | Description |
indexName |
string
A fully-qualified path representing Index resource. |
| Returns | |
|---|---|
| Type | Description |
string | number |
{string} A string representing the project. |
matchProjectFromLocationName(locationName)
matchProjectFromLocationName(locationName: string): string | number;Parse the project from Location resource.
| Parameter | |
|---|---|
| Name | Description |
locationName |
string
A fully-qualified path representing Location resource. |
| Returns | |
|---|---|
| Type | Description |
string | number |
{string} A string representing the project. |
matchProjectFromProjectName(projectName)
matchProjectFromProjectName(projectName: string): string | number;Parse the project from Project resource.
| Parameter | |
|---|---|
| Name | Description |
projectName |
string
A fully-qualified path representing Project resource. |
| Returns | |
|---|---|
| Type | Description |
string | number |
{string} A string representing the project. |
projectPath(project)
projectPath(project: string): string;Return a fully-qualified project resource name string.
| Parameter | |
|---|---|
| Name | Description |
project |
string
|
| Returns | |
|---|---|
| Type | Description |
string |
{string} Resource name string. |
updateCollection(request, options)
updateCollection(request?: protos.google.cloud.vectorsearch.v1beta.IUpdateCollectionRequest, options?: CallOptions): Promise<[
LROperation<protos.google.cloud.vectorsearch.v1beta.ICollection, protos.google.cloud.vectorsearch.v1beta.IOperationMetadata>,
protos.google.longrunning.IOperation | undefined,
{} | undefined
]>;Updates the parameters of a single Collection.
| Parameters | |
|---|---|
| Name | Description |
request |
IUpdateCollectionRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
| Returns | |
|---|---|
| Type | Description |
Promise<[
LROperation<protos.google.cloud.vectorsearch.v1beta.ICollection, protos.google.cloud.vectorsearch.v1beta.IOperationMetadata>,
protos.google.longrunning.IOperation | undefined,
{} | undefined
]> |
{Promise} - The promise which resolves to an array. The first element of the array is an object representing a long running operation. Its |
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Optional. Field mask is used to specify the fields to be overwritten in the
* Collection resource by the update.
* The fields specified in the update_mask are relative to the resource, not
* the full request. A field will be overwritten if it is in the mask. If the
* user does not provide a mask then all fields present in the request will be
* overwritten.
* The following fields support update: `display_name`, `description`,
* `labels`, `data_schema`, `vector_schema`.
* For `data_schema` and `vector_schema`, fields can only be added, not
* modified or deleted.
* Partial updates for `data_schema` and `vector_schema` are also supported
* by using sub-field paths in `update_mask`, e.g.
* `data_schema.properties.foo` or `vector_schema.my_vector_field`.
* If `*` is provided in the update_mask, full replacement will be performed.
*/
// const updateMask = {}
/**
* Required. The resource being updated
*/
// const collection = {}
/**
* Optional. An optional request ID to identify requests. Specify a unique
* request ID so that if you must retry your request, the server will know to
* ignore the request if it has already been completed. The server will
* guarantee that for at least 60 minutes since the first request.
* For example, consider a situation where you make an initial request and the
* request times out. If you make the request again with the same request
* ID, the server can check if original operation with the same request ID
* was received, and if so, will ignore the second request. This prevents
* clients from accidentally creating duplicate commitments.
* The request ID must be a valid UUID with the exception that zero UUID is
* not supported (00000000-0000-0000-0000-000000000000).
*/
// const requestId = 'abc123'
// Imports the Vectorsearch library
const {VectorSearchServiceClient} = require('@google-cloud/vectorsearch').v1beta;
// Instantiates a client
const vectorsearchClient = new VectorSearchServiceClient();
async function callUpdateCollection() {
// Construct request
const request = {
collection,
};
// Run request
const [operation] = await vectorsearchClient.updateCollection(request);
const [response] = await operation.promise();
console.log(response);
}
callUpdateCollection();
updateCollection(request, options, callback)
updateCollection(request: protos.google.cloud.vectorsearch.v1beta.IUpdateCollectionRequest, options: CallOptions, callback: Callback<LROperation<protos.google.cloud.vectorsearch.v1beta.ICollection, protos.google.cloud.vectorsearch.v1beta.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;| Parameters | |
|---|---|
| Name | Description |
request |
IUpdateCollectionRequest
|
options |
CallOptions
|
callback |
Callback<LROperation<protos.google.cloud.vectorsearch.v1beta.ICollection, protos.google.cloud.vectorsearch.v1beta.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
|
| Returns | |
|---|---|
| Type | Description |
void |
|
updateCollection(request, callback)
updateCollection(request: protos.google.cloud.vectorsearch.v1beta.IUpdateCollectionRequest, callback: Callback<LROperation<protos.google.cloud.vectorsearch.v1beta.ICollection, protos.google.cloud.vectorsearch.v1beta.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;| Parameters | |
|---|---|
| Name | Description |
request |
IUpdateCollectionRequest
|
callback |
Callback<LROperation<protos.google.cloud.vectorsearch.v1beta.ICollection, protos.google.cloud.vectorsearch.v1beta.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
|
| Returns | |
|---|---|
| Type | Description |
void |
|