Class MotorExtractContentRequest.Builder
java.lang.Object
com.chatmotorapi.api.experimental.MotorExtractContentRequest.Builder
- Enclosing class:
- MotorExtractContentRequest
public static class MotorExtractContentRequest.Builder extends Object
Builder class for
MotorSummaryRequest.-
Constructor Summary
Constructors Constructor Description Builder()Sets default values for the Request. -
Method Summary
Modifier and Type Method Description MotorExtractContentRequest.BuilderaiModel(String aiModel)Sets the OpenAI model to use for the requestMotorExtractContentRequestbuild()Builds and returns aMotorExtractContentRequestinstance based on the set parameters.MotorExtractContentRequest.BuilderchatMotor(ChatMotor chatMotor)Sets theChatMotorinstance for this request.MotorExtractContentRequest.BuilderfilePath(String filePath)Sets the file path for the text file to be processed.MotorExtractContentRequest.BuilderlanguageCode(String languageCode)Sets the language code for the content extraction.MotorExtractContentRequest.BuildermotorAiOptions(MotorAiOptions aiOptions)Sets the MotorAiOptions instance to be used for the request.MotorExtractContentRequest.Buildertopics(List<String> topics)Sets the list of topics or keywords indicating what to extract.
-
Constructor Details
-
Builder
public Builder()Sets default values for the Request.
-
-
Method Details
-
chatMotor
Sets theChatMotorinstance for this request.- Parameters:
chatMotor- theChatMotorinstance- 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, csv, and their uppercase equivalents). For other file formats, use theFileToTextConverterutility to convert them to text files.- Parameters:
filePath- the path to the text file- Returns:
- the builder instance for chaining
-
languageCode
Sets the language code for the content extraction.- Parameters:
languageCode- language code for the content extraction .- Returns:
- this builder instance for chaining
-
topics
Sets the list of topics or keywords indicating what to extract.- Parameters:
topics- the list of topics or keywords indicating what to extract.- Returns:
- this builder instance for chaining
-
build
Builds and returns aMotorExtractContentRequestinstance based on the set parameters.- Returns:
- a new
MotorExtractContentRequest - 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 no topics are provided.IllegalArgumentException- if the file is not in text format.
-