Class MotorAiOptions

java.lang.Object
com.chatmotorapi.api.MotorAiOptions

public class MotorAiOptions
extends Object
Encapsulates configuration settings for AI interactions within the ChatMotor system. This class utilizes the Builder pattern to allow flexible configuration of AI parameters, such as temperature, max tokens, top_p, and others, which influence the response generation from the AI.

Each option is designed to provide precise control over the AI's behavior, making it possible to customize the dynamics of the response according to specific use-case requirements. For instance, 'temperature' adjusts the randomness of the responses, while 'maxTokens' sets the upper limit on the response length. Default values for each configuration setting are documented within the Javadoc.

Usage example:

 MotorAiOptions options = MotorAiOptions.builder()
     .temperature(0.7)    // Controls the randomness of the AI responses
     .maxTokens(150)      // Limits the number of tokens in the response
     .topP(0.9)           // Controls the diversity of the response predictions
     .build();
 
  • Field Details

    • DEFAULT_N

      public static final int DEFAULT_N
      The default value for the number of completions to generate for each prompt.
      See Also:
      Constant Field Values
    • DEFAULT_TOP_P

      public static final double DEFAULT_TOP_P
      The default diversity of response predictions (top_p).
      See Also:
      Constant Field Values
    • DEFAULT_MAX_TOKENS

      public static final int DEFAULT_MAX_TOKENS
      The default maximum number of tokens that the AI can produce in a response.
      See Also:
      Constant Field Values
    • DEFAULT_TEMPERATURE

      public static final double DEFAULT_TEMPERATURE
      The default randomness in the AI responses.
      See Also:
      Constant Field Values
    • DEFAULT_STOP

      public static final Object DEFAULT_STOP
      The default stop sequences for the AI to stop generating further tokens.
    • DEFAULT_PRESENCE_PENALTY

      public static final double DEFAULT_PRESENCE_PENALTY
      The default penalty discouraging the AI from repeating topics.
      See Also:
      Constant Field Values
    • DEFAULT_FREQUENCY_PENALTY

      public static final double DEFAULT_FREQUENCY_PENALTY
      The default penalty discouraging the AI from repeating the same line.
      See Also:
      Constant Field Values
    • DEFAULT_LOGIT_BIAS

      public static final Map<String,​Integer> DEFAULT_LOGIT_BIAS
      The default map of token IDs to their bias values, affecting AI response generation.
    • DEFAULT_ADDITIONAL_OPTIONS

      public static final Map<String,​Object> DEFAULT_ADDITIONAL_OPTIONS
      The default map containing additional, unspecified options for AI configuration.
    • DEFAULT_USER

      public static final String DEFAULT_USER
      The default identifier for the user or usage context.
    • DEFAULT_LOGPROBS

      public static final Boolean DEFAULT_LOGPROBS
      The default setting to determine whether to enable log probabilities in the AI response.
    • DEFAULT_TOP_LOGPROBS

      public static final Integer DEFAULT_TOP_LOGPROBS
      The default number of top log probabilities to include in the response.
  • Method Details

    • builder

      public static MotorAiOptions.Builder builder()
      Returns a new Builder for creating a MotorAiOptions instance.
      Returns:
      a new Builder instance
    • getTemperature

      public Double getTemperature()
      Returns:
      the temperature
    • getMaxTokens

      public Integer getMaxTokens()
      Returns:
      the maxTokens
    • getTopP

      public Double getTopP()
      Returns:
      the topP
    • getN

      public Integer getN()
      Returns:
      the n
    • getStop

      public Object getStop()
      Returns:
      the stop
    • getPresencePenalty

      public Double getPresencePenalty()
      Returns:
      the presencePenalty
    • getFrequencyPenalty

      public Double getFrequencyPenalty()
      Returns:
      the frequencyPenalty
    • getLogitBias

      public Map<String,​Integer> getLogitBias()
      Returns:
      the logitBias
    • getUser

      public String getUser()
      Returns:
      the user
    • getLogprobs

      public Boolean getLogprobs()
      Returns:
      the logprobs
    • getTopLogprobs

      public Integer getTopLogprobs()
      Returns:
      the topLogprobs
    • getAdditionalOptions

      public Map<String,​Object> getAdditionalOptions()
      Returns:
      the additionalOptions
    • toString

      public String toString()
      Provides a string representation of this object. The output includes the class name along with key attribute values.
      Overrides:
      toString in class Object
      Returns:
      a string description of this object.