8000 feat: add AskContexts and AsyncRetrieveContexts APIs to VertexRagService · googleapis/googleapis@c906519 · GitHub
[go: up one dir, main page]

Skip to content

Commit c906519

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

File tree

1 file changed

+91
-0
lines changed

1 file changed

+91
-0
lines changed

google/cloud/aiplatform/v1beta1/vertex_rag_service.proto

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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/v1beta1/content.proto";
24+
import "google/cloud/aiplatform/v1beta1/operation.proto";
2425
import "google/cloud/aiplatform/v1beta1/tool.proto";
2526
import "google/cloud/aiplatform/v1beta1/vertex_rag_data.proto";
27+
import "google/longrunning/operations.proto";
2628

2729
option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1";
2830
option go_package = "cloud.google.com/go/aiplatform/apiv1beta1/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: "/v1beta1/{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: "/v1beta1/{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.
@@ -346,3 +371,69 @@ message Claim {
346371
// Confidence score of this corroboration.
347372
optional float score = 4;
348373
}
374+
375+
// Agentic Retrieval Ask API for RAG.
376+
// Request message for
377+
// [VertexRagService.AskContexts][google.cloud.aiplatform.v1beta1.VertexRagService.AskContexts].
378+
message AskContextsRequest {
379+
// Required. The resource name of the Location from which to retrieve
380+
// RagContexts. The users must have permission to make a call in the project.
381+
// Format:
382+
// `projects/{project}/locations/{location}`.
383+
string parent = 1 [
384+
(google.api.field_behavior) = REQUIRED,
385+
(google.api.resource_reference) = {
386+
type: "locations.googleapis.com/Location"
387+
}
388+
];
389+
390+
// Required. Single RAG retrieve query.
391+
RagQuery query = 2 [(google.api.field_behavior) = REQUIRED];
392+
393+
// Optional. The tools to use for AskContexts.
394+
repeated Tool tools = 3 [(google.api.field_behavior) = OPTIONAL];
395+
}
396+
397+
// Response message for
398+
// [VertexRagService.AskContexts][google.cloud.aiplatform.v1beta1.VertexRagService.AskContexts].
399+
message AskContextsResponse {
400+
// The Retrieval Response.
401+
string response = 1;
402+
403+
// The contexts of the query.
404+
RagContexts contexts = 2;
405+
}
406+
407+
// Request message for
408+
// [VertexRagService.AsyncRetrieveContexts][google.cloud.aiplatform.v1beta1.VertexRagService.AsyncRetrieveContexts].
409+
message AsyncRetrieveContextsRequest {
410+
// Required. The resource name of the Location from which to retrieve
411+
// RagContexts. The users must have permission to make a call in the project.
412+
// Format:
413+
// `projects/{project}/locations/{location}`.
414+
string parent = 1 [
415+
(google.api.field_behavior) = REQUIRED,
416+
(google.api.resource_reference) = {
417+
type: "locations.googleapis.com/Location"
418+
}
419+
];
420+
421+
// Required. Single RAG retrieve query.
422+
RagQuery query = 2 [(google.api.field_behavior) = REQUIRED];
423+
424+
// Optional. The tools to use for AskContexts.
425+
repeated Tool tools = 3 [(google.api.field_behavior) = OPTIONAL];
426+
}
427+
428+
// Response message for
429+
// [VertexRagService.AsyncRetrieveContexts][google.cloud.aiplatform.v1beta1.VertexRagService.AsyncRetrieveContexts].
430+
message AsyncRetrieveContextsResponse {
431+
// The contexts of the query.
432+
RagContexts contexts = 1;
433+
}
434+
435+
// Metadata for AsyncRetrieveContextsOperation.
436+
message AsyncRetrieveContextsOperationMetadata {
437+
// The operation generic information.
438+
GenericOperationMetadata generic_metadata = 1;
439+
}

0 commit comments

Comments
 (0)
0