Class CheckGroundingRequest.Builder

java.lang.Object
com.google.protobuf.AbstractMessageLite.Builder
com.google.protobuf.AbstractMessage.Builder<BuilderT>
com.google.protobuf.GeneratedMessage.Builder<CheckGroundingRequest.Builder>
com.google.cloud.discoveryengine.v1beta.CheckGroundingRequest.Builder
All Implemented Interfaces:
CheckGroundingRequestOrBuilder, com.google.protobuf.Message.Builder, com.google.protobuf.MessageLite.Builder, com.google.protobuf.MessageLiteOrBuilder, com.google.protobuf.MessageOrBuilder, Cloneable
Enclosing class:
CheckGroundingRequest

public static final class CheckGroundingRequest.Builder extends com.google.protobuf.GeneratedMessage.Builder<CheckGroundingRequest.Builder> implements CheckGroundingRequestOrBuilder
 Request message for
 [GroundedGenerationService.CheckGrounding][google.cloud.discoveryengine.v1beta.GroundedGenerationService.CheckGrounding]
 method.
 
Protobuf type google.cloud.discoveryengine.v1beta.CheckGroundingRequest
  • Method Details

    • getDescriptor

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

      protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection(int number)
      Overrides:
      internalGetMapFieldReflection in class com.google.protobuf.GeneratedMessage.Builder<CheckGroundingRequest.Builder>
    • internalGetMutableMapFieldReflection

      protected com.google.protobuf.MapFieldReflectionAccessor internalGetMutableMapFieldReflection(int number)
      Overrides:
      internalGetMutableMapFieldReflection in class com.google.protobuf.GeneratedMessage.Builder<CheckGroundingRequest.Builder>
    • internalGetFieldAccessorTable

      protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable()
      Specified by:
      internalGetFieldAccessorTable in class com.google.protobuf.GeneratedMessage.Builder<CheckGroundingRequest.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<CheckGroundingRequest.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<CheckGroundingRequest.Builder>
    • getDefaultInstanceForType

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

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

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

      public CheckGroundingRequest.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<CheckGroundingRequest.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<CheckGroundingRequest.Builder>
    • mergeFrom

      public CheckGroundingRequest.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<CheckGroundingRequest.Builder>
      Throws:
      IOException
    • getGroundingConfig

      public String getGroundingConfig()
       Required. The resource name of the grounding config, such as
       `projects/*/locations/global/groundingConfigs/default_grounding_config`.
       
      string grounding_config = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
      Specified by:
      getGroundingConfig in interface CheckGroundingRequestOrBuilder
      Returns:
      The groundingConfig.
    • getGroundingConfigBytes

      public com.google.protobuf.ByteString getGroundingConfigBytes()
       Required. The resource name of the grounding config, such as
       `projects/*/locations/global/groundingConfigs/default_grounding_config`.
       
      string grounding_config = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
      Specified by:
      getGroundingConfigBytes in interface CheckGroundingRequestOrBuilder
      Returns:
      The bytes for groundingConfig.
    • setGroundingConfig

      public CheckGroundingRequest.Builder setGroundingConfig(String value)
       Required. The resource name of the grounding config, such as
       `projects/*/locations/global/groundingConfigs/default_grounding_config`.
       
      string grounding_config = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
      Parameters:
      value - The groundingConfig to set.
      Returns:
      This builder for chaining.
    • clearGroundingConfig

      public CheckGroundingRequest.Builder clearGroundingConfig()
       Required. The resource name of the grounding config, such as
       `projects/*/locations/global/groundingConfigs/default_grounding_config`.
       
      string grounding_config = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
      Returns:
      This builder for chaining.
    • setGroundingConfigBytes

      public CheckGroundingRequest.Builder setGroundingConfigBytes(com.google.protobuf.ByteString value)
       Required. The resource name of the grounding config, such as
       `projects/*/locations/global/groundingConfigs/default_grounding_config`.
       
      string grounding_config = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
      Parameters:
      value - The bytes for groundingConfig to set.
      Returns:
      This builder for chaining.
    • getAnswerCandidate

      public String getAnswerCandidate()
       Answer candidate to check. It can have a maximum length of 4096 tokens.
       
      string answer_candidate = 2;
      Specified by:
      getAnswerCandidate in interface CheckGroundingRequestOrBuilder
      Returns:
      The answerCandidate.
    • getAnswerCandidateBytes

      public com.google.protobuf.ByteString getAnswerCandidateBytes()
       Answer candidate to check. It can have a maximum length of 4096 tokens.
       
      string answer_candidate = 2;
      Specified by:
      getAnswerCandidateBytes in interface CheckGroundingRequestOrBuilder
      Returns:
      The bytes for answerCandidate.
    • setAnswerCandidate

      public CheckGroundingRequest.Builder setAnswerCandidate(String value)
       Answer candidate to check. It can have a maximum length of 4096 tokens.
       
      string answer_candidate = 2;
      Parameters:
      value - The answerCandidate to set.
      Returns:
      This builder for chaining.
    • clearAnswerCandidate

      public CheckGroundingRequest.Builder clearAnswerCandidate()
       Answer candidate to check. It can have a maximum length of 4096 tokens.
       
      string answer_candidate = 2;
      Returns:
      This builder for chaining.
    • setAnswerCandidateBytes

      public CheckGroundingRequest.Builder setAnswerCandidateBytes(com.google.protobuf.ByteString value)
       Answer candidate to check. It can have a maximum length of 4096 tokens.
       
      string answer_candidate = 2;
      Parameters:
      value - The bytes for answerCandidate to set.
      Returns:
      This builder for chaining.
    • getFactsList

      public List<GroundingFact> getFactsList()
       List of facts for the grounding check.
       We support up to 200 facts.
       
      repeated .google.cloud.discoveryengine.v1beta.GroundingFact facts = 3;
      Specified by:
      getFactsList in interface CheckGroundingRequestOrBuilder
    • getFactsCount

      public int getFactsCount()
       List of facts for the grounding check.
       We support up to 200 facts.
       
      repeated .google.cloud.discoveryengine.v1beta.GroundingFact facts = 3;
      Specified by:
      getFactsCount in interface CheckGroundingRequestOrBuilder
    • getFacts

      public GroundingFact getFacts(int index)
       List of facts for the grounding check.
       We support up to 200 facts.
       
      repeated .google.cloud.discoveryengine.v1beta.GroundingFact facts = 3;
      Specified by:
      getFacts in interface CheckGroundingRequestOrBuilder
    • setFacts

      public CheckGroundingRequest.Builder setFacts(int index, GroundingFact value)
       List of facts for the grounding check.
       We support up to 200 facts.
       
      repeated .google.cloud.discoveryengine.v1beta.GroundingFact facts = 3;
    • setFacts

      public CheckGroundingRequest.Builder setFacts(int index, GroundingFact.Builder builderForValue)
       List of facts for the grounding check.
       We support up to 200 facts.
       
      repeated .google.cloud.discoveryengine.v1beta.GroundingFact facts = 3;
    • addFacts

       List of facts for the grounding check.
       We support up to 200 facts.
       
      repeated .google.cloud.discoveryengine.v1beta.GroundingFact facts = 3;
    • addFacts

      public CheckGroundingRequest.Builder addFacts(int index, GroundingFact value)
       List of facts for the grounding check.
       We support up to 200 facts.
       
      repeated .google.cloud.discoveryengine.v1beta.GroundingFact facts = 3;
    • addFacts

      public CheckGroundingRequest.Builder addFacts(GroundingFact.Builder builderForValue)
       List of facts for the grounding check.
       We support up to 200 facts.
       
      repeated .google.cloud.discoveryengine.v1beta.GroundingFact facts = 3;
    • addFacts

      public CheckGroundingRequest.Builder addFacts(int index, GroundingFact.Builder builderForValue)
       List of facts for the grounding check.
       We support up to 200 facts.
       
      repeated .google.cloud.discoveryengine.v1beta.GroundingFact facts = 3;
    • addAllFacts

      public CheckGroundingRequest.Builder addAllFacts(Iterable<? extends GroundingFact> values)
       List of facts for the grounding check.
       We support up to 200 facts.
       
      repeated .google.cloud.discoveryengine.v1beta.GroundingFact facts = 3;
    • clearFacts

      public CheckGroundingRequest.Builder clearFacts()
       List of facts for the grounding check.
       We support up to 200 facts.
       
      repeated .google.cloud.discoveryengine.v1beta.GroundingFact facts = 3;
    • removeFacts

      public CheckGroundingRequest.Builder removeFacts(int index)
       List of facts for the grounding check.
       We support up to 200 facts.
       
      repeated .google.cloud.discoveryengine.v1beta.GroundingFact facts = 3;
    • getFactsBuilder

      public GroundingFact.Builder getFactsBuilder(int index)
       List of facts for the grounding check.
       We support up to 200 facts.
       
      repeated .google.cloud.discoveryengine.v1beta.GroundingFact facts = 3;
    • getFactsOrBuilder

      public GroundingFactOrBuilder getFactsOrBuilder(int index)
       List of facts for the grounding check.
       We support up to 200 facts.
       
      repeated .google.cloud.discoveryengine.v1beta.GroundingFact facts = 3;
      Specified by:
      getFactsOrBuilder in interface CheckGroundingRequestOrBuilder
    • getFactsOrBuilderList

      public List<? extends GroundingFactOrBuilder> getFactsOrBuilderList()
       List of facts for the grounding check.
       We support up to 200 facts.
       
      repeated .google.cloud.discoveryengine.v1beta.GroundingFact facts = 3;
      Specified by:
      getFactsOrBuilderList in interface CheckGroundingRequestOrBuilder
    • addFactsBuilder

      public GroundingFact.Builder addFactsBuilder()
       List of facts for the grounding check.
       We support up to 200 facts.
       
      repeated .google.cloud.discoveryengine.v1beta.GroundingFact facts = 3;
    • addFactsBuilder

      public GroundingFact.Builder addFactsBuilder(int index)
       List of facts for the grounding check.
       We support up to 200 facts.
       
      repeated .google.cloud.discoveryengine.v1beta.GroundingFact facts = 3;
    • getFactsBuilderList

      public List<GroundingFact.Builder> getFactsBuilderList()
       List of facts for the grounding check.
       We support up to 200 facts.
       
      repeated .google.cloud.discoveryengine.v1beta.GroundingFact facts = 3;
    • hasGroundingSpec

      public boolean hasGroundingSpec()
       Configuration of the grounding check.
       
      .google.cloud.discoveryengine.v1beta.CheckGroundingSpec grounding_spec = 4;
      Specified by:
      hasGroundingSpec in interface CheckGroundingRequestOrBuilder
      Returns:
      Whether the groundingSpec field is set.
    • getGroundingSpec

      public CheckGroundingSpec getGroundingSpec()
       Configuration of the grounding check.
       
      .google.cloud.discoveryengine.v1beta.CheckGroundingSpec grounding_spec = 4;
      Specified by:
      getGroundingSpec in interface CheckGroundingRequestOrBuilder
      Returns:
      The groundingSpec.
    • setGroundingSpec

      public CheckGroundingRequest.Builder setGroundingSpec(CheckGroundingSpec value)
       Configuration of the grounding check.
       
      .google.cloud.discoveryengine.v1beta.CheckGroundingSpec grounding_spec = 4;
    • setGroundingSpec

      public CheckGroundingRequest.Builder setGroundingSpec(CheckGroundingSpec.Builder builderForValue)
       Configuration of the grounding check.
       
      .google.cloud.discoveryengine.v1beta.CheckGroundingSpec grounding_spec = 4;
    • mergeGroundingSpec

      public CheckGroundingRequest.Builder mergeGroundingSpec(CheckGroundingSpec value)
       Configuration of the grounding check.
       
      .google.cloud.discoveryengine.v1beta.CheckGroundingSpec grounding_spec = 4;
    • clearGroundingSpec

      public CheckGroundingRequest.Builder clearGroundingSpec()
       Configuration of the grounding check.
       
      .google.cloud.discoveryengine.v1beta.CheckGroundingSpec grounding_spec = 4;
    • getGroundingSpecBuilder

      public CheckGroundingSpec.Builder getGroundingSpecBuilder()
       Configuration of the grounding check.
       
      .google.cloud.discoveryengine.v1beta.CheckGroundingSpec grounding_spec = 4;
    • getGroundingSpecOrBuilder

      public CheckGroundingSpecOrBuilder getGroundingSpecOrBuilder()
       Configuration of the grounding check.
       
      .google.cloud.discoveryengine.v1beta.CheckGroundingSpec grounding_spec = 4;
      Specified by:
      getGroundingSpecOrBuilder in interface CheckGroundingRequestOrBuilder
    • getUserLabelsCount

      public int getUserLabelsCount()
      Description copied from interface: CheckGroundingRequestOrBuilder
       The user labels applied to a resource must meet the following requirements:
      
       * Each resource can have multiple labels, up to a maximum of 64.
       * Each label must be a key-value pair.
       * Keys have a minimum length of 1 character and a maximum length of 63
       characters and cannot be empty. Values can be empty and have a maximum
       length of 63 characters.
       * Keys and values can contain only lowercase letters, numeric characters,
       underscores, and dashes. All characters must use UTF-8 encoding, and
       international characters are allowed.
       * The key portion of a label must be unique. However, you can use the same
       key with multiple resources.
       * Keys must start with a lowercase letter or international character.
      
       See [Google Cloud
       Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements)
       for more details.
       
      map<string, string> user_labels = 5;
      Specified by:
      getUserLabelsCount in interface CheckGroundingRequestOrBuilder
    • containsUserLabels

      public boolean containsUserLabels(String key)
       The user labels applied to a resource must meet the following requirements:
      
       * Each resource can have multiple labels, up to a maximum of 64.
       * Each label must be a key-value pair.
       * Keys have a minimum length of 1 character and a maximum length of 63
       characters and cannot be empty. Values can be empty and have a maximum
       length of 63 characters.
       * Keys and values can contain only lowercase letters, numeric characters,
       underscores, and dashes. All characters must use UTF-8 encoding, and
       international characters are allowed.
       * The key portion of a label must be unique. However, you can use the same
       key with multiple resources.
       * Keys must start with a lowercase letter or international character.
      
       See [Google Cloud
       Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements)
       for more details.
       
      map<string, string> user_labels = 5;
      Specified by:
      containsUserLabels in interface CheckGroundingRequestOrBuilder
    • getUserLabels

      @Deprecated public Map<String,String> getUserLabels()
      Deprecated.
      Use getUserLabelsMap() instead.
      Specified by:
      getUserLabels in interface CheckGroundingRequestOrBuilder
    • getUserLabelsMap

      public Map<String,String> getUserLabelsMap()
       The user labels applied to a resource must meet the following requirements:
      
       * Each resource can have multiple labels, up to a maximum of 64.
       * Each label must be a key-value pair.
       * Keys have a minimum length of 1 character and a maximum length of 63
       characters and cannot be empty. Values can be empty and have a maximum
       length of 63 characters.
       * Keys and values can contain only lowercase letters, numeric characters,
       underscores, and dashes. All characters must use UTF-8 encoding, and
       international characters are allowed.
       * The key portion of a label must be unique. However, you can use the same
       key with multiple resources.
       * Keys must start with a lowercase letter or international character.
      
       See [Google Cloud
       Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements)
       for more details.
       
      map<string, string> user_labels = 5;
      Specified by:
      getUserLabelsMap in interface CheckGroundingRequestOrBuilder
    • getUserLabelsOrDefault

      public String getUserLabelsOrDefault(String key, String defaultValue)
       The user labels applied to a resource must meet the following requirements:
      
       * Each resource can have multiple labels, up to a maximum of 64.
       * Each label must be a key-value pair.
       * Keys have a minimum length of 1 character and a maximum length of 63
       characters and cannot be empty. Values can be empty and have a maximum
       length of 63 characters.
       * Keys and values can contain only lowercase letters, numeric characters,
       underscores, and dashes. All characters must use UTF-8 encoding, and
       international characters are allowed.
       * The key portion of a label must be unique. However, you can use the same
       key with multiple resources.
       * Keys must start with a lowercase letter or international character.
      
       See [Google Cloud
       Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements)
       for more details.
       
      map<string, string> user_labels = 5;
      Specified by:
      getUserLabelsOrDefault in interface CheckGroundingRequestOrBuilder
    • getUserLabelsOrThrow

      public String getUserLabelsOrThrow(String key)
       The user labels applied to a resource must meet the following requirements:
      
       * Each resource can have multiple labels, up to a maximum of 64.
       * Each label must be a key-value pair.
       * Keys have a minimum length of 1 character and a maximum length of 63
       characters and cannot be empty. Values can be empty and have a maximum
       length of 63 characters.
       * Keys and values can contain only lowercase letters, numeric characters,
       underscores, and dashes. All characters must use UTF-8 encoding, and
       international characters are allowed.
       * The key portion of a label must be unique. However, you can use the same
       key with multiple resources.
       * Keys must start with a lowercase letter or international character.
      
       See [Google Cloud
       Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements)
       for more details.
       
      map<string, string> user_labels = 5;
      Specified by:
      getUserLabelsOrThrow in interface CheckGroundingRequestOrBuilder
    • clearUserLabels

      public CheckGroundingRequest.Builder clearUserLabels()
    • removeUserLabels

      public CheckGroundingRequest.Builder removeUserLabels(String key)
       The user labels applied to a resource must meet the following requirements:
      
       * Each resource can have multiple labels, up to a maximum of 64.
       * Each label must be a key-value pair.
       * Keys have a minimum length of 1 character and a maximum length of 63
       characters and cannot be empty. Values can be empty and have a maximum
       length of 63 characters.
       * Keys and values can contain only lowercase letters, numeric characters,
       underscores, and dashes. All characters must use UTF-8 encoding, and
       international characters are allowed.
       * The key portion of a label must be unique. However, you can use the same
       key with multiple resources.
       * Keys must start with a lowercase letter or international character.
      
       See [Google Cloud
       Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements)
       for more details.
       
      map<string, string> user_labels = 5;
    • getMutableUserLabels

      @Deprecated public Map<String,String> getMutableUserLabels()
      Deprecated.
      Use alternate mutation accessors instead.
    • putUserLabels

      public CheckGroundingRequest.Builder putUserLabels(String key, String value)
       The user labels applied to a resource must meet the following requirements:
      
       * Each resource can have multiple labels, up to a maximum of 64.
       * Each label must be a key-value pair.
       * Keys have a minimum length of 1 character and a maximum length of 63
       characters and cannot be empty. Values can be empty and have a maximum
       length of 63 characters.
       * Keys and values can contain only lowercase letters, numeric characters,
       underscores, and dashes. All characters must use UTF-8 encoding, and
       international characters are allowed.
       * The key portion of a label must be unique. However, you can use the same
       key with multiple resources.
       * Keys must start with a lowercase letter or international character.
      
       See [Google Cloud
       Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements)
       for more details.
       
      map<string, string> user_labels = 5;
    • putAllUserLabels

      public CheckGroundingRequest.Builder putAllUserLabels(Map<String,String> values)
       The user labels applied to a resource must meet the following requirements:
      
       * Each resource can have multiple labels, up to a maximum of 64.
       * Each label must be a key-value pair.
       * Keys have a minimum length of 1 character and a maximum length of 63
       characters and cannot be empty. Values can be empty and have a maximum
       length of 63 characters.
       * Keys and values can contain only lowercase letters, numeric characters,
       underscores, and dashes. All characters must use UTF-8 encoding, and
       international characters are allowed.
       * The key portion of a label must be unique. However, you can use the same
       key with multiple resources.
       * Keys must start with a lowercase letter or international character.
      
       See [Google Cloud
       Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements)
       for more details.
       
      map<string, string> user_labels = 5;