Package com.chatmotorapi.api
Class MotorRequest.Builder
java.lang.Object
com.chatmotorapi.api.MotorRequest.Builder
- Enclosing class:
- MotorRequest
public static class MotorRequest.Builder extends Object
Builder class for creating a MotorRequest instance.
-
Constructor Summary
Constructors Constructor Description Builder()
Sets default values for the Request. -
Method Summary
Modifier and Type Method Description MotorRequest.Builder
aiModel(String aiModel)
Sets the OpenAI model to use for the requestMotorRequest
build()
Builds and returns aMotorRequest
instance based on the set parameters.MotorRequest.Builder
chatMotor(ChatMotor chatMotor)
Sets the ChatMotor instance to be used for the request.MotorRequest.Builder
messages(List<MotorMessage> messages)
Sets the list of MotorMessages to be used for the request.MotorRequest.Builder
motorAiOptions(MotorAiOptions aiOptions)
Sets the MotorAiOptions instance to be used for the request.
-
Constructor Details
-
Builder
public Builder()Sets default values for the Request.
-
-
Method Details
-
chatMotor
Sets the ChatMotor instance to be used for the request.- Parameters:
chatMotor
- the ChatMotor instance- Returns:
- this Builder instance for chaining
-
motorAiOptions
Sets the MotorAiOptions instance to be used for the request.- Parameters:
aiOptions
- the MotorAiOptions instance- Returns:
- this Builder instance for chaining
-
aiModel
Sets the OpenAI model to use for the request- Parameters:
aiModel
- the model identifier, e.g., "gpt-4-turbo-preview"- Returns:
- this Builder instance for chaining
-
messages
Sets the list of MotorMessages to be used for the request.- Parameters:
messages
- the list of MotorMessages- Returns:
- this
-
build
Builds and returns aMotorRequest
instance based on the set parameters.- Returns:
- a new
MotorRequest
- Throws:
IllegalArgumentException
- if the chatMotor is not provided.IllegalArgumentException
- if the messages are not provided.
-