Package com.chatmotorapi.api
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();
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
MotorAiOptions.Builder
Builder class for creating a MotorAiOptions instance. -
Field Summary
Fields Modifier and Type Field Description static Map<String,Object>
DEFAULT_ADDITIONAL_OPTIONS
The default map containing additional, unspecified options for AI configuration.static double
DEFAULT_FREQUENCY_PENALTY
The default penalty discouraging the AI from repeating the same line.static Map<String,Integer>
DEFAULT_LOGIT_BIAS
The default map of token IDs to their bias values, affecting AI response generation.static Boolean
DEFAULT_LOGPROBS
The default setting to determine whether to enable log probabilities in the AI response.static int
DEFAULT_MAX_TOKENS
The default maximum number of tokens that the AI can produce in a response.static int
DEFAULT_N
The default value for the number of completions to generate for each prompt.static double
DEFAULT_PRESENCE_PENALTY
The default penalty discouraging the AI from repeating topics.static Object
DEFAULT_STOP
The default stop sequences for the AI to stop generating further tokens.static double
DEFAULT_TEMPERATURE
The default randomness in the AI responses.static Integer
DEFAULT_TOP_LOGPROBS
The default number of top log probabilities to include in the response.static double
DEFAULT_TOP_P
The default diversity of response predictions (top_p).static String
DEFAULT_USER
The default identifier for the user or usage context. -
Method Summary
Modifier and Type Method Description static MotorAiOptions.Builder
builder()
Returns a new Builder for creating a MotorAiOptions instance.Map<String,Object>
getAdditionalOptions()
Double
getFrequencyPenalty()
Map<String,Integer>
getLogitBias()
Boolean
getLogprobs()
Integer
getMaxTokens()
Integer
getN()
Double
getPresencePenalty()
Object
getStop()
Double
getTemperature()
Integer
getTopLogprobs()
Double
getTopP()
String
getUser()
String
toString()
Provides a string representation of this object.
-
Field Details
-
DEFAULT_N
public static final int DEFAULT_NThe 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_PThe default diversity of response predictions (top_p).- See Also:
- Constant Field Values
-
DEFAULT_MAX_TOKENS
public static final int DEFAULT_MAX_TOKENSThe 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_TEMPERATUREThe default randomness in the AI responses.- See Also:
- Constant Field Values
-
DEFAULT_STOP
The default stop sequences for the AI to stop generating further tokens. -
DEFAULT_PRESENCE_PENALTY
public static final double DEFAULT_PRESENCE_PENALTYThe default penalty discouraging the AI from repeating topics.- See Also:
- Constant Field Values
-
DEFAULT_FREQUENCY_PENALTY
public static final double DEFAULT_FREQUENCY_PENALTYThe default penalty discouraging the AI from repeating the same line.- See Also:
- Constant Field Values
-
DEFAULT_LOGIT_BIAS
The default map of token IDs to their bias values, affecting AI response generation. -
DEFAULT_ADDITIONAL_OPTIONS
The default map containing additional, unspecified options for AI configuration. -
DEFAULT_USER
The default identifier for the user or usage context. -
DEFAULT_LOGPROBS
The default setting to determine whether to enable log probabilities in the AI response. -
DEFAULT_TOP_LOGPROBS
The default number of top log probabilities to include in the response.
-
-
Method Details
-
builder
Returns a new Builder for creating a MotorAiOptions instance.- Returns:
- a new Builder instance
-
getTemperature
- Returns:
- the temperature
-
getMaxTokens
- Returns:
- the maxTokens
-
getTopP
- Returns:
- the topP
-
getN
- Returns:
- the n
-
getStop
- Returns:
- the stop
-
getPresencePenalty
- Returns:
- the presencePenalty
-
getFrequencyPenalty
- Returns:
- the frequencyPenalty
-
getLogitBias
- Returns:
- the logitBias
-
getUser
- Returns:
- the user
-
getLogprobs
- Returns:
- the logprobs
-
getTopLogprobs
- Returns:
- the topLogprobs
-
getAdditionalOptions
- Returns:
- the additionalOptions
-
toString
Provides a string representation of this object. The output includes the class name along with key attribute values.
-