@google-cloud/vectorsearch 0.1.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/build/protos/google/cloud/vectorsearch/v1beta/data_object.proto +6 -5
- package/build/protos/google/cloud/vectorsearch/v1beta/data_object_search_service.proto +16 -6
- package/build/protos/google/cloud/vectorsearch/v1beta/data_object_service.proto +2 -2
- package/build/protos/google/cloud/vectorsearch/v1beta/embedding_config.proto +2 -2
- package/build/protos/google/cloud/vectorsearch/v1beta/vectorsearch_service.proto +84 -8
- package/build/protos/protos.d.ts +455 -1
- package/build/protos/protos.js +1044 -1
- package/build/protos/protos.json +125 -6
- package/build/src/v1beta/data_object_search_service_client.js +1 -1
- package/build/src/v1beta/data_object_service_client.d.ts +1 -1
- package/build/src/v1beta/data_object_service_client.js +1 -1
- package/build/src/v1beta/data_object_service_client_config.json +12 -12
- package/build/src/v1beta/gapic_metadata.json +10 -0
- package/build/src/v1beta/index.js +1 -1
- package/build/src/v1beta/vector_search_service_client.d.ts +45 -3
- package/build/src/v1beta/vector_search_service_client.js +54 -3
- package/build/src/v1beta/vector_search_service_client.js.map +1 -1
- package/build/src/v1beta/vector_search_service_client_config.json +14 -10
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -73,6 +73,7 @@ Samples are in the [`samples/`][homepage_samples] directory. Each sample's `READ
|
|
|
73
73
|
| 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) |
|
|
74
74
|
| 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) |
|
|
75
75
|
| 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) |
|
|
76
|
+
| 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) |
|
|
76
77
|
| 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) |
|
|
77
78
|
| 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) |
|
|
78
79
|
| 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) |
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Copyright
|
|
1
|
+
// Copyright 2026 Google LLC
|
|
2
2
|
//
|
|
3
3
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
4
|
// you may not use this file except in compliance with the License.
|
|
@@ -31,16 +31,17 @@ message DataObject {
|
|
|
31
31
|
option (google.api.resource) = {
|
|
32
32
|
type: "vectorsearch.googleapis.com/DataObject"
|
|
33
33
|
pattern: "projects/{project}/locations/{location}/collections/{collection}/dataObjects/{dataObject}"
|
|
34
|
+
plural: "dataObjects"
|
|
35
|
+
singular: "dataObject"
|
|
34
36
|
};
|
|
35
37
|
|
|
36
|
-
//
|
|
38
|
+
// Identifier. The fully qualified resource name of the dataObject.
|
|
37
39
|
//
|
|
38
40
|
// Format:
|
|
39
41
|
// `projects/{project}/locations/{location}/collections/{collection}/dataObjects/{data_object_id}`
|
|
40
42
|
// The data_object_id must be 1-63 characters
|
|
41
|
-
// long, and comply with
|
|
42
|
-
|
|
43
|
-
string name = 1 [(google.api.field_behavior) = IMMUTABLE];
|
|
43
|
+
// long, and comply with [RFC1035](https://www.ietf.org/rfc/rfc1035.txt).
|
|
44
|
+
string name = 1 [(google.api.field_behavior) = IDENTIFIER];
|
|
44
45
|
|
|
45
46
|
// Output only. The id of the dataObject.
|
|
46
47
|
string data_object_id = 2
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Copyright
|
|
1
|
+
// Copyright 2026 Google LLC
|
|
2
2
|
//
|
|
3
3
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
4
|
// you may not use this file except in compliance with the License.
|
|
@@ -107,12 +107,12 @@ message SearchHint {
|
|
|
107
107
|
|
|
108
108
|
// The type of index to use.
|
|
109
109
|
oneof index_type {
|
|
110
|
-
// Specifies that the search should use a particular index.
|
|
111
|
-
IndexHint use_index = 1;
|
|
110
|
+
// Optional. Specifies that the search should use a particular index.
|
|
111
|
+
IndexHint use_index = 1 [(google.api.field_behavior) = OPTIONAL];
|
|
112
112
|
|
|
113
|
-
// If set to true, the search will use the system's default
|
|
113
|
+
// Optional. If set to true, the search will use the system's default
|
|
114
114
|
// K-Nearest Neighbor (KNN) index engine.
|
|
115
|
-
bool use_knn = 2;
|
|
115
|
+
bool use_knn = 2 [(google.api.field_behavior) = OPTIONAL];
|
|
116
116
|
}
|
|
117
117
|
}
|
|
118
118
|
|
|
@@ -161,7 +161,8 @@ message VectorSearch {
|
|
|
161
161
|
|
|
162
162
|
// Optional. The distance metric to use for the KNN search. If not specified,
|
|
163
163
|
// DOT_PRODUCT will be used as the default.
|
|
164
|
-
DistanceMetric distance_metric = 11
|
|
164
|
+
google.cloud.vectorsearch.v1beta.DistanceMetric distance_metric = 11
|
|
165
|
+
[(google.api.field_behavior) = OPTIONAL];
|
|
165
166
|
}
|
|
166
167
|
|
|
167
168
|
// Defines a semantic search operation.
|
|
@@ -185,6 +186,11 @@ message SemanticSearch {
|
|
|
185
186
|
|
|
186
187
|
// Optional. The number of data objects to return.
|
|
187
188
|
optional int32 top_k = 4 [(google.api.field_behavior) = OPTIONAL];
|
|
189
|
+
|
|
190
|
+
// Optional. Sets the search hint. If no strategy is specified, the service
|
|
191
|
+
// will use an index if one is available, and fall back to KNN search
|
|
192
|
+
// otherwise.
|
|
193
|
+
SearchHint search_hint = 7 [(google.api.field_behavior) = OPTIONAL];
|
|
188
194
|
}
|
|
189
195
|
|
|
190
196
|
// Defines a text search operation.
|
|
@@ -200,6 +206,10 @@ message TextSearch {
|
|
|
200
206
|
|
|
201
207
|
// Optional. The number of results to return.
|
|
202
208
|
optional int32 top_k = 4 [(google.api.field_behavior) = OPTIONAL];
|
|
209
|
+
|
|
210
|
+
// Optional. A JSON filter expression, e.g. `{"genre": {"$eq": "sci-fi"}}`,
|
|
211
|
+
// represented as a `google.protobuf.Struct`.
|
|
212
|
+
google.protobuf.Struct filter = 5 [(google.api.field_behavior) = OPTIONAL];
|
|
203
213
|
}
|
|
204
214
|
|
|
205
215
|
// Request for performing a single search.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Copyright
|
|
1
|
+
// Copyright 2026 Google LLC
|
|
2
2
|
//
|
|
3
3
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
4
|
// you may not use this file except in compliance with the License.
|
|
@@ -114,7 +114,7 @@ message CreateDataObjectRequest {
|
|
|
114
114
|
|
|
115
115
|
// Required. The id of the dataObject to create.
|
|
116
116
|
// The id must be 1-63 characters long, and comply with
|
|
117
|
-
//
|
|
117
|
+
// [RFC1035](https://www.ietf.org/rfc/rfc1035.txt).
|
|
118
118
|
// Specifically, it must be 1-63 characters long and match the regular
|
|
119
119
|
// expression `[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?`.
|
|
120
120
|
string data_object_id = 2 [(google.api.field_behavior) = REQUIRED];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Copyright
|
|
1
|
+
// Copyright 2026 Google LLC
|
|
2
2
|
//
|
|
3
3
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
4
|
// you may not use this file except in compliance with the License.
|
|
@@ -63,7 +63,7 @@ message VertexEmbeddingConfig {
|
|
|
63
63
|
|
|
64
64
|
// Required. Required: Text template for the input to the model. The template
|
|
65
65
|
// must contain one or more references to fields in the DataObject, e.g.:
|
|
66
|
-
// "Movie Title: {title} ---- Movie Plot: {plot}"
|
|
66
|
+
// "Movie Title: {title} ---- Movie Plot: {plot}".
|
|
67
67
|
string text_template = 2 [(google.api.field_behavior) = REQUIRED];
|
|
68
68
|
|
|
69
69
|
// Required. Required: Task type for the embeddings.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Copyright
|
|
1
|
+
// Copyright 2026 Google LLC
|
|
2
2
|
//
|
|
3
3
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
4
|
// you may not use this file except in compliance with the License.
|
|
@@ -156,6 +156,19 @@ service VectorSearchService {
|
|
|
156
156
|
metadata_type: "ImportDataObjectsMetadata"
|
|
157
157
|
};
|
|
158
158
|
}
|
|
159
|
+
|
|
160
|
+
// Initiates a Long-Running Operation to export DataObjects from a Collection.
|
|
161
|
+
rpc ExportDataObjects(ExportDataObjectsRequest)
|
|
162
|
+
returns (google.longrunning.Operation) {
|
|
163
|
+
option (google.api.http) = {
|
|
164
|
+
post: "/v1beta/{name=projects/*/locations/*/collections/*}:exportDataObjects"
|
|
165
|
+
body: "*"
|
|
166
|
+
};
|
|
167
|
+
option (google.longrunning.operation_info) = {
|
|
168
|
+
response_type: "ExportDataObjectsResponse"
|
|
169
|
+
metadata_type: "ExportDataObjectsMetadata"
|
|
170
|
+
};
|
|
171
|
+
}
|
|
159
172
|
}
|
|
160
173
|
|
|
161
174
|
// Message describing Collection object
|
|
@@ -290,7 +303,7 @@ message CreateCollectionRequest {
|
|
|
290
303
|
|
|
291
304
|
// Required. ID of the Collection to create.
|
|
292
305
|
// The id must be 1-63 characters long, and comply with
|
|
293
|
-
//
|
|
306
|
+
// [RFC1035](https://www.ietf.org/rfc/rfc1035.txt).
|
|
294
307
|
// Specifically, it must be 1-63 characters long and match the regular
|
|
295
308
|
// expression `[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?`.
|
|
296
309
|
string collection_id = 2 [(google.api.field_behavior) = REQUIRED];
|
|
@@ -329,7 +342,8 @@ message UpdateCollectionRequest {
|
|
|
329
342
|
// The following fields support update: `display_name`, `description`,
|
|
330
343
|
// `labels`, `data_schema`, `vector_schema`.
|
|
331
344
|
// For `data_schema` and `vector_schema`, fields can only be added, not
|
|
332
|
-
//
|
|
345
|
+
// deleted, but `vertex_embedding_config` in `vector_schema` can be added or
|
|
346
|
+
// removed.
|
|
333
347
|
// Partial updates for `data_schema` and `vector_schema` are also supported
|
|
334
348
|
// by using sub-field paths in `update_mask`, e.g.
|
|
335
349
|
// `data_schema.properties.foo` or `vector_schema.my_vector_field`.
|
|
@@ -420,7 +434,8 @@ message Index {
|
|
|
420
434
|
|
|
421
435
|
// Optional. Distance metric used for indexing. If not specified, will default
|
|
422
436
|
// to DOT_PRODUCT.
|
|
423
|
-
DistanceMetric distance_metric = 4
|
|
437
|
+
google.cloud.vectorsearch.v1beta.DistanceMetric distance_metric = 4
|
|
438
|
+
[(google.api.field_behavior) = OPTIONAL];
|
|
424
439
|
|
|
425
440
|
// Required. The collection schema field to index.
|
|
426
441
|
string index_field = 5 [(google.api.field_behavior) = REQUIRED];
|
|
@@ -448,7 +463,7 @@ message CreateIndexRequest {
|
|
|
448
463
|
|
|
449
464
|
// Required. ID of the Index to create.
|
|
450
465
|
// The id must be 1-63 characters long, and comply with
|
|
451
|
-
//
|
|
466
|
+
// [RFC1035](https://www.ietf.org/rfc/rfc1035.txt).
|
|
452
467
|
// Specifically, it must be 1-63 characters long and match the regular
|
|
453
468
|
// expression `[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?`.
|
|
454
469
|
string index_id = 2 [(google.api.field_behavior) = REQUIRED];
|
|
@@ -581,7 +596,8 @@ message OperationMetadata {
|
|
|
581
596
|
string api_version = 7 [(google.api.field_behavior) = OUTPUT_ONLY];
|
|
582
597
|
}
|
|
583
598
|
|
|
584
|
-
// Request message for
|
|
599
|
+
// Request message for
|
|
600
|
+
// [VectorSearchService.ImportDataObjects][google.cloud.vectorsearch.v1beta.VectorSearchService.ImportDataObjects].
|
|
585
601
|
message ImportDataObjectsRequest {
|
|
586
602
|
// Google Cloud Storage configuration for the import.
|
|
587
603
|
message GcsImportConfig {
|
|
@@ -591,6 +607,12 @@ message ImportDataObjectsRequest {
|
|
|
591
607
|
// Required. URI prefix of the Cloud Storage location to write any errors
|
|
592
608
|
// encountered during the import.
|
|
593
609
|
string error_uri = 2 [(google.api.field_behavior) = REQUIRED];
|
|
610
|
+
|
|
611
|
+
// Optional. URI prefix of the Cloud Storage location to write DataObject
|
|
612
|
+
// `IDs` and `etags` of DataObjects that were successfully imported. The
|
|
613
|
+
// service will write the successfully imported DataObjects to sharded files
|
|
614
|
+
// under this prefix. If this field is empty, no output will be written.
|
|
615
|
+
string output_uri = 3 [(google.api.field_behavior) = OPTIONAL];
|
|
594
616
|
}
|
|
595
617
|
|
|
596
618
|
// The configuration for the import data and error results.
|
|
@@ -609,7 +631,8 @@ message ImportDataObjectsRequest {
|
|
|
609
631
|
];
|
|
610
632
|
}
|
|
611
633
|
|
|
612
|
-
// Metadata for
|
|
634
|
+
// Metadata for
|
|
635
|
+
// [VectorSearchService.ImportDataObjects][google.cloud.vectorsearch.v1beta.VectorSearchService.ImportDataObjects].
|
|
613
636
|
message ImportDataObjectsMetadata {
|
|
614
637
|
// The time the operation was created.
|
|
615
638
|
google.protobuf.Timestamp create_time = 1;
|
|
@@ -624,8 +647,61 @@ message ImportDataObjectsMetadata {
|
|
|
624
647
|
int64 failure_count = 4;
|
|
625
648
|
}
|
|
626
649
|
|
|
627
|
-
// Response for
|
|
650
|
+
// Response for
|
|
651
|
+
// [VectorSearchService.ImportDataObjects][google.cloud.vectorsearch.v1beta.VectorSearchService.ImportDataObjects].
|
|
628
652
|
message ImportDataObjectsResponse {
|
|
629
653
|
// Status of the LRO
|
|
630
654
|
google.rpc.Status status = 1;
|
|
631
655
|
}
|
|
656
|
+
|
|
657
|
+
// Request message for
|
|
658
|
+
// [VectorSearchService.ExportDataObjects][google.cloud.vectorsearch.v1beta.VectorSearchService.ExportDataObjects].
|
|
659
|
+
message ExportDataObjectsRequest {
|
|
660
|
+
// Google Cloud Storage configuration for the export.
|
|
661
|
+
message GcsExportDestination {
|
|
662
|
+
// Options for the format of the exported Data Objects.
|
|
663
|
+
// New formats may be added in the future.
|
|
664
|
+
enum Format {
|
|
665
|
+
// Unspecified format.
|
|
666
|
+
FORMAT_UNSPECIFIED = 0;
|
|
667
|
+
|
|
668
|
+
// The exported Data Objects will be in JSON format.
|
|
669
|
+
JSON = 1;
|
|
670
|
+
}
|
|
671
|
+
|
|
672
|
+
// Required. URI prefix of the Cloud Storage where to export Data Objects.
|
|
673
|
+
// The bucket is required to be in the same region as the collection.
|
|
674
|
+
string export_uri = 1 [(google.api.field_behavior) = REQUIRED];
|
|
675
|
+
|
|
676
|
+
// Required. The format of the exported Data Objects.
|
|
677
|
+
Format format = 2 [(google.api.field_behavior) = REQUIRED];
|
|
678
|
+
}
|
|
679
|
+
|
|
680
|
+
// The configuration for the export data.
|
|
681
|
+
oneof destination {
|
|
682
|
+
// The Cloud Storage location where user wants to export Data Objects.
|
|
683
|
+
GcsExportDestination gcs_destination = 2;
|
|
684
|
+
}
|
|
685
|
+
|
|
686
|
+
// Required. The resource name of the Collection from which we want to export
|
|
687
|
+
// Data Objects. Format:
|
|
688
|
+
// `projects/{project}/locations/{location}/collections/{collection}`.
|
|
689
|
+
string name = 1 [
|
|
690
|
+
(google.api.field_behavior) = REQUIRED,
|
|
691
|
+
(google.api.resource_reference) = {
|
|
692
|
+
type: "vectorsearch.googleapis.com/Collection"
|
|
693
|
+
}
|
|
694
|
+
];
|
|
695
|
+
}
|
|
696
|
+
|
|
697
|
+
// Metadata for the ExportDataObjects LRO.
|
|
698
|
+
message ExportDataObjectsMetadata {
|
|
699
|
+
// The time the operation was created.
|
|
700
|
+
google.protobuf.Timestamp create_time = 1;
|
|
701
|
+
|
|
702
|
+
// The time the operation finished.
|
|
703
|
+
google.protobuf.Timestamp finish_time = 2;
|
|
704
|
+
}
|
|
705
|
+
|
|
706
|
+
// Response for the ExportDataObjects LRO.
|
|
707
|
+
message ExportDataObjectsResponse {}
|