Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/google-cloud-vectorsearch/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ Samples are in the [`samples/`][homepage_samples] directory. Each sample's `READ
| create index | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-vectorsearch/samples/generated/v1beta/vector_search_service.create_index.js) |
| delete collection | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-vectorsearch/samples/generated/v1beta/vector_search_service.delete_collection.js) |
| delete index | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-vectorsearch/samples/generated/v1beta/vector_search_service.delete_index.js) |
| export data objects | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-vectorsearch/samples/generated/v1beta/vector_search_service.export_data_objects.js) |
| get collection | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-vectorsearch/samples/generated/v1beta/vector_search_service.get_collection.js) |
| get index | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-vectorsearch/samples/generated/v1beta/vector_search_service.get_index.js) |
| import data objects | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-vectorsearch/samples/generated/v1beta/vector_search_service.import_data_objects.js) |
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2025 Google LLC
// Copyright 2026 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -31,16 +31,17 @@ message DataObject {
option (google.api.resource) = {
type: "vectorsearch.googleapis.com/DataObject"
pattern: "projects/{project}/locations/{location}/collections/{collection}/dataObjects/{dataObject}"
plural: "dataObjects"
singular: "dataObject"
};

// Immutable. The fully qualified resource name of the dataObject.
// Identifier. The fully qualified resource name of the dataObject.
//
// Format:
// `projects/{project}/locations/{location}/collections/{collection}/dataObjects/{data_object_id}`
// The data_object_id must be 1-63 characters
// long, and comply with
// <a href="https://www.ietf.org/rfc/rfc1035.txt" target="_blank">RFC1035</a>.
string name = 1 [(google.api.field_behavior) = IMMUTABLE];
// long, and comply with [RFC1035](https://www.ietf.org/rfc/rfc1035.txt).
string name = 1 [(google.api.field_behavior) = IDENTIFIER];

// Output only. The id of the dataObject.
string data_object_id = 2
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2025 Google LLC
// Copyright 2026 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -107,12 +107,12 @@ message SearchHint {

// The type of index to use.
oneof index_type {
// Specifies that the search should use a particular index.
IndexHint use_index = 1;
// Optional. Specifies that the search should use a particular index.
IndexHint use_index = 1 [(google.api.field_behavior) = OPTIONAL];

// If set to true, the search will use the system's default
// Optional. If set to true, the search will use the system's default
// K-Nearest Neighbor (KNN) index engine.
bool use_knn = 2;
bool use_knn = 2 [(google.api.field_behavior) = OPTIONAL];
}
}

Expand Down Expand Up @@ -161,7 +161,8 @@ message VectorSearch {

// Optional. The distance metric to use for the KNN search. If not specified,
// DOT_PRODUCT will be used as the default.
DistanceMetric distance_metric = 11 [(google.api.field_behavior) = OPTIONAL];
google.cloud.vectorsearch.v1beta.DistanceMetric distance_metric = 11
[(google.api.field_behavior) = OPTIONAL];
}

// Defines a semantic search operation.
Expand All @@ -185,6 +186,11 @@ message SemanticSearch {

// Optional. The number of data objects to return.
optional int32 top_k = 4 [(google.api.field_behavior) = OPTIONAL];

// Optional. Sets the search hint. If no strategy is specified, the service
// will use an index if one is available, and fall back to KNN search
// otherwise.
SearchHint search_hint = 7 [(google.api.field_behavior) = OPTIONAL];
}

// Defines a text search operation.
Expand All @@ -200,6 +206,10 @@ message TextSearch {

// Optional. The number of results to return.
optional int32 top_k = 4 [(google.api.field_behavior) = OPTIONAL];

// Optional. A JSON filter expression, e.g. `{"genre": {"$eq": "sci-fi"}}`,
// represented as a `google.protobuf.Struct`.
google.protobuf.Struct filter = 5 [(google.api.field_behavior) = OPTIONAL];
}

// Request for performing a single search.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2025 Google LLC
// Copyright 2026 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -114,7 +114,7 @@ message CreateDataObjectRequest {

// Required. The id of the dataObject to create.
// The id must be 1-63 characters long, and comply with
// <a href="https://www.ietf.org/rfc/rfc1035.txt" target="_blank">RFC1035</a>.
// [RFC1035](https://www.ietf.org/rfc/rfc1035.txt).
// Specifically, it must be 1-63 characters long and match the regular
// expression `[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?`.
string data_object_id = 2 [(google.api.field_behavior) = REQUIRED];
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2025 Google LLC
// Copyright 2026 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -63,7 +63,7 @@ message VertexEmbeddingConfig {

// Required. Required: Text template for the input to the model. The template
// must contain one or more references to fields in the DataObject, e.g.:
// "Movie Title: {title} ---- Movie Plot: {plot}"".
// "Movie Title: {title} ---- Movie Plot: {plot}".
string text_template = 2 [(google.api.field_behavior) = REQUIRED];

// Required. Required: Task type for the embeddings.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2025 Google LLC
// Copyright 2026 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -156,6 +156,19 @@ service VectorSearchService {
metadata_type: "ImportDataObjectsMetadata"
};
}

// Initiates a Long-Running Operation to export DataObjects from a Collection.
rpc ExportDataObjects(ExportDataObjectsRequest)
returns (google.longrunning.Operation) {
option (google.api.http) = {
post: "/v1beta/{name=projects/*/locations/*/collections/*}:exportDataObjects"
body: "*"
};
option (google.longrunning.operation_info) = {
response_type: "ExportDataObjectsResponse"
metadata_type: "ExportDataObjectsMetadata"
};
}
}

