Skip to content

Commit e50da27

Browse files
Google APIscopybara-github
authored andcommitted
feat: add AskContexts and AsyncRetrieveContexts APIs to VertexRagService
PiperOrigin-RevId: 877654221
1 parent c906519 commit e50da27

File tree

1 file changed

+92
-1
lines changed

1 file changed

+92
-1
lines changed

google/cloud/aiplatform/v1/vertex_rag_service.proto

Lines changed: 92 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2025 Google LLC
1+
// Copyright 2026 Google LLC
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.
@@ -21,8 +21,10 @@ import "google/api/client.proto";
2121
import "google/api/field_behavior.proto";
2222
import "google/api/resource.proto";
2323
import "google/cloud/aiplatform/v1/content.proto";
24+
import "google/cloud/aiplatform/v1/operation.proto";
2425
import "google/cloud/aiplatform/v1/tool.proto";
2526
import "google/cloud/aiplatform/v1/vertex_rag_data.proto";
27+
import "google/longrunning/operations.proto";
2628

2729
option csharp_namespace = "Google.Cloud.AIPlatform.V1";
2830
option go_package = "cloud.google.com/go/aiplatform/apiv1/aiplatformpb;aiplatformpb";
@@ -69,6 +71,29 @@ service VertexRagService {
6971
};
7072
option (google.api.method_signature) = "parent,content,facts";
7173
}
74+
75+
// Agentic Retrieval Ask API for RAG.
76+
rpc AskContexts(AskContextsRequest) returns (AskContextsResponse) {
77+
option (google.api.http) = {
78+
post: "/v1/{parent=projects/*/locations/*}:askContexts"
79+
body: "*"
80+
};
81+
option (google.api.method_signature) = "parent,query";
82+
}
83+
84+
// Asynchronous API to retrieves relevant contexts for a query.
85+
rpc AsyncRetrieveContexts(AsyncRetrieveContextsRequest)
86+
returns (google.longrunning.Operation) {
87+
option (google.api.http) = {
88+
post: "/v1/{parent=projects/*/locations/*}:asyncRetrieveContexts"
89+
body: "*"
90+
};
91+
option (google.api.method_signature) = "parent,query";
92+
option (google.longrunning.operation_info) = {
93+
response_type: "AsyncRetrieveContextsResponse"
94+
metadata_type: "AsyncRetrieveContextsOperationMetadata"
95+
};
96+
}
7297
}
7398

7499
// A query to retrieve relevant contexts.
@@ -316,3 +341,69 @@ message Claim {
316341
// Confidence score of this corroboration.
317342
optional float score = 4;
318343
}
344+
345+
// Agentic Retrieval Ask API for RAG.
346+
// Request message for
347+
// [VertexRagService.AskContexts][google.cloud.aiplatform.v1.VertexRagService.AskContexts].
348+
message AskContextsRequest {
349+
// Required. The resource name of the Location from which to retrieve
350+
// RagContexts. The users must have permission to make a call in the project.
351+
// Format:
352+
// `projects/{project}/locations/{location}`.
353+
string parent = 1 [
354+
(google.api.field_behavior) = REQUIRED,
355+
(google.api.resource_reference) = {
356+
type: "locations.googleapis.com/Location"
357+
}
358+
];
359+
360+
// Required. Single RAG retrieve query.
361+
RagQuery query = 2 [(google.api.field_behavior) = REQUIRED];
362+
363+
// Optional. The tools to use for AskContexts.
364+
repeated Tool tools = 3 [(google.api.field_behavior) = OPTIONAL];
365+
}
366+
367+
// Response message for
368+
// [VertexRagService.AskContexts][google.cloud.aiplatform.v1.VertexRagService.AskContexts].
369+
message AskContextsResponse {
370+
// The Retrieval Response.
371+
string response = 1;
372+
373+
// The contexts of the query.
374+
RagContexts contexts = 2;
375+
}
376+
377+
// Request message for
378+
// [VertexRagService.AsyncRetrieveContexts][google.cloud.aiplatform.v1.VertexRagService.AsyncRetrieveContexts].
379+
message AsyncRetrieveContextsRequest {
380+
// Required. The resource name of the Location from which to retrieve
381+
// RagContexts. The users must have permission to make a call in the project.
382+
// Format:
383+
// `projects/{project}/locations/{location}`.
384+
string parent = 1 [
385+
(google.api.field_behavior) = REQUIRED,
386+
(google.api.resource_reference) = {
387+
type: "locations.googleapis.com/Location"
388+
}
389+
];
390+
391+
// Required. Single RAG retrieve query.
392+
RagQuery query = 2 [(google.api.field_behavior) = REQUIRED];
393+
394+
// Optional. The tools to use for AskContexts.
395+
repeated Tool tools = 3 [(google.api.field_behavior) = OPTIONAL];
396+
}
397+
398+
// Response message for
399+
// [VertexRagService.AsyncRetrieveContexts][google.cloud.aiplatform.v1.VertexRagService.AsyncRetrieveContexts].
400+
message AsyncRetrieveContextsResponse {
401+
// The contexts of the query.
402+
RagContexts contexts = 1;
403+
}
404+
405+
// Metadata for AsyncRetrieveContextsOperation.
406+
message AsyncRetrieveContextsOperationMetadata {
407+
// The operation generic information.
408+
GenericOperationMetadata generic_metadata = 1;
409+
}

0 commit comments

Comments
 (0)