Class LanguageModelInput.Builder

java.lang.Object
com.intellijava.core.model.input.LanguageModelInput.Builder
Enclosing class:
LanguageModelInput

public static class LanguageModelInput.Builder extends Object
Builder class for LanguageModelInput.
  • Constructor Details

    • Builder

      public Builder(String prompt)
      Language input Constructor.
      Parameters:
      prompt - text of the required action or the question.
  • Method Details

    • setModel

      public LanguageModelInput.Builder setModel(String model)
      Sets the model.
      Parameters:
      model - the model name. The largest OpenAI model is text-davinci-003. The largest cohere model is xlarge.
      Returns:
      instance of Builder
    • setPrompt

      public LanguageModelInput.Builder setPrompt(String prompt)
      Sets the prompt.
      Parameters:
      prompt - text of the required action or the question.
      Returns:
      instance of Builder.
    • setTemperature

      public LanguageModelInput.Builder setTemperature(float temperature)
      Sets the temperature.
      Parameters:
      temperature - higher values means more risks and creativity.
      Returns:
      instance of Builder.
    • setMaxTokens

      public LanguageModelInput.Builder setMaxTokens(int maxTokens)
      Sets the maxTokens.
      Parameters:
      maxTokens - maximum size of the model input and output.
      Returns:
      instance of Builder
    • setNumberOfOutputs

      public LanguageModelInput.Builder setNumberOfOutputs(int numberOfOutputs)
      Sets the numberOfOutputs
      Parameters:
      numberOfOutputs - number of model outputs, default value is 1. Cohere maximum value is five.
      Returns:
      instance of Builder
    • build

      public LanguageModelInput build()
      Build the final LanguageModelInput object.
      Returns:
      final LanguageModelInput object