java.lang.Object
com.google.protobuf.AbstractMessageLite
com.google.protobuf.AbstractMessage
com.google.protobuf.GeneratedMessage
com.google.cloud.discoveryengine.v1.Chunk
All Implemented Interfaces:
ChunkOrBuilder, com.google.protobuf.Message, com.google.protobuf.MessageLite, com.google.protobuf.MessageLiteOrBuilder, com.google.protobuf.MessageOrBuilder, Serializable

@Generated public final class Chunk extends com.google.protobuf.GeneratedMessage implements ChunkOrBuilder
 Chunk captures all raw metadata information of items to be recommended or
 searched in the chunk mode.
 
Protobuf type google.cloud.discoveryengine.v1.Chunk
See Also:
  • Field Details

    • NAME_FIELD_NUMBER

      public static final int NAME_FIELD_NUMBER
      See Also:
    • ID_FIELD_NUMBER

      public static final int ID_FIELD_NUMBER
      See Also:
    • CONTENT_FIELD_NUMBER

      public static final int CONTENT_FIELD_NUMBER
      See Also:
    • RELEVANCE_SCORE_FIELD_NUMBER

      public static final int RELEVANCE_SCORE_FIELD_NUMBER
      See Also:
    • DOCUMENT_METADATA_FIELD_NUMBER

      public static final int DOCUMENT_METADATA_FIELD_NUMBER
      See Also:
    • DERIVED_STRUCT_DATA_FIELD_NUMBER

      public static final int DERIVED_STRUCT_DATA_FIELD_NUMBER
      See Also:
    • PAGE_SPAN_FIELD_NUMBER

      public static final int PAGE_SPAN_FIELD_NUMBER
      See Also:
    • CHUNK_METADATA_FIELD_NUMBER

      public static final int CHUNK_METADATA_FIELD_NUMBER
      See Also:
    • DATA_URLS_FIELD_NUMBER

      public static final int DATA_URLS_FIELD_NUMBER
      See Also:
    • ANNOTATION_CONTENTS_FIELD_NUMBER

      public static final int ANNOTATION_CONTENTS_FIELD_NUMBER
      See Also:
    • ANNOTATION_METADATA_FIELD_NUMBER

      public static final int ANNOTATION_METADATA_FIELD_NUMBER
      See Also:
  • Method Details

    • getDescriptor

      public static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
    • internalGetFieldAccessorTable

      protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable()
      Specified by:
      internalGetFieldAccessorTable in class com.google.protobuf.GeneratedMessage
    • getName

      public String getName()
       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.
       
      string name = 1;
      Specified by:
      getName in interface ChunkOrBuilder
      Returns:
      The name.
    • getNameBytes

      public com.google.protobuf.ByteString getNameBytes()
       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.
       
      string name = 1;
      Specified by:
      getNameBytes in interface ChunkOrBuilder
      Returns:
      The bytes for name.
    • getId

      public String getId()
       Unique chunk ID of the current chunk.
       
      string id = 2;
      Specified by:
      getId in interface ChunkOrBuilder
      Returns:
      The id.
    • getIdBytes

      public com.google.protobuf.ByteString getIdBytes()
       Unique chunk ID of the current chunk.
       
      string id = 2;
      Specified by:
      getIdBytes in interface ChunkOrBuilder
      Returns:
      The bytes for id.
    • getContent

      public String getContent()
       Content is a string from a document (parsed content).
       
      string content = 3;
      Specified by:
      getContent in interface ChunkOrBuilder
      Returns:
      The content.
    • getContentBytes

      public com.google.protobuf.ByteString getContentBytes()
       Content is a string from a document (parsed content).
       
      string content = 3;
      Specified by:
      getContentBytes in interface ChunkOrBuilder
      Returns:
      The bytes for content.
    • hasRelevanceScore

      public boolean hasRelevanceScore()
       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
       [SearchResponse][google.cloud.discoveryengine.v1.SearchResponse].
       
      optional double relevance_score = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];
      Specified by:
      hasRelevanceScore in interface ChunkOrBuilder
      Returns:
      Whether the relevanceScore field is set.
    • getRelevanceScore

      public double getRelevanceScore()
       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
       [SearchResponse][google.cloud.discoveryengine.v1.SearchResponse].
       
      optional double relevance_score = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];
      Specified by:
      getRelevanceScore in interface ChunkOrBuilder
      Returns:
      The relevanceScore.
    • hasDocumentMetadata

      public boolean hasDocumentMetadata()
       Metadata of the document from the current chunk.
       
      .google.cloud.discoveryengine.v1.Chunk.DocumentMetadata document_metadata = 5;
      Specified by:
      hasDocumentMetadata in interface ChunkOrBuilder
      Returns:
      Whether the documentMetadata field is set.
    • getDocumentMetadata

      public Chunk.DocumentMetadata getDocumentMetadata()
       Metadata of the document from the current chunk.
       
      .google.cloud.discoveryengine.v1.Chunk.DocumentMetadata document_metadata = 5;
      Specified by:
      getDocumentMetadata in interface ChunkOrBuilder
      Returns:
      The documentMetadata.
    • getDocumentMetadataOrBuilder

      public Chunk.DocumentMetadataOrBuilder getDocumentMetadataOrBuilder()
       Metadata of the document from the current chunk.
       
      .google.cloud.discoveryengine.v1.Chunk.DocumentMetadata document_metadata = 5;
      Specified by:
      getDocumentMetadataOrBuilder in interface ChunkOrBuilder
    • hasDerivedStructData

      public boolean hasDerivedStructData()
       Output only. This field is OUTPUT_ONLY.
       It contains derived data that are not in the original input document.
       
      .google.protobuf.Struct derived_struct_data = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];
      Specified by:
      hasDerivedStructData in interface ChunkOrBuilder
      Returns:
      Whether the derivedStructData field is set.
    • getDerivedStructData

      public com.google.protobuf.Struct getDerivedStructData()
       Output only. This field is OUTPUT_ONLY.
       It contains derived data that are not in the original input document.
       
      .google.protobuf.Struct derived_struct_data = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];
      Specified by:
      getDerivedStructData in interface ChunkOrBuilder
      Returns:
      The derivedStructData.
    • getDerivedStructDataOrBuilder

      public com.google.protobuf.StructOrBuilder getDerivedStructDataOrBuilder()
       Output only. This field is OUTPUT_ONLY.
       It contains derived data that are not in the original input document.
       
      .google.protobuf.Struct derived_struct_data = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];
      Specified by:
      getDerivedStructDataOrBuilder in interface ChunkOrBuilder
    • hasPageSpan

      public boolean hasPageSpan()
       Page span of the chunk.
       
      .google.cloud.discoveryengine.v1.Chunk.PageSpan page_span = 6;
      Specified by:
      hasPageSpan in interface ChunkOrBuilder
      Returns:
      Whether the pageSpan field is set.
    • getPageSpan

      public Chunk.PageSpan getPageSpan()
       Page span of the chunk.
       
      .google.cloud.discoveryengine.v1.Chunk.PageSpan page_span = 6;
      Specified by:
      getPageSpan in interface ChunkOrBuilder
      Returns:
      The pageSpan.
    • getPageSpanOrBuilder

      public Chunk.PageSpanOrBuilder getPageSpanOrBuilder()
       Page span of the chunk.
       
      .google.cloud.discoveryengine.v1.Chunk.PageSpan page_span = 6;
      Specified by:
      getPageSpanOrBuilder in interface ChunkOrBuilder
    • hasChunkMetadata

      public boolean hasChunkMetadata()
       Output only. Metadata of the current chunk.
       
      .google.cloud.discoveryengine.v1.Chunk.ChunkMetadata chunk_metadata = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];
      Specified by:
      hasChunkMetadata in interface ChunkOrBuilder
      Returns:
      Whether the chunkMetadata field is set.
    • getChunkMetadata

      public Chunk.ChunkMetadata getChunkMetadata()
       Output only. Metadata of the current chunk.
       
      .google.cloud.discoveryengine.v1.Chunk.ChunkMetadata chunk_metadata = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];
      Specified by:
      getChunkMetadata in interface ChunkOrBuilder
      Returns:
      The chunkMetadata.
    • getChunkMetadataOrBuilder

      public Chunk.ChunkMetadataOrBuilder getChunkMetadataOrBuilder()
       Output only. Metadata of the current chunk.
       
      .google.cloud.discoveryengine.v1.Chunk.ChunkMetadata chunk_metadata = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];
      Specified by:
      getChunkMetadataOrBuilder in interface ChunkOrBuilder
    • getDataUrlsList

      public com.google.protobuf.ProtocolStringList getDataUrlsList()
       Output only. Image Data URLs if the current chunk contains images.
       Data URLs are composed of four parts: a prefix (data:), a MIME type
       indicating the type of data, an optional base64 token if non-textual,
       and the data itself:
       data:[<mediatype>][;base64],<data>
       
      repeated string data_urls = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];
      Specified by:
      getDataUrlsList in interface ChunkOrBuilder
      Returns:
      A list containing the dataUrls.
    • getDataUrlsCount

      public int getDataUrlsCount()
       Output only. Image Data URLs if the current chunk contains images.
       Data URLs are composed of four parts: a prefix (data:), a MIME type
       indicating the type of data, an optional base64 token if non-textual,
       and the data itself:
       data:[<mediatype>][;base64],<data>
       
      repeated string data_urls = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];
      Specified by:
      getDataUrlsCount in interface ChunkOrBuilder
      Returns:
      The count of dataUrls.
    • getDataUrls

      public String getDataUrls(int index)
       Output only. Image Data URLs if the current chunk contains images.
       Data URLs are composed of four parts: a prefix (data:), a MIME type
       indicating the type of data, an optional base64 token if non-textual,
       and the data itself:
       data:[<mediatype>][;base64],<data>
       
      repeated string data_urls = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];
      Specified by:
      getDataUrls in interface ChunkOrBuilder
      Parameters:
      index - The index of the element to return.
      Returns:
      The dataUrls at the given index.
    • getDataUrlsBytes

      public com.google.protobuf.ByteString getDataUrlsBytes(int index)
       Output only. Image Data URLs if the current chunk contains images.
       Data URLs are composed of four parts: a prefix (data:), a MIME type
       indicating the type of data, an optional base64 token if non-textual,
       and the data itself:
       data:[<mediatype>][;base64],<data>
       
      repeated string data_urls = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];
      Specified by:
      getDataUrlsBytes in interface ChunkOrBuilder
      Parameters:
      index - The index of the value to return.
      Returns:
      The bytes of the dataUrls at the given index.
    • getAnnotationContentsList

      public com.google.protobuf.ProtocolStringList getAnnotationContentsList()
       Output only. Annotation contents if the current chunk contains annotations.
       
      repeated string annotation_contents = 11 [(.google.api.field_behavior) = OUTPUT_ONLY];
      Specified by:
      getAnnotationContentsList in interface ChunkOrBuilder
      Returns:
      A list containing the annotationContents.
    • getAnnotationContentsCount

      public int getAnnotationContentsCount()
       Output only. Annotation contents if the current chunk contains annotations.
       
      repeated string annotation_contents = 11 [(.google.api.field_behavior) = OUTPUT_ONLY];
      Specified by:
      getAnnotationContentsCount in interface ChunkOrBuilder
      Returns:
      The count of annotationContents.
    • getAnnotationContents

      public String getAnnotationContents(int index)
       Output only. Annotation contents if the current chunk contains annotations.
       
      repeated string annotation_contents = 11 [(.google.api.field_behavior) = OUTPUT_ONLY];
      Specified by:
      getAnnotationContents in interface ChunkOrBuilder
      Parameters:
      index - The index of the element to return.
      Returns:
      The annotationContents at the given index.
    • getAnnotationContentsBytes

      public com.google.protobuf.ByteString getAnnotationContentsBytes(int index)
       Output only. Annotation contents if the current chunk contains annotations.
       
      repeated string annotation_contents = 11 [(.google.api.field_behavior) = OUTPUT_ONLY];
      Specified by:
      getAnnotationContentsBytes in interface ChunkOrBuilder
      Parameters:
      index - The index of the value to return.
      Returns:
      The bytes of the annotationContents at the given index.
    • getAnnotationMetadataList

      public List<Chunk.AnnotationMetadata> getAnnotationMetadataList()
       Output only. The annotation metadata includes structured content in the
       current chunk.
       
      repeated .google.cloud.discoveryengine.v1.Chunk.AnnotationMetadata annotation_metadata = 12 [(.google.api.field_behavior) = OUTPUT_ONLY];
      Specified by:
      getAnnotationMetadataList in interface ChunkOrBuilder
    • getAnnotationMetadataOrBuilderList

      public List<? extends Chunk.AnnotationMetadataOrBuilder> getAnnotationMetadataOrBuilderList()
       Output only. The annotation metadata includes structured content in the
       current chunk.
       
      repeated .google.cloud.discoveryengine.v1.Chunk.AnnotationMetadata annotation_metadata = 12 [(.google.api.field_behavior) = OUTPUT_ONLY];
      Specified by:
      getAnnotationMetadataOrBuilderList in interface ChunkOrBuilder
    • getAnnotationMetadataCount

      public int getAnnotationMetadataCount()
       Output only. The annotation metadata includes structured content in the
       current chunk.
       
      repeated .google.cloud.discoveryengine.v1.Chunk.AnnotationMetadata annotation_metadata = 12 [(.google.api.field_behavior) = OUTPUT_ONLY];
      Specified by:
      getAnnotationMetadataCount in interface ChunkOrBuilder
    • getAnnotationMetadata

      public Chunk.AnnotationMetadata getAnnotationMetadata(int index)
       Output only. The annotation metadata includes structured content in the
       current chunk.
       
      repeated .google.cloud.discoveryengine.v1.Chunk.AnnotationMetadata annotation_metadata = 12 [(.google.api.field_behavior) = OUTPUT_ONLY];
      Specified by:
      getAnnotationMetadata in interface ChunkOrBuilder
    • getAnnotationMetadataOrBuilder

      public Chunk.AnnotationMetadataOrBuilder getAnnotationMetadataOrBuilder(int index)
       Output only. The annotation metadata includes structured content in the
       current chunk.
       
      repeated .google.cloud.discoveryengine.v1.Chunk.AnnotationMetadata annotation_metadata = 12 [(.google.api.field_behavior) = OUTPUT_ONLY];
      Specified by:
      getAnnotationMetadataOrBuilder in interface ChunkOrBuilder
    • isInitialized

      public final boolean isInitialized()
      Specified by:
      isInitialized in interface com.google.protobuf.MessageLiteOrBuilder
      Overrides:
      isInitialized in class com.google.protobuf.GeneratedMessage
    • writeTo

      public void writeTo(com.google.protobuf.CodedOutputStream output) throws IOException
      Specified by:
      writeTo in interface com.google.protobuf.MessageLite
      Overrides:
      writeTo in class com.google.protobuf.GeneratedMessage
      Throws:
      IOException
    • getSerializedSize

      public int getSerializedSize()
      Specified by:
      getSerializedSize in interface com.google.protobuf.MessageLite
      Overrides:
      getSerializedSize in class com.google.protobuf.GeneratedMessage
    • equals

      public boolean equals(Object obj)
      Specified by:
      equals in interface com.google.protobuf.Message
      Overrides:
      equals in class com.google.protobuf.AbstractMessage
    • hashCode

      public int hashCode()
      Specified by:
      hashCode in interface com.google.protobuf.Message
      Overrides:
      hashCode in class com.google.protobuf.AbstractMessage
    • parseFrom

      public static Chunk parseFrom(ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException
      Throws:
      com.google.protobuf.InvalidProtocolBufferException
    • parseFrom

      public static Chunk parseFrom(ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
      Throws:
      com.google.protobuf.InvalidProtocolBufferException
    • parseFrom

      public static Chunk parseFrom(com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException
      Throws:
      com.google.protobuf.InvalidProtocolBufferException
    • parseFrom

      public static Chunk parseFrom(com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
      Throws:
      com.google.protobuf.InvalidProtocolBufferException
    • parseFrom

      public static Chunk parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException
      Throws:
      com.google.protobuf.InvalidProtocolBufferException
    • parseFrom

      public static Chunk parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
      Throws:
      com.google.protobuf.InvalidProtocolBufferException
    • parseFrom

      public static Chunk parseFrom(InputStream input) throws IOException
      Throws:
      IOException
    • parseFrom

      public static Chunk parseFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
      Throws:
      IOException
    • parseDelimitedFrom

      public static Chunk parseDelimitedFrom(InputStream input) throws IOException
      Throws:
      IOException
    • parseDelimitedFrom

      public static Chunk parseDelimitedFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
      Throws:
      IOException
    • parseFrom

      public static Chunk parseFrom(com.google.protobuf.CodedInputStream input) throws IOException
      Throws:
      IOException
    • parseFrom

      public static Chunk parseFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
      Throws:
      IOException
    • newBuilderForType

      public Chunk.Builder newBuilderForType()
      Specified by:
      newBuilderForType in interface com.google.protobuf.Message
      Specified by:
      newBuilderForType in interface com.google.protobuf.MessageLite
    • newBuilder

      public static Chunk.Builder newBuilder()
    • newBuilder

      public static Chunk.Builder newBuilder(Chunk prototype)
    • toBuilder

      public Chunk.Builder toBuilder()
      Specified by:
      toBuilder in interface com.google.protobuf.Message
      Specified by:
      toBuilder in interface com.google.protobuf.MessageLite
    • newBuilderForType

      protected Chunk.Builder newBuilderForType(com.google.protobuf.AbstractMessage.BuilderParent parent)
      Overrides:
      newBuilderForType in class com.google.protobuf.AbstractMessage
    • getDefaultInstance

      public static Chunk getDefaultInstance()
    • parser

      public static com.google.protobuf.Parser<Chunk> parser()
    • getParserForType

      public com.google.protobuf.Parser<Chunk> getParserForType()
      Specified by:
      getParserForType in interface com.google.protobuf.Message
      Specified by:
      getParserForType in interface com.google.protobuf.MessageLite
      Overrides:
      getParserForType in class com.google.protobuf.GeneratedMessage
    • getDefaultInstanceForType

      public Chunk getDefaultInstanceForType()
      Specified by:
      getDefaultInstanceForType in interface com.google.protobuf.MessageLiteOrBuilder
      Specified by:
      getDefaultInstanceForType in interface com.google.protobuf.MessageOrBuilder