// Message describing Collection object
Expand Down Expand Up @@ -290,7 +303,7 @@ message CreateCollectionRequest {

// Required. ID of the Collection to create.
// The id must be 1-63 characters long, and comply with
// <a href="https://www.ietf.org/rfc/rfc1035.txt" target="_blank">RFC1035</a>.
// [RFC1035](https://www.ietf.org/rfc/rfc1035.txt).
// Specifically, it must be 1-63 characters long and match the regular
// expression `[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?`.
string collection_id = 2 [(google.api.field_behavior) = REQUIRED];
Expand Down Expand Up @@ -329,7 +342,8 @@ message UpdateCollectionRequest {
// 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.
// deleted, but `vertex_embedding_config` in `vector_schema` can be added or
// removed.
// 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`.
Expand Down Expand Up @@ -420,7 +434,8 @@ message Index {

// Optional. Distance metric used for indexing. If not specified, will default
// to DOT_PRODUCT.
DistanceMetric distance_metric = 4 [(google.api.field_behavior) = OPTIONAL];
google.cloud.vectorsearch.v1beta.DistanceMetric distance_metric = 4
[(google.api.field_behavior) = OPTIONAL];

// Required. The collection schema field to index.
string index_field = 5 [(google.api.field_behavior) = REQUIRED];
Expand Down Expand Up @@ -448,7 +463,7 @@ message CreateIndexRequest {

// Required. ID of the Index to create.
// The id must be 1-63 characters long, and comply with
// <a href="https://www.ietf.org/rfc/rfc1035.txt" target="_blank">RFC1035</a>.
// [RFC1035](https://www.ietf.org/rfc/rfc1035.txt).
// Specifically, it must be 1-63 characters long and match the regular
// expression `[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?`.
string index_id = 2 [(google.api.field_behavior) = REQUIRED];
Expand Down Expand Up @@ -581,7 +596,8 @@ message OperationMetadata {
string api_version = 7 [(google.api.field_behavior) = OUTPUT_ONLY];
}

// Request message for [DataObjectService.ImportDataObjects][].
// Request message for
// [VectorSearchService.ImportDataObjects][google.cloud.vectorsearch.v1beta.VectorSearchService.ImportDataObjects].
message ImportDataObjectsRequest {
// Google Cloud Storage configuration for the import.
message GcsImportConfig {
Expand All @@ -591,6 +607,12 @@ message ImportDataObjectsRequest {
// Required. URI prefix of the Cloud Storage location to write any errors
// encountered during the import.
string error_uri = 2 [(google.api.field_behavior) = REQUIRED];

// Optional. URI prefix of the Cloud Storage location to write DataObject
// `IDs` and `etags` of DataObjects that were successfully imported. The
// service will write the successfully imported DataObjects to sharded files
// under this prefix. If this field is empty, no output will be written.
string output_uri = 3 [(google.api.field_behavior) = OPTIONAL];
}

// The configuration for the import data and error results.
Expand All @@ -609,7 +631,8 @@ message ImportDataObjectsRequest {
];
}

// Metadata for [DataObjectService.ImportDataObjects][].
// Metadata for
// [VectorSearchService.ImportDataObjects][google.cloud.vectorsearch.v1beta.VectorSearchService.ImportDataObjects].
message ImportDataObjectsMetadata {
// The time the operation was created.
google.protobuf.Timestamp create_time = 1;
Expand All @@ -624,8 +647,61 @@ message ImportDataObjectsMetadata {
int64 failure_count = 4;
}

// Response for [DataObjectService.ImportDataObjects][].
// Response for
// [VectorSearchService.ImportDataObjects][google.cloud.vectorsearch.v1beta.VectorSearchService.ImportDataObjects].
message ImportDataObjectsResponse {
// Status of the LRO
google.rpc.Status status = 1;
}

// Request message for
// [VectorSearchService.ExportDataObjects][google.cloud.vectorsearch.v1beta.VectorSearchService.ExportDataObjects].
message ExportDataObjectsRequest {
// Google Cloud Storage configuration for the export.
message GcsExportDestination {
// Options for the format of the exported Data Objects.
// New formats may be added in the future.
enum Format {
// Unspecified format.
FORMAT_UNSPECIFIED = 0;

// The exported Data Objects will be in JSON format.
JSON = 1;
}

// Required. URI prefix of the Cloud Storage where to export Data Objects.
// The bucket is required to be in the same region as the collection.
string export_uri = 1 [(google.api.field_behavior) = REQUIRED];

// Required. The format of the exported Data Objects.
Format format = 2 [(google.api.field_behavior) = REQUIRED];
}

// The configuration for the export data.
oneof destination {
// The Cloud Storage location where user wants to export Data Objects.
GcsExportDestination gcs_destination = 2;
}

// Required. The resource name of the Collection from which we want to export
// Data Objects. Format:
// `projects/{project}/locations/{location}/collections/{collection}`.
string name = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "vectorsearch.googleapis.com/Collection"
}
];
}

// Metadata for the ExportDataObjects LRO.
message ExportDataObjectsMetadata {
// The time the operation was created.
google.protobuf.Timestamp create_time = 1;

// The time the operation finished.
google.protobuf.Timestamp finish_time = 2;
}

// Response for the ExportDataObjects LRO.
message ExportDataObjectsResponse {}
Loading