Package com.chatmotorapi.api
Class MotorLargeRequestLines.Builder
java.lang.Object
com.chatmotorapi.api.MotorLargeRequestLines.Builder
- Enclosing class:
- MotorLargeRequestLines
public static class MotorLargeRequestLines.Builder extends Object
Builder class for creating a MotorLargeRequestLines instance.
-
Constructor Summary
Constructors Constructor Description Builder()
Sets default values for the Request. -
Method Summary
Modifier and Type Method Description MotorLargeRequestLines.Builder
aiModel(String aiModel)
Sets the OpenAI model to use for the requestMotorLargeRequestLines
build()
Builds and returns aMotorLargeRequestLines
instance based on the set parameters.MotorLargeRequestLines.Builder
chatMotor(ChatMotor chatMotor)
Sets the ChatMotor instance to be used for the request.MotorLargeRequestLines.Builder
filePath(String filePath)
Sets the file path for the text file to be processed.MotorLargeRequestLines.Builder
inputChunkSize(ChunkSize inputChunkSize)
Sets the input chunk size.MotorLargeRequestLines.Builder
motorAiOptions(MotorAiOptions aiOptions)
Sets the MotorAiOptions instance to be used for the request.MotorLargeRequestLines.Builder
progressListener(ProgressListener progressListener)
Sets the ProgressListener instance to be used for the request.MotorLargeRequestLines.Builder
systemMessage(MotorSystemMessage systemMessage)
Sets the system prompt 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
-
systemMessage
Sets the system prompt to be used for the request.- Parameters:
systemMessage
- system prompt to be used for the request.- 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, csv, 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
-
inputChunkSize
Sets the input chunk size.Note: This method is generally not recommended for use. The default chunk size defined in
ChatMotor.maxChunkInputSize()
is used.- Parameters:
inputChunkSize
- the input chunk size- Returns:
- this builder instance for chaining
-
progressListener
Sets the ProgressListener instance to be used for the request.- Parameters:
progressListener
- the ProgressListener instance- Returns:
- this Builder instance for chaining
-
build
Builds and returns aMotorLargeRequestLines
instance based on the set parameters.- Returns:
- a new
MotorLargeRequestLines
- 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 is not in text format.
-