Class Candidate.Builder

java.lang.Object
com.google.genai.types.Candidate.Builder
Enclosing class:
Candidate

public abstract static class Candidate.Builder extends Object
Builder for Candidate.
  • Constructor Details

    • Builder

      public Builder()
  • Method Details

    • content

      public abstract Candidate.Builder content(Content content)
      Setter for content.

      content: Contains the multi-part content of the response.

    • content

      public Candidate.Builder content(Content.Builder contentBuilder)
      Setter for content builder.

      content: Contains the multi-part content of the response.

    • citationMetadata

      public abstract Candidate.Builder citationMetadata(CitationMetadata citationMetadata)
      Setter for citationMetadata.

      citationMetadata: Source attribution of the generated content.

    • citationMetadata

      public Candidate.Builder citationMetadata(CitationMetadata.Builder citationMetadataBuilder)
      Setter for citationMetadata builder.

      citationMetadata: Source attribution of the generated content.

    • finishMessage

      public abstract Candidate.Builder finishMessage(String finishMessage)
      Setter for finishMessage.

      finishMessage: Describes the reason the model stopped generating tokens.

    • tokenCount

      public abstract Candidate.Builder tokenCount(Integer tokenCount)
      Setter for tokenCount.

      tokenCount: Number of tokens for this candidate.

    • finishReason

      public abstract Candidate.Builder finishReason(FinishReason finishReason)
      Setter for finishReason.

      finishReason: The reason why the model stopped generating tokens. If empty, the model has not stopped generating the tokens.

    • finishReason

      @CanIgnoreReturnValue public Candidate.Builder finishReason(FinishReason.Known knownType)
      Setter for finishReason given a known enum.

      finishReason: The reason why the model stopped generating tokens. If empty, the model has not stopped generating the tokens.

    • finishReason

      @CanIgnoreReturnValue public Candidate.Builder finishReason(String finishReason)
      Setter for finishReason given a string.

      finishReason: The reason why the model stopped generating tokens. If empty, the model has not stopped generating the tokens.

    • urlContextMetadata

      public abstract Candidate.Builder urlContextMetadata(UrlContextMetadata urlContextMetadata)
      Setter for urlContextMetadata.

      urlContextMetadata: Metadata related to url context retrieval tool.

    • urlContextMetadata

      public Candidate.Builder urlContextMetadata(UrlContextMetadata.Builder urlContextMetadataBuilder)
      Setter for urlContextMetadata builder.

      urlContextMetadata: Metadata related to url context retrieval tool.

    • avgLogprobs

      public abstract Candidate.Builder avgLogprobs(Double avgLogprobs)
      Setter for avgLogprobs.

      avgLogprobs: Output only. Average log probability score of the candidate.

    • groundingMetadata

      public abstract Candidate.Builder groundingMetadata(GroundingMetadata groundingMetadata)
      Setter for groundingMetadata.

      groundingMetadata: Output only. Metadata specifies sources used to ground generated content.

    • groundingMetadata

      public Candidate.Builder groundingMetadata(GroundingMetadata.Builder groundingMetadataBuilder)
      Setter for groundingMetadata builder.

      groundingMetadata: Output only. Metadata specifies sources used to ground generated content.

    • index

      public abstract Candidate.Builder index(Integer index)
      Setter for index.

      index: Output only. Index of the candidate.

    • logprobsResult

      public abstract Candidate.Builder logprobsResult(LogprobsResult logprobsResult)
      Setter for logprobsResult.

      logprobsResult: Output only. Log-likelihood scores for the response tokens and top tokens

    • logprobsResult

      public Candidate.Builder logprobsResult(LogprobsResult.Builder logprobsResultBuilder)
      Setter for logprobsResult builder.

      logprobsResult: Output only. Log-likelihood scores for the response tokens and top tokens

    • safetyRatings

      public abstract Candidate.Builder safetyRatings(List<SafetyRating> safetyRatings)
      Setter for safetyRatings.

      safetyRatings: Output only. List of ratings for the safety of a response candidate. There is at most one rating per category.

    • safetyRatings

      public Candidate.Builder safetyRatings(SafetyRating... safetyRatings)
      Setter for safetyRatings.

      safetyRatings: Output only. List of ratings for the safety of a response candidate. There is at most one rating per category.

    • safetyRatings

      public Candidate.Builder safetyRatings(SafetyRating.Builder... safetyRatingsBuilders)
      Setter for safetyRatings builder.

      safetyRatings: Output only. List of ratings for the safety of a response candidate. There is at most one rating per category.

    • build

      public abstract Candidate build()