Class AskOutput.Builder

  • Enclosing class:
    AskOutput

    public static final class AskOutput.Builder
    extends Object
    Builder class for constructing instances of AskOutput.
    • Method Detail

      • answer

        @CanIgnoreReturnValue
        public AskOutput.Builder answer​(String answer)
        Sets the generated response text.
        Parameters:
        answer - The generated response text.
        Returns:
        The builder instance for chaining.
      • build

        public AskOutput build()
        Builds and returns the response object. Subsequent modifications to the builder will not affect the constructed object.
        Returns:
        The constructed response.
      • inputTokens

        @CanIgnoreReturnValue
        public AskOutput.Builder inputTokens​(Long inputTokens)
        Sets the tokens that were consumed from the input prompt.
        Parameters:
        inputTokens - The number of input tokens.
        Returns:
        The builder instance for chaining.
      • outputTokens

        @CanIgnoreReturnValue
        public AskOutput.Builder outputTokens​(Long outputTokens)
        Sets the tokens that were generated in the output response.
        Parameters:
        outputTokens - The number of output tokens.
        Returns:
        The builder instance for chaining.
      • totalTokens

        @CanIgnoreReturnValue
        public AskOutput.Builder totalTokens​(Long totalTokens)
        Sets the total number of tokens used in the request.
        Parameters:
        totalTokens - The total number of tokens.
        Returns:
        The builder instance for chaining.