xref: /aosp_15_r20/external/googleapis/google/cloud/aiplatform/v1beta1/vertex_rag_data.proto (revision d5c09012810ac0c9f33fe448fb6da8260d444cc9)
1// Copyright 2023 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//     http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15syntax = "proto3";
16
17package google.cloud.aiplatform.v1beta1;
18
19import "google/api/field_behavior.proto";
20import "google/api/resource.proto";
21import "google/cloud/aiplatform/v1beta1/io.proto";
22import "google/protobuf/timestamp.proto";
23
24option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1";
25option go_package = "cloud.google.com/go/aiplatform/apiv1beta1/aiplatformpb;aiplatformpb";
26option java_multiple_files = true;
27option java_outer_classname = "VertexRagDataProto";
28option java_package = "com.google.cloud.aiplatform.v1beta1";
29option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1";
30option ruby_package = "Google::Cloud::AIPlatform::V1beta1";
31
32// A RagCorpus is a RagFile container and a project can have multiple
33// RagCorpora.
34message RagCorpus {
35  option (google.api.resource) = {
36    type: "aiplatform.googleapis.com/RagCorpus"
37    pattern: "projects/{project}/locations/{location}/ragCorpora/{rag_corpus}"
38    plural: "ragCorpora"
39    singular: "ragCorpus"
40  };
41
42  // Output only. The resource name of the RagCorpus.
43  string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
44
45  // Required. The display name of the RagCorpus.
46  // The name can be up to 128 characters long and can consist of any UTF-8
47  // characters.
48  string display_name = 2 [(google.api.field_behavior) = REQUIRED];
49
50  // Optional. The description of the RagCorpus.
51  string description = 3 [(google.api.field_behavior) = OPTIONAL];
52
53  // Output only. Timestamp when this RagCorpus was created.
54  google.protobuf.Timestamp create_time = 4
55      [(google.api.field_behavior) = OUTPUT_ONLY];
56
57  // Output only. Timestamp when this RagCorpus was last updated.
58  google.protobuf.Timestamp update_time = 5
59      [(google.api.field_behavior) = OUTPUT_ONLY];
60}
61
62// A RagFile contains user data for chunking, embedding and indexing.
63message RagFile {
64  option (google.api.resource) = {
65    type: "aiplatform.googleapis.com/RagFile"
66    pattern: "projects/{project}/locations/{location}/ragCorpora/{rag_corpus}/ragFiles/{rag_file}"
67    plural: "ragFiles"
68    singular: "ragFile"
69  };
70
71  // The type of the RagFile.
72  enum RagFileType {
73    // RagFile type is unspecified.
74    RAG_FILE_TYPE_UNSPECIFIED = 0;
75
76    // RagFile type is TXT.
77    RAG_FILE_TYPE_TXT = 1;
78
79    // RagFile type is PDF.
80    RAG_FILE_TYPE_PDF = 2;
81  }
82
83  // The origin location of the RagFile if it is imported from Google Cloud
84  // Storage or Google Drive.
85  oneof rag_file_source {
86    // Output only. Google Cloud Storage location of the RagFile.
87    // It does not support wildcards in the GCS uri for now.
88    GcsSource gcs_source = 8 [(google.api.field_behavior) = OUTPUT_ONLY];
89
90    // Output only. Google Drive location. Supports importing individual files
91    // as well as Google Drive folders.
92    GoogleDriveSource google_drive_source = 9
93        [(google.api.field_behavior) = OUTPUT_ONLY];
94
95    // Output only. The RagFile is encapsulated and uploaded in the
96    // UploadRagFile request.
97    DirectUploadSource direct_upload_source = 10
98        [(google.api.field_behavior) = OUTPUT_ONLY];
99  }
100
101  // Output only. The resource name of the RagFile.
102  string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
103
104  // Required. The display name of the RagFile.
105  // The name can be up to 128 characters long and can consist of any UTF-8
106  // characters.
107  string display_name = 2 [(google.api.field_behavior) = REQUIRED];
108
109  // Optional. The description of the RagFile.
110  string description = 3 [(google.api.field_behavior) = OPTIONAL];
111
112  // Output only. The size of the RagFile in bytes.
113  int64 size_bytes = 4 [(google.api.field_behavior) = OUTPUT_ONLY];
114
115  // Output only. The type of the RagFile.
116  RagFileType rag_file_type = 5 [(google.api.field_behavior) = OUTPUT_ONLY];
117
118  // Output only. Timestamp when this RagFile was created.
119  google.protobuf.Timestamp create_time = 6
120      [(google.api.field_behavior) = OUTPUT_ONLY];
121
122  // Output only. Timestamp when this RagFile was last updated.
123  google.protobuf.Timestamp update_time = 7
124      [(google.api.field_behavior) = OUTPUT_ONLY];
125}
126
127// Specifies the size and overlap of chunks for RagFiles.
128message RagFileChunkingConfig {
129  // The size of the chunks.
130  int32 chunk_size = 1;
131
132  // The overlap between chunks.
133  int32 chunk_overlap = 2;
134}
135
136// Config for uploading RagFile.
137message UploadRagFileConfig {
138  // Specifies the size and overlap of chunks after uploading RagFile.
139  RagFileChunkingConfig rag_file_chunking_config = 1;
140}
141
142// Config for importing RagFiles.
143message ImportRagFilesConfig {
144  oneof import_source {
145    // Google Cloud Storage location. Supports importing individual files as
146    // well as entire Google Cloud Storage directories. Sample formats:
147    // - `gs://bucket_name/my_directory/object_name/my_file.txt`
148    // - `gs://bucket_name/my_directory`
149    GcsSource gcs_source = 2;
150
151    // Google Drive location. Supports importing individual files as
152    // well as Google Drive folders.
153    GoogleDriveSource google_drive_source = 3;
154  }
155
156  // Specifies the size and overlap of chunks after importing RagFiles.
157  RagFileChunkingConfig rag_file_chunking_config = 4;
158}
159