@@ -24,6 +24,7 @@ import "google/cloud/vectorsearch/v1beta/common.proto"; |
24 | 24 | import "google/cloud/vectorsearch/v1beta/data_object.proto"; |
25 | 25 | import "google/cloud/vectorsearch/v1beta/embedding_config.proto"; |
26 | 26 | import "google/protobuf/struct.proto"; |
| 27 | +import "google/rpc/status.proto"; |
27 | 28 |
|
28 | 29 | option csharp_namespace = "Google.Cloud.VectorSearch.V1Beta"; |
29 | 30 | option go_package = "cloud.google.com/go/vectorsearch/apiv1beta/vectorsearchpb;vectorsearchpb"; |
@@ -325,6 +326,10 @@ message SearchResponseMetadata { |
325 | 326 | // K-Nearest Neighbor (KNN) index engine. |
326 | 327 | bool used_knn = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; |
327 | 328 | } |
| 329 | + |
| 330 | + // Output only. Warnings or non-fatal errors that occurred during execution. |
| 331 | + repeated google.rpc.Status warnings = 3 |
| 332 | + [(google.api.field_behavior) = OUTPUT_ONLY]; |
328 | 333 | } |
329 | 334 |
|
330 | 335 | // Response for a search request. |
@@ -453,6 +458,13 @@ message Ranker { |
453 | 458 | // Reciprocal Rank Fusion ranking. |
454 | 459 | ReciprocalRankFusion rrf = 1; |
455 | 460 | } |
| 461 | + |
| 462 | + // The reranker to use for final ranking of the results combined by the |
| 463 | + // ranker. |
| 464 | + oneof reranker { |
| 465 | + // Optional. Vertex AI ranking. |
| 466 | + VertexRanker vertex_ranker = 2 [(google.api.field_behavior) = OPTIONAL]; |
| 467 | + } |
456 | 468 | } |
457 | 469 |
|
458 | 470 | // Defines the Reciprocal Rank Fusion (RRF) algorithm for result ranking. |
@@ -461,6 +473,39 @@ message ReciprocalRankFusion { |
461 | 473 | repeated double weights = 1 [(google.api.field_behavior) = REQUIRED]; |
462 | 474 | } |
463 | 475 |
|
| 476 | +// Defines a ranker using the Vertex AI ranking service. |
| 477 | +// See https://cloud.google.com/generative-ai-app-builder/docs/ranking for |
| 478 | +// details. |
| 479 | +message VertexRanker { |
| 480 | + // The record spec for text search. |
| 481 | + message TextRecordSpec { |
| 482 | + // Required. The query against which the records are ranked and scored. |
| 483 | + string query = 1 [(google.api.field_behavior) = REQUIRED]; |
| 484 | + |
| 485 | + // Optional. The template used to generate the record's title. |
| 486 | + string title_template = 2 [(google.api.field_behavior) = OPTIONAL]; |
| 487 | + |
| 488 | + // Optional. The template used to generate the record's content. |
| 489 | + string content_template = 3 [(google.api.field_behavior) = OPTIONAL]; |
| 490 | + } |
| 491 | + |
| 492 | + // The record specification for ranking. At least one record spec must be |
| 493 | + // set. |
| 494 | + oneof record_spec { |
| 495 | + // The record spec for text search. |
| 496 | + TextRecordSpec text_record_spec = 6; |
| 497 | + } |
| 498 | + |
| 499 | + // Required. The model used for ranking documents. The list of available |
| 500 | + // models is described in |
| 501 | + // https://docs.cloud.google.com/generative-ai-app-builder/docs/ranking#models. |
| 502 | + // Currently, only `semantic-ranker-fast@latest` is supported. |
| 503 | + string model = 4 [(google.api.field_behavior) = REQUIRED]; |
| 504 | + |
| 505 | + // Required. The number of documents to be processed for ranking. |
| 506 | + int32 top_n = 5 [(google.api.field_behavior) = REQUIRED]; |
| 507 | +} |
| 508 | + |
464 | 509 | // A response from a batch search operation. |
465 | 510 | message BatchSearchDataObjectsResponse { |
466 | 511 | // Output only. A list of search responses, one for each request in the batch. |
|