Class GenerateContentResponse.Builder

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

public static final class GenerateContentResponse.Builder extends com.google.protobuf.GeneratedMessage.Builder<GenerateContentResponse.Builder> implements GenerateContentResponseOrBuilder
 Response message for [PredictionService.GenerateContent].
 
Protobuf type google.cloud.aiplatform.v1.GenerateContentResponse
  • 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<GenerateContentResponse.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<GenerateContentResponse.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<GenerateContentResponse.Builder>
    • getDefaultInstanceForType

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

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

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

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

      public GenerateContentResponse.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<GenerateContentResponse.Builder>
      Throws:
      IOException
    • getCandidatesList

      public List<Candidate> getCandidatesList()
       Output only. Generated candidates.
       
      repeated .google.cloud.aiplatform.v1.Candidate candidates = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];
      Specified by:
      getCandidatesList in interface GenerateContentResponseOrBuilder
    • getCandidatesCount

      public int getCandidatesCount()
       Output only. Generated candidates.
       
      repeated .google.cloud.aiplatform.v1.Candidate candidates = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];
      Specified by:
      getCandidatesCount in interface GenerateContentResponseOrBuilder
    • getCandidates

      public Candidate getCandidates(int index)
       Output only. Generated candidates.
       
      repeated .google.cloud.aiplatform.v1.Candidate candidates = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];
      Specified by:
      getCandidates in interface GenerateContentResponseOrBuilder
    • setCandidates

      public GenerateContentResponse.Builder setCandidates(int index, Candidate value)
       Output only. Generated candidates.
       
      repeated .google.cloud.aiplatform.v1.Candidate candidates = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];
    • setCandidates

      public GenerateContentResponse.Builder setCandidates(int index, Candidate.Builder builderForValue)
       Output only. Generated candidates.
       
      repeated .google.cloud.aiplatform.v1.Candidate candidates = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];
    • addCandidates

      public GenerateContentResponse.Builder addCandidates(Candidate value)
       Output only. Generated candidates.
       
      repeated .google.cloud.aiplatform.v1.Candidate candidates = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];
    • addCandidates

      public GenerateContentResponse.Builder addCandidates(int index, Candidate value)
       Output only. Generated candidates.
       
      repeated .google.cloud.aiplatform.v1.Candidate candidates = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];
    • addCandidates

      public GenerateContentResponse.Builder addCandidates(Candidate.Builder builderForValue)
       Output only. Generated candidates.
       
      repeated .google.cloud.aiplatform.v1.Candidate candidates = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];
    • addCandidates

      public GenerateContentResponse.Builder addCandidates(int index, Candidate.Builder builderForValue)
       Output only. Generated candidates.
       
      repeated .google.cloud.aiplatform.v1.Candidate candidates = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];
    • addAllCandidates

      public GenerateContentResponse.Builder addAllCandidates(Iterable<? extends Candidate> values)
       Output only. Generated candidates.
       
      repeated .google.cloud.aiplatform.v1.Candidate candidates = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];
    • clearCandidates

      public GenerateContentResponse.Builder clearCandidates()
       Output only. Generated candidates.
       
      repeated .google.cloud.aiplatform.v1.Candidate candidates = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];
    • removeCandidates

      public GenerateContentResponse.Builder removeCandidates(int index)
       Output only. Generated candidates.
       
      repeated .google.cloud.aiplatform.v1.Candidate candidates = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];
    • getCandidatesBuilder

      public Candidate.Builder getCandidatesBuilder(int index)
       Output only. Generated candidates.
       
      repeated .google.cloud.aiplatform.v1.Candidate candidates = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];
    • getCandidatesOrBuilder

      public CandidateOrBuilder getCandidatesOrBuilder(int index)
       Output only. Generated candidates.
       
      repeated .google.cloud.aiplatform.v1.Candidate candidates = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];
      Specified by:
      getCandidatesOrBuilder in interface GenerateContentResponseOrBuilder
    • getCandidatesOrBuilderList

      public List<? extends CandidateOrBuilder> getCandidatesOrBuilderList()
       Output only. Generated candidates.
       
      repeated .google.cloud.aiplatform.v1.Candidate candidates = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];
      Specified by:
      getCandidatesOrBuilderList in interface GenerateContentResponseOrBuilder
    • addCandidatesBuilder

      public Candidate.Builder addCandidatesBuilder()
       Output only. Generated candidates.
       
      repeated .google.cloud.aiplatform.v1.Candidate candidates = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];
    • addCandidatesBuilder

      public Candidate.Builder addCandidatesBuilder(int index)
       Output only. Generated candidates.
       
      repeated .google.cloud.aiplatform.v1.Candidate candidates = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];
    • getCandidatesBuilderList

      public List<Candidate.Builder> getCandidatesBuilderList()
       Output only. Generated candidates.
       
      repeated .google.cloud.aiplatform.v1.Candidate candidates = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];
    • getModelVersion

      public String getModelVersion()
       Output only. The model version used to generate the response.
       
      string model_version = 11 [(.google.api.field_behavior) = OUTPUT_ONLY];
      Specified by:
      getModelVersion in interface GenerateContentResponseOrBuilder
      Returns:
      The modelVersion.
    • getModelVersionBytes

      public com.google.protobuf.ByteString getModelVersionBytes()
       Output only. The model version used to generate the response.
       
      string model_version = 11 [(.google.api.field_behavior) = OUTPUT_ONLY];
      Specified by:
      getModelVersionBytes in interface GenerateContentResponseOrBuilder
      Returns:
      The bytes for modelVersion.
    • setModelVersion

      public GenerateContentResponse.Builder setModelVersion(String value)
       Output only. The model version used to generate the response.
       
      string model_version = 11 [(.google.api.field_behavior) = OUTPUT_ONLY];
      Parameters:
      value - The modelVersion to set.
      Returns:
      This builder for chaining.
    • clearModelVersion

      public GenerateContentResponse.Builder clearModelVersion()
       Output only. The model version used to generate the response.
       
      string model_version = 11 [(.google.api.field_behavior) = OUTPUT_ONLY];
      Returns:
      This builder for chaining.
    • setModelVersionBytes

      public GenerateContentResponse.Builder setModelVersionBytes(com.google.protobuf.ByteString value)
       Output only. The model version used to generate the response.
       
      string model_version = 11 [(.google.api.field_behavior) = OUTPUT_ONLY];
      Parameters:
      value - The bytes for modelVersion to set.
      Returns:
      This builder for chaining.
    • hasCreateTime

      public boolean hasCreateTime()
       Output only. Timestamp when the request is made to the server.
       
      .google.protobuf.Timestamp create_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY];
      Specified by:
      hasCreateTime in interface GenerateContentResponseOrBuilder
      Returns:
      Whether the createTime field is set.
    • getCreateTime

      public com.google.protobuf.Timestamp getCreateTime()
       Output only. Timestamp when the request is made to the server.
       
      .google.protobuf.Timestamp create_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY];
      Specified by:
      getCreateTime in interface GenerateContentResponseOrBuilder
      Returns:
      The createTime.
    • setCreateTime

      public GenerateContentResponse.Builder setCreateTime(com.google.protobuf.Timestamp value)
       Output only. Timestamp when the request is made to the server.
       
      .google.protobuf.Timestamp create_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY];
    • setCreateTime

      public GenerateContentResponse.Builder setCreateTime(com.google.protobuf.Timestamp.Builder builderForValue)
       Output only. Timestamp when the request is made to the server.
       
      .google.protobuf.Timestamp create_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY];
    • mergeCreateTime

      public GenerateContentResponse.Builder mergeCreateTime(com.google.protobuf.Timestamp value)
       Output only. Timestamp when the request is made to the server.
       
      .google.protobuf.Timestamp create_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY];
    • clearCreateTime

      public GenerateContentResponse.Builder clearCreateTime()
       Output only. Timestamp when the request is made to the server.
       
      .google.protobuf.Timestamp create_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY];
    • getCreateTimeBuilder

      public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder()
       Output only. Timestamp when the request is made to the server.
       
      .google.protobuf.Timestamp create_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY];
    • getCreateTimeOrBuilder

      public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder()
       Output only. Timestamp when the request is made to the server.
       
      .google.protobuf.Timestamp create_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY];
      Specified by:
      getCreateTimeOrBuilder in interface GenerateContentResponseOrBuilder
    • getResponseId

      public String getResponseId()
       Output only. response_id is used to identify each response. It is the
       encoding of the event_id.
       
      string response_id = 13 [(.google.api.field_behavior) = OUTPUT_ONLY];
      Specified by:
      getResponseId in interface GenerateContentResponseOrBuilder
      Returns:
      The responseId.
    • getResponseIdBytes

      public com.google.protobuf.ByteString getResponseIdBytes()
       Output only. response_id is used to identify each response. It is the
       encoding of the event_id.
       
      string response_id = 13 [(.google.api.field_behavior) = OUTPUT_ONLY];
      Specified by:
      getResponseIdBytes in interface GenerateContentResponseOrBuilder
      Returns:
      The bytes for responseId.
    • setResponseId

      public GenerateContentResponse.Builder setResponseId(String value)
       Output only. response_id is used to identify each response. It is the
       encoding of the event_id.
       
      string response_id = 13 [(.google.api.field_behavior) = OUTPUT_ONLY];
      Parameters:
      value - The responseId to set.
      Returns:
      This builder for chaining.
    • clearResponseId

      public GenerateContentResponse.Builder clearResponseId()
       Output only. response_id is used to identify each response. It is the
       encoding of the event_id.
       
      string response_id = 13 [(.google.api.field_behavior) = OUTPUT_ONLY];
      Returns:
      This builder for chaining.
    • setResponseIdBytes

      public GenerateContentResponse.Builder setResponseIdBytes(com.google.protobuf.ByteString value)
       Output only. response_id is used to identify each response. It is the
       encoding of the event_id.
       
      string response_id = 13 [(.google.api.field_behavior) = OUTPUT_ONLY];
      Parameters:
      value - The bytes for responseId to set.
      Returns:
      This builder for chaining.
    • hasPromptFeedback

      public boolean hasPromptFeedback()
       Output only. Content filter results for a prompt sent in the request.
       Note: Sent only in the first stream chunk.
       Only happens when no candidates were generated due to content violations.
       
      .google.cloud.aiplatform.v1.GenerateContentResponse.PromptFeedback prompt_feedback = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];
      Specified by:
      hasPromptFeedback in interface GenerateContentResponseOrBuilder
      Returns:
      Whether the promptFeedback field is set.
    • getPromptFeedback

      public GenerateContentResponse.PromptFeedback getPromptFeedback()
       Output only. Content filter results for a prompt sent in the request.
       Note: Sent only in the first stream chunk.
       Only happens when no candidates were generated due to content violations.
       
      .google.cloud.aiplatform.v1.GenerateContentResponse.PromptFeedback prompt_feedback = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];
      Specified by:
      getPromptFeedback in interface GenerateContentResponseOrBuilder
      Returns:
      The promptFeedback.
    • setPromptFeedback

       Output only. Content filter results for a prompt sent in the request.
       Note: Sent only in the first stream chunk.
       Only happens when no candidates were generated due to content violations.
       
      .google.cloud.aiplatform.v1.GenerateContentResponse.PromptFeedback prompt_feedback = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];
    • setPromptFeedback

       Output only. Content filter results for a prompt sent in the request.
       Note: Sent only in the first stream chunk.
       Only happens when no candidates were generated due to content violations.
       
      .google.cloud.aiplatform.v1.GenerateContentResponse.PromptFeedback prompt_feedback = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];
    • mergePromptFeedback

       Output only. Content filter results for a prompt sent in the request.
       Note: Sent only in the first stream chunk.
       Only happens when no candidates were generated due to content violations.
       
      .google.cloud.aiplatform.v1.GenerateContentResponse.PromptFeedback prompt_feedback = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];
    • clearPromptFeedback

      public GenerateContentResponse.Builder clearPromptFeedback()
       Output only. Content filter results for a prompt sent in the request.
       Note: Sent only in the first stream chunk.
       Only happens when no candidates were generated due to content violations.
       
      .google.cloud.aiplatform.v1.GenerateContentResponse.PromptFeedback prompt_feedback = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];
    • getPromptFeedbackBuilder

      public GenerateContentResponse.PromptFeedback.Builder getPromptFeedbackBuilder()
       Output only. Content filter results for a prompt sent in the request.
       Note: Sent only in the first stream chunk.
       Only happens when no candidates were generated due to content violations.
       
      .google.cloud.aiplatform.v1.GenerateContentResponse.PromptFeedback prompt_feedback = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];
    • getPromptFeedbackOrBuilder

      public GenerateContentResponse.PromptFeedbackOrBuilder getPromptFeedbackOrBuilder()
       Output only. Content filter results for a prompt sent in the request.
       Note: Sent only in the first stream chunk.
       Only happens when no candidates were generated due to content violations.
       
      .google.cloud.aiplatform.v1.GenerateContentResponse.PromptFeedback prompt_feedback = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];
      Specified by:
      getPromptFeedbackOrBuilder in interface GenerateContentResponseOrBuilder
    • hasUsageMetadata

      public boolean hasUsageMetadata()
       Usage metadata about the response(s).
       
      .google.cloud.aiplatform.v1.GenerateContentResponse.UsageMetadata usage_metadata = 4;
      Specified by:
      hasUsageMetadata in interface GenerateContentResponseOrBuilder
      Returns:
      Whether the usageMetadata field is set.
    • getUsageMetadata

      public GenerateContentResponse.UsageMetadata getUsageMetadata()
       Usage metadata about the response(s).
       
      .google.cloud.aiplatform.v1.GenerateContentResponse.UsageMetadata usage_metadata = 4;
      Specified by:
      getUsageMetadata in interface GenerateContentResponseOrBuilder
      Returns:
      The usageMetadata.
    • setUsageMetadata

       Usage metadata about the response(s).
       
      .google.cloud.aiplatform.v1.GenerateContentResponse.UsageMetadata usage_metadata = 4;
    • setUsageMetadata

       Usage metadata about the response(s).
       
      .google.cloud.aiplatform.v1.GenerateContentResponse.UsageMetadata usage_metadata = 4;
    • mergeUsageMetadata

       Usage metadata about the response(s).
       
      .google.cloud.aiplatform.v1.GenerateContentResponse.UsageMetadata usage_metadata = 4;
    • clearUsageMetadata

      public GenerateContentResponse.Builder clearUsageMetadata()
       Usage metadata about the response(s).
       
      .google.cloud.aiplatform.v1.GenerateContentResponse.UsageMetadata usage_metadata = 4;
    • getUsageMetadataBuilder

      public GenerateContentResponse.UsageMetadata.Builder getUsageMetadataBuilder()
       Usage metadata about the response(s).
       
      .google.cloud.aiplatform.v1.GenerateContentResponse.UsageMetadata usage_metadata = 4;
    • getUsageMetadataOrBuilder

      public GenerateContentResponse.UsageMetadataOrBuilder getUsageMetadataOrBuilder()
       Usage metadata about the response(s).
       
      .google.cloud.aiplatform.v1.GenerateContentResponse.UsageMetadata usage_metadata = 4;
      Specified by:
      getUsageMetadataOrBuilder in interface GenerateContentResponseOrBuilder