Interface SampledSequence.Builder

  • Method Details

    • stopReason

      SampledSequence.Builder stopReason(String stopReason)

      The reason why generation stopped. A value of stop indicates a stop sequence was encountered. A value of length indicates the maximum token limit was reached.

      Parameters:
      stopReason - The reason why generation stopped. A value of stop indicates a stop sequence was encountered. A value of length indicates the maximum token limit was reached.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
      See Also:
    • stopReason

      SampledSequence.Builder stopReason(StopReason stopReason)

      The reason why generation stopped. A value of stop indicates a stop sequence was encountered. A value of length indicates the maximum token limit was reached.

      Parameters:
      stopReason - The reason why generation stopped. A value of stop indicates a stop sequence was encountered. A value of length indicates the maximum token limit was reached.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
      See Also:
    • tokens

      The token IDs of the generated sequence.

      Parameters:
      tokens - The token IDs of the generated sequence.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • tokens

      SampledSequence.Builder tokens(Integer... tokens)

      The token IDs of the generated sequence.

      Parameters:
      tokens - The token IDs of the generated sequence.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • logprobs

      The per-token log-probabilities for the generated tokens.

      Parameters:
      logprobs - The per-token log-probabilities for the generated tokens.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • logprobs

      SampledSequence.Builder logprobs(Double... logprobs)

      The per-token log-probabilities for the generated tokens.

      Parameters:
      logprobs - The per-token log-probabilities for the generated tokens.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • tokenUsage

      SampledSequence.Builder tokenUsage(SampleTokenUsage tokenUsage)

      The token usage statistics for this individual sample.

      Parameters:
      tokenUsage - The token usage statistics for this individual sample.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • tokenUsage

      default SampledSequence.Builder tokenUsage(Consumer<SampleTokenUsage.Builder> tokenUsage)

      The token usage statistics for this individual sample.

      This is a convenience method that creates an instance of the SampleTokenUsage.Builder avoiding the need to create one manually via SampleTokenUsage.builder().

      When the Consumer completes, SdkBuilder.build() is called immediately and its result is passed to tokenUsage(SampleTokenUsage).

      Parameters:
      tokenUsage - a consumer that will call methods on SampleTokenUsage.Builder
      Returns:
      Returns a reference to this object so that method calls can be chained together.
      See Also: