Class RagContexts.Context.Builder

java.lang.Object
com.google.protobuf.AbstractMessageLite.Builder
com.google.protobuf.AbstractMessage.Builder<BuilderT>
com.google.protobuf.GeneratedMessage.Builder<RagContexts.Context.Builder>
com.google.cloud.aiplatform.v1.RagContexts.Context.Builder
All Implemented Interfaces:
RagContexts.ContextOrBuilder, com.google.protobuf.Message.Builder, com.google.protobuf.MessageLite.Builder, com.google.protobuf.MessageLiteOrBuilder, com.google.protobuf.MessageOrBuilder, Cloneable
Enclosing class:
RagContexts.Context

public static final class RagContexts.Context.Builder extends com.google.protobuf.GeneratedMessage.Builder<RagContexts.Context.Builder> implements RagContexts.ContextOrBuilder
 A context of the query.
 
Protobuf type google.cloud.aiplatform.v1.RagContexts.Context
  • 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.Builder<RagContexts.Context.Builder>
    • clear

      Specified by:
      clear in interface com.google.protobuf.Message.Builder
      Specified by:
      clear in interface com.google.protobuf.MessageLite.Builder
      Overrides:
      clear in class com.google.protobuf.GeneratedMessage.Builder<RagContexts.Context.Builder>
    • getDescriptorForType

      public com.google.protobuf.Descriptors.Descriptor getDescriptorForType()
      Specified by:
      getDescriptorForType in interface com.google.protobuf.Message.Builder
      Specified by:
      getDescriptorForType in interface com.google.protobuf.MessageOrBuilder
      Overrides:
      getDescriptorForType in class com.google.protobuf.GeneratedMessage.Builder<RagContexts.Context.Builder>
    • getDefaultInstanceForType

      public RagContexts.Context getDefaultInstanceForType()
      Specified by:
      getDefaultInstanceForType in interface com.google.protobuf.MessageLiteOrBuilder
      Specified by:
      getDefaultInstanceForType in interface com.google.protobuf.MessageOrBuilder
    • build

      public RagContexts.Context build()
      Specified by:
      build in interface com.google.protobuf.Message.Builder
      Specified by:
      build in interface com.google.protobuf.MessageLite.Builder
    • buildPartial

      public RagContexts.Context buildPartial()
      Specified by:
      buildPartial in interface com.google.protobuf.Message.Builder
      Specified by:
      buildPartial in interface com.google.protobuf.MessageLite.Builder
    • mergeFrom

      public RagContexts.Context.Builder mergeFrom(com.google.protobuf.Message other)
      Specified by:
      mergeFrom in interface com.google.protobuf.Message.Builder
      Overrides:
      mergeFrom in class com.google.protobuf.AbstractMessage.Builder<RagContexts.Context.Builder>
    • mergeFrom

    • isInitialized

      public final boolean isInitialized()
      Specified by:
      isInitialized in interface com.google.protobuf.MessageLiteOrBuilder
      Overrides:
      isInitialized in class com.google.protobuf.GeneratedMessage.Builder<RagContexts.Context.Builder>
    • mergeFrom

      public RagContexts.Context.Builder mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
      Specified by:
      mergeFrom in interface com.google.protobuf.Message.Builder
      Specified by:
      mergeFrom in interface com.google.protobuf.MessageLite.Builder
      Overrides:
      mergeFrom in class com.google.protobuf.AbstractMessage.Builder<RagContexts.Context.Builder>
      Throws:
      IOException
    • getSourceUri

      public String getSourceUri()
       If the file is imported from Cloud Storage or Google Drive, source_uri
       will be original file URI in Cloud Storage or Google Drive; if file is
       uploaded, source_uri will be file display name.
       
      string source_uri = 1;
      Specified by:
      getSourceUri in interface RagContexts.ContextOrBuilder
      Returns:
      The sourceUri.
    • getSourceUriBytes

      public com.google.protobuf.ByteString getSourceUriBytes()
       If the file is imported from Cloud Storage or Google Drive, source_uri
       will be original file URI in Cloud Storage or Google Drive; if file is
       uploaded, source_uri will be file display name.
       
      string source_uri = 1;
      Specified by:
      getSourceUriBytes in interface RagContexts.ContextOrBuilder
      Returns:
      The bytes for sourceUri.
    • setSourceUri

      public RagContexts.Context.Builder setSourceUri(String value)
       If the file is imported from Cloud Storage or Google Drive, source_uri
       will be original file URI in Cloud Storage or Google Drive; if file is
       uploaded, source_uri will be file display name.
       
      string source_uri = 1;
      Parameters:
      value - The sourceUri to set.
      Returns:
      This builder for chaining.
    • clearSourceUri

      public RagContexts.Context.Builder clearSourceUri()
       If the file is imported from Cloud Storage or Google Drive, source_uri
       will be original file URI in Cloud Storage or Google Drive; if file is
       uploaded, source_uri will be file display name.
       
      string source_uri = 1;
      Returns:
      This builder for chaining.
    • setSourceUriBytes

      public RagContexts.Context.Builder setSourceUriBytes(com.google.protobuf.ByteString value)
       If the file is imported from Cloud Storage or Google Drive, source_uri
       will be original file URI in Cloud Storage or Google Drive; if file is
       uploaded, source_uri will be file display name.
       
      string source_uri = 1;
      Parameters:
      value - The bytes for sourceUri to set.
      Returns:
      This builder for chaining.
    • getSourceDisplayName

      public String getSourceDisplayName()
       The file display name.
       
      string source_display_name = 5;
      Specified by:
      getSourceDisplayName in interface RagContexts.ContextOrBuilder
      Returns:
      The sourceDisplayName.
    • getSourceDisplayNameBytes

      public com.google.protobuf.ByteString getSourceDisplayNameBytes()
       The file display name.
       
      string source_display_name = 5;
      Specified by:
      getSourceDisplayNameBytes in interface RagContexts.ContextOrBuilder
      Returns:
      The bytes for sourceDisplayName.
    • setSourceDisplayName

      public RagContexts.Context.Builder setSourceDisplayName(String value)
       The file display name.
       
      string source_display_name = 5;
      Parameters:
      value - The sourceDisplayName to set.
      Returns:
      This builder for chaining.
    • clearSourceDisplayName

      public RagContexts.Context.Builder clearSourceDisplayName()
       The file display name.
       
      string source_display_name = 5;
      Returns:
      This builder for chaining.
    • setSourceDisplayNameBytes

      public RagContexts.Context.Builder setSourceDisplayNameBytes(com.google.protobuf.ByteString value)
       The file display name.
       
      string source_display_name = 5;
      Parameters:
      value - The bytes for sourceDisplayName to set.
      Returns:
      This builder for chaining.
    • getText

      public String getText()
       The text chunk.
       
      string text = 2;
      Specified by:
      getText in interface RagContexts.ContextOrBuilder
      Returns:
      The text.
    • getTextBytes

      public com.google.protobuf.ByteString getTextBytes()
       The text chunk.
       
      string text = 2;
      Specified by:
      getTextBytes in interface RagContexts.ContextOrBuilder
      Returns:
      The bytes for text.
    • setText

      public RagContexts.Context.Builder setText(String value)
       The text chunk.
       
      string text = 2;
      Parameters:
      value - The text to set.
      Returns:
      This builder for chaining.
    • clearText

      public RagContexts.Context.Builder clearText()
       The text chunk.
       
      string text = 2;
      Returns:
      This builder for chaining.
    • setTextBytes

      public RagContexts.Context.Builder setTextBytes(com.google.protobuf.ByteString value)
       The text chunk.
       
      string text = 2;
      Parameters:
      value - The bytes for text to set.
      Returns:
      This builder for chaining.
    • hasScore

      public boolean hasScore()
       According to the underlying Vector DB and the selected metric type, the
       score can be either the distance or the similarity between the query and
       the context and its range depends on the metric type.
      
       For example, if the metric type is COSINE_DISTANCE, it represents the
       distance between the query and the context. The larger the distance, the
       less relevant the context is to the query. The range is [0, 2], while 0
       means the most relevant and 2 means the least relevant.
       
      optional double score = 6;
      Specified by:
      hasScore in interface RagContexts.ContextOrBuilder
      Returns:
      Whether the score field is set.
    • getScore

      public double getScore()
       According to the underlying Vector DB and the selected metric type, the
       score can be either the distance or the similarity between the query and
       the context and its range depends on the metric type.
      
       For example, if the metric type is COSINE_DISTANCE, it represents the
       distance between the query and the context. The larger the distance, the
       less relevant the context is to the query. The range is [0, 2], while 0
       means the most relevant and 2 means the least relevant.
       
      optional double score = 6;
      Specified by:
      getScore in interface RagContexts.ContextOrBuilder
      Returns:
      The score.
    • setScore

      public RagContexts.Context.Builder setScore(double value)
       According to the underlying Vector DB and the selected metric type, the
       score can be either the distance or the similarity between the query and
       the context and its range depends on the metric type.
      
       For example, if the metric type is COSINE_DISTANCE, it represents the
       distance between the query and the context. The larger the distance, the
       less relevant the context is to the query. The range is [0, 2], while 0
       means the most relevant and 2 means the least relevant.
       
      optional double score = 6;
      Parameters:
      value - The score to set.
      Returns:
      This builder for chaining.
    • clearScore

      public RagContexts.Context.Builder clearScore()
       According to the underlying Vector DB and the selected metric type, the
       score can be either the distance or the similarity between the query and
       the context and its range depends on the metric type.
      
       For example, if the metric type is COSINE_DISTANCE, it represents the
       distance between the query and the context. The larger the distance, the
       less relevant the context is to the query. The range is [0, 2], while 0
       means the most relevant and 2 means the least relevant.
       
      optional double score = 6;
      Returns:
      This builder for chaining.
    • hasChunk

      public boolean hasChunk()
       Context of the retrieved chunk.
       
      .google.cloud.aiplatform.v1.RagChunk chunk = 7;
      Specified by:
      hasChunk in interface RagContexts.ContextOrBuilder
      Returns:
      Whether the chunk field is set.
    • getChunk

      public RagChunk getChunk()
       Context of the retrieved chunk.
       
      .google.cloud.aiplatform.v1.RagChunk chunk = 7;
      Specified by:
      getChunk in interface RagContexts.ContextOrBuilder
      Returns:
      The chunk.
    • setChunk

      public RagContexts.Context.Builder setChunk(RagChunk value)
       Context of the retrieved chunk.
       
      .google.cloud.aiplatform.v1.RagChunk chunk = 7;
    • setChunk

      public RagContexts.Context.Builder setChunk(RagChunk.Builder builderForValue)
       Context of the retrieved chunk.
       
      .google.cloud.aiplatform.v1.RagChunk chunk = 7;
    • mergeChunk

      public RagContexts.Context.Builder mergeChunk(RagChunk value)
       Context of the retrieved chunk.
       
      .google.cloud.aiplatform.v1.RagChunk chunk = 7;
    • clearChunk

      public RagContexts.Context.Builder clearChunk()
       Context of the retrieved chunk.
       
      .google.cloud.aiplatform.v1.RagChunk chunk = 7;
    • getChunkBuilder

      public RagChunk.Builder getChunkBuilder()
       Context of the retrieved chunk.
       
      .google.cloud.aiplatform.v1.RagChunk chunk = 7;
    • getChunkOrBuilder

      public RagChunkOrBuilder getChunkOrBuilder()
       Context of the retrieved chunk.
       
      .google.cloud.aiplatform.v1.RagChunk chunk = 7;
      Specified by:
      getChunkOrBuilder in interface RagContexts.ContextOrBuilder