| // Copyright 2025 Google LLC |
| // |
| // Licensed under the Apache License, Version 2.0 (the "License"); |
| // you may not use this file except in compliance with the License. |
| // You may obtain a copy of the License at |
| // |
| // http://www.apache.org/licenses/LICENSE-2.0 |
| // |
| // Unless required by applicable law or agreed to in writing, software |
| // distributed under the License is distributed on an "AS IS" BASIS, |
| // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| // See the License for the specific language governing permissions and |
| // limitations under the License. |
| |
| // Code generated by protoc-gen-go. DO NOT EDIT. |
| // versions: |
| // protoc-gen-go v1.36.11 |
| // protoc v6.33.2 |
| // source: google/cloud/discoveryengine/v1alpha/chunk.proto |
| |
| package discoveryenginepb |
| |
| import ( |
| reflect "reflect" |
| sync "sync" |
| unsafe "unsafe" |
| |
| _ "google.golang.org/genproto/googleapis/api/annotations" |
| protoreflect "google.golang.org/protobuf/reflect/protoreflect" |
| protoimpl "google.golang.org/protobuf/runtime/protoimpl" |
| structpb "google.golang.org/protobuf/types/known/structpb" |
| ) |
| |
| const ( |
| // Verify that this generated code is sufficiently up-to-date. |
| _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) |
| // Verify that runtime/protoimpl is sufficiently up-to-date. |
| _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) |
| ) |
| |
| // Chunk captures all raw metadata information of items to be recommended or |
| // searched in the chunk mode. |
| type Chunk struct { |
| state protoimpl.MessageState `protogen:"open.v1"` |
| // The full resource name of the chunk. |
| // Format: |
| // `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document_id}/chunks/{chunk_id}`. |
| // |
| // This field must be a UTF-8 encoded string with a length limit of 1024 |
| // characters. |
| Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` |
| // Unique chunk ID of the current chunk. |
| Id string `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty"` |
| // Content is a string from a document (parsed content). |
| Content string `protobuf:"bytes,3,opt,name=content,proto3" json:"content,omitempty"` |
| // Output only. Represents the relevance score based on similarity. |
| // Higher score indicates higher chunk relevance. |
| // The score is in range [-1.0, 1.0]. |
| // Only populated on [SearchService.SearchResponse][]. |
| RelevanceScore *float64 `protobuf:"fixed64,8,opt,name=relevance_score,json=relevanceScore,proto3,oneof" json:"relevance_score,omitempty"` |
| // Metadata of the document from the current chunk. |
| DocumentMetadata *Chunk_DocumentMetadata `protobuf:"bytes,5,opt,name=document_metadata,json=documentMetadata,proto3" json:"document_metadata,omitempty"` |
| // Output only. This field is OUTPUT_ONLY. |
| // It contains derived data that are not in the original input document. |
| DerivedStructData *structpb.Struct `protobuf:"bytes,4,opt,name=derived_struct_data,json=derivedStructData,proto3" json:"derived_struct_data,omitempty"` |
| // Page span of the chunk. |
| PageSpan *Chunk_PageSpan `protobuf:"bytes,6,opt,name=page_span,json=pageSpan,proto3" json:"page_span,omitempty"` |
| // Output only. Metadata of the current chunk. |
| ChunkMetadata *Chunk_ChunkMetadata `protobuf:"bytes,7,opt,name=chunk_metadata,json=chunkMetadata,proto3" json:"chunk_metadata,omitempty"` |
| unknownFields protoimpl.UnknownFields |
| sizeCache protoimpl.SizeCache |
| } |
| |
| func (x *Chunk) Reset() { |
| *x = Chunk{} |
| mi := &file_google_cloud_discoveryengine_v1alpha_chunk_proto_msgTypes[0] |
| ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) |
| ms.StoreMessageInfo(mi) |
| } |
| |
| func (x *Chunk) String() string { |
| return protoimpl.X.MessageStringOf(x) |
| } |
| |
| func (*Chunk) ProtoMessage() {} |
| |
| func (x *Chunk) ProtoReflect() protoreflect.Message { |
| mi := &file_google_cloud_discoveryengine_v1alpha_chunk_proto_msgTypes[0] |
| if x != nil { |
| ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) |
| if ms.LoadMessageInfo() == nil { |
| ms.StoreMessageInfo(mi) |
| } |
| return ms |
| } |
| return mi.MessageOf(x) |
| } |
| |
| // Deprecated: Use Chunk.ProtoReflect.Descriptor instead. |
| func (*Chunk) Descriptor() ([]byte, []int) { |
| return file_google_cloud_discoveryengine_v1alpha_chunk_proto_rawDescGZIP(), []int{0} |
| } |
| |
| func (x *Chunk) GetName() string { |
| if x != nil { |
| return x.Name |
| } |
| return "" |
| } |
| |
| func (x *Chunk) GetId() string { |
| if x != nil { |
| return x.Id |
| } |
| return "" |
| } |
| |
| func (x *Chunk) GetContent() string { |
| if x != nil { |
| return x.Content |
| } |
| return "" |
| } |
| |
| func (x *Chunk) GetRelevanceScore() float64 { |
| if x != nil && x.RelevanceScore != nil { |
| return *x.RelevanceScore |
| } |
| return 0 |
| } |
| |
| func (x *Chunk) GetDocumentMetadata() *Chunk_DocumentMetadata { |
| if x != nil { |
| return x.DocumentMetadata |
| } |
| return nil |
| } |
| |
| func (x *Chunk) GetDerivedStructData() *structpb.Struct { |
| if x != nil { |
| return x.DerivedStructData |
| } |
| return nil |
| } |
| |
| func (x *Chunk) GetPageSpan() *Chunk_PageSpan { |
| if x != nil { |
| return x.PageSpan |
| } |
| return nil |
| } |
| |
| func (x *Chunk) GetChunkMetadata() *Chunk_ChunkMetadata { |
| if x != nil { |
| return x.ChunkMetadata |
| } |
| return nil |
| } |
| |
| // Document metadata contains the information of the document of the current |
| // chunk. |
| type Chunk_DocumentMetadata struct { |
| state protoimpl.MessageState `protogen:"open.v1"` |
| // Uri of the document. |
| Uri string `protobuf:"bytes,1,opt,name=uri,proto3" json:"uri,omitempty"` |
| // Title of the document. |
| Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"` |
| // Data representation. |
| // The structured JSON data for the document. It should conform to the |
| // registered [Schema][google.cloud.discoveryengine.v1alpha.Schema] or an |
| // `INVALID_ARGUMENT` error is thrown. |
| StructData *structpb.Struct `protobuf:"bytes,3,opt,name=struct_data,json=structData,proto3" json:"struct_data,omitempty"` |
| unknownFields protoimpl.UnknownFields |
| sizeCache protoimpl.SizeCache |
| } |
| |
| func (x *Chunk_DocumentMetadata) Reset() { |
| *x = Chunk_DocumentMetadata{} |
| mi := &file_google_cloud_discoveryengine_v1alpha_chunk_proto_msgTypes[1] |
| ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) |
| ms.StoreMessageInfo(mi) |
| } |
| |
| func (x *Chunk_DocumentMetadata) String() string { |
| return protoimpl.X.MessageStringOf(x) |
| } |
| |
| func (*Chunk_DocumentMetadata) ProtoMessage() {} |
| |
| func (x *Chunk_DocumentMetadata) ProtoReflect() protoreflect.Message { |
| mi := &file_google_cloud_discoveryengine_v1alpha_chunk_proto_msgTypes[1] |
| if x != nil { |
| ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) |
| if ms.LoadMessageInfo() == nil { |
| ms.StoreMessageInfo(mi) |
| } |
| return ms |
| } |
| return mi.MessageOf(x) |
| } |
| |
| // Deprecated: Use Chunk_DocumentMetadata.ProtoReflect.Descriptor instead. |
| func (*Chunk_DocumentMetadata) Descriptor() ([]byte, []int) { |
| return file_google_cloud_discoveryengine_v1alpha_chunk_proto_rawDescGZIP(), []int{0, 0} |
| } |
| |
| func (x *Chunk_DocumentMetadata) GetUri() string { |
| if x != nil { |
| return x.Uri |
| } |
| return "" |
| } |
| |
| func (x *Chunk_DocumentMetadata) GetTitle() string { |
| if x != nil { |
| return x.Title |
| } |
| return "" |
| } |
| |
| func (x *Chunk_DocumentMetadata) GetStructData() *structpb.Struct { |
| if x != nil { |
| return x.StructData |
| } |
| return nil |
| } |
| |
| // Page span of the chunk. |
| type Chunk_PageSpan struct { |
| state protoimpl.MessageState `protogen:"open.v1"` |
| // The start page of the chunk. |
| PageStart int32 `protobuf:"varint,1,opt,name=page_start,json=pageStart,proto3" json:"page_start,omitempty"` |
| // The end page of the chunk. |
| PageEnd int32 `protobuf:"varint,2,opt,name=page_end,json=pageEnd,proto3" json:"page_end,omitempty"` |
| unknownFields protoimpl.UnknownFields |
| sizeCache protoimpl.SizeCache |
| } |
| |
| func (x *Chunk_PageSpan) Reset() { |
| *x = Chunk_PageSpan{} |
| mi := &file_google_cloud_discoveryengine_v1alpha_chunk_proto_msgTypes[2] |
| ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) |
| ms.StoreMessageInfo(mi) |
| } |
| |
| func (x *Chunk_PageSpan) String() string { |
| return protoimpl.X.MessageStringOf(x) |
| } |
| |
| func (*Chunk_PageSpan) ProtoMessage() {} |
| |
| func (x *Chunk_PageSpan) ProtoReflect() protoreflect.Message { |
| mi := &file_google_cloud_discoveryengine_v1alpha_chunk_proto_msgTypes[2] |
| if x != nil { |
| ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) |
| if ms.LoadMessageInfo() == nil { |
| ms.StoreMessageInfo(mi) |
| } |
| return ms |
| } |
| return mi.MessageOf(x) |
| } |
| |
| // Deprecated: Use Chunk_PageSpan.ProtoReflect.Descriptor instead. |
| func (*Chunk_PageSpan) Descriptor() ([]byte, []int) { |
| return file_google_cloud_discoveryengine_v1alpha_chunk_proto_rawDescGZIP(), []int{0, 1} |
| } |
| |
| func (x *Chunk_PageSpan) GetPageStart() int32 { |
| if x != nil { |
| return x.PageStart |
| } |
| return 0 |
| } |
| |
| func (x *Chunk_PageSpan) GetPageEnd() int32 { |
| if x != nil { |
| return x.PageEnd |
| } |
| return 0 |
| } |
| |
| // Metadata of the current chunk. This field is only populated on |
| // [SearchService.Search][google.cloud.discoveryengine.v1alpha.SearchService.Search] |
| // API. |
| type Chunk_ChunkMetadata struct { |
| state protoimpl.MessageState `protogen:"open.v1"` |
| // The previous chunks of the current chunk. The number is controlled by |
| // [SearchRequest.ContentSearchSpec.ChunkSpec.num_previous_chunks][google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.ChunkSpec.num_previous_chunks]. |
| // This field is only populated on |
| // [SearchService.Search][google.cloud.discoveryengine.v1alpha.SearchService.Search] |
| // API. |
| PreviousChunks []*Chunk `protobuf:"bytes,1,rep,name=previous_chunks,json=previousChunks,proto3" json:"previous_chunks,omitempty"` |
| // The next chunks of the current chunk. The number is controlled by |
| // [SearchRequest.ContentSearchSpec.ChunkSpec.num_next_chunks][google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.ChunkSpec.num_next_chunks]. |
| // This field is only populated on |
| // [SearchService.Search][google.cloud.discoveryengine.v1alpha.SearchService.Search] |
| // API. |
| NextChunks []*Chunk `protobuf:"bytes,2,rep,name=next_chunks,json=nextChunks,proto3" json:"next_chunks,omitempty"` |
| unknownFields protoimpl.UnknownFields |
| sizeCache protoimpl.SizeCache |
| } |
| |
| func (x *Chunk_ChunkMetadata) Reset() { |
| *x = Chunk_ChunkMetadata{} |
| mi := &file_google_cloud_discoveryengine_v1alpha_chunk_proto_msgTypes[3] |
| ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) |
| ms.StoreMessageInfo(mi) |
| } |
| |
| func (x *Chunk_ChunkMetadata) String() string { |
| return protoimpl.X.MessageStringOf(x) |
| } |
| |
| func (*Chunk_ChunkMetadata) ProtoMessage() {} |
| |
| func (x *Chunk_ChunkMetadata) ProtoReflect() protoreflect.Message { |
| mi := &file_google_cloud_discoveryengine_v1alpha_chunk_proto_msgTypes[3] |
| if x != nil { |
| ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) |
| if ms.LoadMessageInfo() == nil { |
| ms.StoreMessageInfo(mi) |
| } |
| return ms |
| } |
| return mi.MessageOf(x) |
| } |
| |
| // Deprecated: Use Chunk_ChunkMetadata.ProtoReflect.Descriptor instead. |
| func (*Chunk_ChunkMetadata) Descriptor() ([]byte, []int) { |
| return file_google_cloud_discoveryengine_v1alpha_chunk_proto_rawDescGZIP(), []int{0, 2} |
| } |
| |
| func (x *Chunk_ChunkMetadata) GetPreviousChunks() []*Chunk { |
| if x != nil { |
| return x.PreviousChunks |
| } |
| return nil |
| } |
| |
| func (x *Chunk_ChunkMetadata) GetNextChunks() []*Chunk { |
| if x != nil { |
| return x.NextChunks |
| } |
| return nil |
| } |
| |
| var File_google_cloud_discoveryengine_v1alpha_chunk_proto protoreflect.FileDescriptor |
| |
| const file_google_cloud_discoveryengine_v1alpha_chunk_proto_rawDesc = "" + |
| "\n" + |
| "0google/cloud/discoveryengine/v1alpha/chunk.proto\x12$google.cloud.discoveryengine.v1alpha\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1cgoogle/protobuf/struct.proto\"\xa6\t\n" + |
| "\x05Chunk\x12\x12\n" + |
| "\x04name\x18\x01 \x01(\tR\x04name\x12\x0e\n" + |
| "\x02id\x18\x02 \x01(\tR\x02id\x12\x18\n" + |
| "\acontent\x18\x03 \x01(\tR\acontent\x121\n" + |
| "\x0frelevance_score\x18\b \x01(\x01B\x03\xe0A\x03H\x00R\x0erelevanceScore\x88\x01\x01\x12i\n" + |
| "\x11document_metadata\x18\x05 \x01(\v2<.google.cloud.discoveryengine.v1alpha.Chunk.DocumentMetadataR\x10documentMetadata\x12L\n" + |
| "\x13derived_struct_data\x18\x04 \x01(\v2\x17.google.protobuf.StructB\x03\xe0A\x03R\x11derivedStructData\x12Q\n" + |
| "\tpage_span\x18\x06 \x01(\v24.google.cloud.discoveryengine.v1alpha.Chunk.PageSpanR\bpageSpan\x12e\n" + |
| "\x0echunk_metadata\x18\a \x01(\v29.google.cloud.discoveryengine.v1alpha.Chunk.ChunkMetadataB\x03\xe0A\x03R\rchunkMetadata\x1at\n" + |
| "\x10DocumentMetadata\x12\x10\n" + |
| "\x03uri\x18\x01 \x01(\tR\x03uri\x12\x14\n" + |
| "\x05title\x18\x02 \x01(\tR\x05title\x128\n" + |
| "\vstruct_data\x18\x03 \x01(\v2\x17.google.protobuf.StructR\n" + |
| "structData\x1aD\n" + |
| "\bPageSpan\x12\x1d\n" + |
| "\n" + |
| "page_start\x18\x01 \x01(\x05R\tpageStart\x12\x19\n" + |
| "\bpage_end\x18\x02 \x01(\x05R\apageEnd\x1a\xb3\x01\n" + |
| "\rChunkMetadata\x12T\n" + |
| "\x0fprevious_chunks\x18\x01 \x03(\v2+.google.cloud.discoveryengine.v1alpha.ChunkR\x0epreviousChunks\x12L\n" + |
| "\vnext_chunks\x18\x02 \x03(\v2+.google.cloud.discoveryengine.v1alpha.ChunkR\n" + |
| "nextChunks:\xb2\x02\xeaA\xae\x02\n" + |
| "$discoveryengine.googleapis.com/Chunk\x12uprojects/{project}/locations/{location}/dataStores/{data_store}/branches/{branch}/documents/{document}/chunks/{chunk}\x12\x8e\x01projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document}/chunks/{chunk}B\x12\n" + |
| "\x10_relevance_scoreB\x96\x02\n" + |
| "(com.google.cloud.discoveryengine.v1alphaB\n" + |
| "ChunkProtoP\x01ZRcloud.google.com/go/discoveryengine/apiv1alpha/discoveryenginepb;discoveryenginepb\xa2\x02\x0fDISCOVERYENGINE\xaa\x02$Google.Cloud.DiscoveryEngine.V1Alpha\xca\x02$Google\\Cloud\\DiscoveryEngine\\V1alpha\xea\x02'Google::Cloud::DiscoveryEngine::V1alphab\x06proto3" |
| |
| var ( |
| file_google_cloud_discoveryengine_v1alpha_chunk_proto_rawDescOnce sync.Once |
| file_google_cloud_discoveryengine_v1alpha_chunk_proto_rawDescData []byte |
| ) |
| |
| func file_google_cloud_discoveryengine_v1alpha_chunk_proto_rawDescGZIP() []byte { |
| file_google_cloud_discoveryengine_v1alpha_chunk_proto_rawDescOnce.Do(func() { |
| file_google_cloud_discoveryengine_v1alpha_chunk_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_google_cloud_discoveryengine_v1alpha_chunk_proto_rawDesc), len(file_google_cloud_discoveryengine_v1alpha_chunk_proto_rawDesc))) |
| }) |
| return file_google_cloud_discoveryengine_v1alpha_chunk_proto_rawDescData |
| } |
| |
| var file_google_cloud_discoveryengine_v1alpha_chunk_proto_msgTypes = make([]protoimpl.MessageInfo, 4) |
| var file_google_cloud_discoveryengine_v1alpha_chunk_proto_goTypes = []any{ |
| (*Chunk)(nil), // 0: google.cloud.discoveryengine.v1alpha.Chunk |
| (*Chunk_DocumentMetadata)(nil), // 1: google.cloud.discoveryengine.v1alpha.Chunk.DocumentMetadata |
| (*Chunk_PageSpan)(nil), // 2: google.cloud.discoveryengine.v1alpha.Chunk.PageSpan |
| (*Chunk_ChunkMetadata)(nil), // 3: google.cloud.discoveryengine.v1alpha.Chunk.ChunkMetadata |
| (*structpb.Struct)(nil), // 4: google.protobuf.Struct |
| } |
| var file_google_cloud_discoveryengine_v1alpha_chunk_proto_depIdxs = []int32{ |
| 1, // 0: google.cloud.discoveryengine.v1alpha.Chunk.document_metadata:type_name -> google.cloud.discoveryengine.v1alpha.Chunk.DocumentMetadata |
| 4, // 1: google.cloud.discoveryengine.v1alpha.Chunk.derived_struct_data:type_name -> google.protobuf.Struct |
| 2, // 2: google.cloud.discoveryengine.v1alpha.Chunk.page_span:type_name -> google.cloud.discoveryengine.v1alpha.Chunk.PageSpan |
| 3, // 3: google.cloud.discoveryengine.v1alpha.Chunk.chunk_metadata:type_name -> google.cloud.discoveryengine.v1alpha.Chunk.ChunkMetadata |
| 4, // 4: google.cloud.discoveryengine.v1alpha.Chunk.DocumentMetadata.struct_data:type_name -> google.protobuf.Struct |
| 0, // 5: google.cloud.discoveryengine.v1alpha.Chunk.ChunkMetadata.previous_chunks:type_name -> google.cloud.discoveryengine.v1alpha.Chunk |
| 0, // 6: google.cloud.discoveryengine.v1alpha.Chunk.ChunkMetadata.next_chunks:type_name -> google.cloud.discoveryengine.v1alpha.Chunk |
| 7, // [7:7] is the sub-list for method output_type |
| 7, // [7:7] is the sub-list for method input_type |
| 7, // [7:7] is the sub-list for extension type_name |
| 7, // [7:7] is the sub-list for extension extendee |
| 0, // [0:7] is the sub-list for field type_name |
| } |
| |
| func init() { file_google_cloud_discoveryengine_v1alpha_chunk_proto_init() } |
| func file_google_cloud_discoveryengine_v1alpha_chunk_proto_init() { |
| if File_google_cloud_discoveryengine_v1alpha_chunk_proto != nil { |
| return |
| } |
| file_google_cloud_discoveryengine_v1alpha_chunk_proto_msgTypes[0].OneofWrappers = []any{} |
| type x struct{} |
| out := protoimpl.TypeBuilder{ |
| File: protoimpl.DescBuilder{ |
| GoPackagePath: reflect.TypeOf(x{}).PkgPath(), |
| RawDescriptor: unsafe.Slice(unsafe.StringData(file_google_cloud_discoveryengine_v1alpha_chunk_proto_rawDesc), len(file_google_cloud_discoveryengine_v1alpha_chunk_proto_rawDesc)), |
| NumEnums: 0, |
| NumMessages: 4, |
| NumExtensions: 0, |
| NumServices: 0, |
| }, |
| GoTypes: file_google_cloud_discoveryengine_v1alpha_chunk_proto_goTypes, |
| DependencyIndexes: file_google_cloud_discoveryengine_v1alpha_chunk_proto_depIdxs, |
| MessageInfos: file_google_cloud_discoveryengine_v1alpha_chunk_proto_msgTypes, |
| }.Build() |
| File_google_cloud_discoveryengine_v1alpha_chunk_proto = out.File |
| file_google_cloud_discoveryengine_v1alpha_chunk_proto_goTypes = nil |
| file_google_cloud_discoveryengine_v1alpha_chunk_proto_depIdxs = nil |
| } |