Class PromptExecutionSettings.Builder

  • Enclosing class:
    PromptExecutionSettings

    public static class PromptExecutionSettings.Builder
    extends Object
    Builder for PromptExecutionSettings.
    • Constructor Detail

      • Builder

        public Builder()
    • Method Detail

      • withServiceId

        public PromptExecutionSettings.Builder withServiceId​(String serviceId)
        Set the id of the AI service to use for prompt execution.
        Parameters:
        serviceId - The id of the AI service to use for prompt execution.
        Returns:
        This builder.
      • withModelId

        public PromptExecutionSettings.Builder withModelId​(String modelId)
        Set the id of the model to use for prompt execution.
        Parameters:
        modelId - The id of the model to use for prompt execution.
        Returns:
        This builder.
      • withTemperature

        public PromptExecutionSettings.Builder withTemperature​(double temperature)
        Set the temperature setting for prompt execution. The value is clamped to the range [0.0, 2.0], and the default is 1.0.
        Parameters:
        temperature - The temperature setting for prompt execution.
        Returns:
        This builder.
      • withTopP

        public PromptExecutionSettings.Builder withTopP​(double topP)
        Set the topP setting for prompt execution. The value is clamped to the range [0.0, 1.0], and the default is 1.0.
        Parameters:
        topP - The topP setting for prompt execution.
        Returns:
        This builder.
      • withPresencePenalty

        public PromptExecutionSettings.Builder withPresencePenalty​(double presencePenalty)
        Set the presence penalty setting for prompt execution. The value is clamped to the range [-2.0, 2.0], and the default is 0.0.
        Parameters:
        presencePenalty - The presence penalty setting for prompt execution.
        Returns:
        This builder.
      • withFrequencyPenalty

        public PromptExecutionSettings.Builder withFrequencyPenalty​(double frequencyPenalty)
        Set the frequency penalty setting for prompt execution. The value is clamped to the range [-2.0, 2.0], and the default is 0.0.
        Parameters:
        frequencyPenalty - The frequency penalty setting for prompt execution.
        Returns:
        This builder.
      • withMaxTokens

        public PromptExecutionSettings.Builder withMaxTokens​(int maxTokens)
        Set the maximum number of tokens to generate in the output. The value is clamped to the range [1, Integer.MAX_VALUE], and the default is 256.
        Parameters:
        maxTokens - The maximum number of tokens to generate in the output.
        Returns:
        This builder.
      • withResultsPerPrompt

        public PromptExecutionSettings.Builder withResultsPerPrompt​(int resultsPerPrompt)
        Set the number of results to generate for each prompt. The value is clamped to the range [1, Integer.MAX_VALUE], and the default is 1.
        Parameters:
        resultsPerPrompt - The number of results to generate for each prompt.
        Returns:
        This builder.
      • withBestOf

        public PromptExecutionSettings.Builder withBestOf​(int bestOf)
        Set the best of setting for prompt execution. The value is clamped to the range [1, Integer.MAX_VALUE], and the default is 1.
        Parameters:
        bestOf - The best of setting for prompt execution.
        Returns:
        This builder.
      • withUser

        public PromptExecutionSettings.Builder withUser​(String user)
        Set the user to associate with the prompt execution.
        Parameters:
        user - The user to associate with the prompt execution.
        Returns:
        This builder.
      • withStopSequences

        public PromptExecutionSettings.Builder withStopSequences​(List<String> stopSequences)
        Set the stop sequences to use for prompt execution.
        Parameters:
        stopSequences - The stop sequences to use for prompt execution.
        Returns:
        This builder.
      • withTokenSelectionBiases

        public PromptExecutionSettings.Builder withTokenSelectionBiases​(Map<Integer,​Integer> tokenSelectionBiases)
        Set the token selection biases to use for prompt execution. The bias values are clamped to the range [-100, 100].
        Parameters:
        tokenSelectionBiases - The token selection biases to use for prompt execution.
        Returns:
        This builder.
      • withResponseFormat

        public PromptExecutionSettings.Builder withResponseFormat​(ResponseFormat responseFormat)
        Set the response format to use for prompt execution.
        Parameters:
        responseFormat - The response format to use for prompt execution.
        Returns:
        This builder.
      • build

        public PromptExecutionSettings build()
        Build the PromptExecutionSettings.
        Returns:
        A new PromptExecutionSettings from this builder.