Package com.chatmotorapi.api.functional
Class MotorSentimentRequest.Builder
java.lang.Object
com.chatmotorapi.api.functional.MotorSentimentRequest.Builder
- Enclosing class:
- MotorSentimentRequest
public static class MotorSentimentRequest.Builder extends Object
Builder class for
MotorSentimentRequest
.-
Constructor Summary
Constructors Constructor Description Builder()
Sets default values for the Request. -
Method Summary
Modifier and Type Method Description MotorSentimentRequest.Builder
aiModel(String aiModel)
Sets the OpenAI model to use for the requestMotorSentimentRequest
build()
Builds and returns aMotorSentimentRequest
instance based on the set parameters.MotorSentimentRequest.Builder
chatMotor(ChatMotor chatMotor)
Sets theChatMotor
instance for this request.MotorSentimentRequest.Builder
filePath(String filePath)
Sets the file path for the text file to be processed.MotorSentimentRequest.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 theChatMotor
instance for this request.- Parameters:
chatMotor
- theChatMotor
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
-
filePath
Sets the file path for the text file to be processed. Note: This method only accepts text files (txt, text, and their uppercase equivalents). For other file formats, use theFileToTextConverter
utility to convert them to text files.- Parameters:
filePath
- the path to the text file- Returns:
- the builder instance for chaining
-
build
Builds and returns aMotorSentimentRequest
instance based on the set parameters.- Returns:
- a new
MotorSentimentRequest
- Throws:
IllegalArgumentException
- if the chatMotor is not provided.IllegalArgumentException
- if the filePath is not provided.IllegalArgumentException
- if the file specified by filePath does not exist.IllegalArgumentException
- if the file format is not supported.
-