Class GeneratedText.Builder

    • Constructor Detail

      • Builder

        public Builder()
    • Method Detail

      • id

        public GeneratedText.Builder id​(String id)
        A unique identifier for this text generation.
        Parameters:
        id - the value to set
        Returns:
        this builder
      • text

        public GeneratedText.Builder text​(String text)
        The generated text.
        Parameters:
        text - the value to set
        Returns:
        this builder
      • likelihood

        public GeneratedText.Builder likelihood​(Double likelihood)
        The overall likelihood of the generated text.

        When a large language model generates a new token for the output text, a likelihood is assigned to all tokens, where tokens with higher likelihoods are more likely to follow the current token. For example, it's more likely that the word favorite is followed by the word food or book rather than the word zebra. A lower likelihood means that it's less likely that token follows the current token.

        Parameters:
        likelihood - the value to set
        Returns:
        this builder
      • finishReason

        public GeneratedText.Builder finishReason​(String finishReason)
        The reason why the model stopped generating tokens.

        A model stops generating tokens if the model hits a natural stop point or reaches a provided stop sequence.

        Parameters:
        finishReason - the value to set
        Returns:
        this builder
      • tokenLikelihoods

        public GeneratedText.Builder tokenLikelihoods​(List<TokenLikelihood> tokenLikelihoods)
        A collection of generated tokens and their corresponding likelihoods.
        Parameters:
        tokenLikelihoods - the value to set
        Returns:
        this builder