Package com.chatmotorapi.api.image
Class MotorImageRequest.Builder
java.lang.Object
com.chatmotorapi.api.image.MotorImageRequest.Builder
- Enclosing class:
- MotorImageRequest
public static class MotorImageRequest.Builder extends Object
Builder class for creating a MotorImageRequest instance.
-
Constructor Summary
Constructors Constructor Description Builder()Sets default values for the Request. -
Method Summary
Modifier and Type Method Description MotorImageRequest.BuilderaiModel(String aiModel)Sets the OpenAI model to use for the requestMotorImageRequestbuild()Builds and returns aMotorImageRequestinstance based on the set parameters.MotorImageRequest.BuilderchatMotor(ChatMotor chatMotor)Sets the ChatMotor instance to be used for the request.MotorImageRequest.BuildermotorImageSize(MotorImageSize motorImageSize)Sets the image size for the API request.MotorImageRequest.Buildern(int n)Sets the n of images to generate or the API request.MotorImageRequest.Builderprompt(String prompt)Sets the prompt for the API request.MotorImageRequest.BuilderresponseImageFormat(ResponseImageFormat responseImageFormat)Sets the response image format for the API request.
-
Constructor Details
-
Builder
public Builder()Sets default values for the Request.
-
-
Method Details
-
prompt
Sets the prompt for the API request.- Parameters:
prompt- the timeout value- Returns:
- this Builder instance for chaining
-
chatMotor
Sets the ChatMotor instance to be used for the request.- Parameters:
chatMotor- the ChatMotor 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
-
motorImageSize
Sets the image size for the API request.- Parameters:
motorImageSize- the image size- Returns:
- this Builder instance for chaining
-
responseImageFormat
Sets the response image format for the API request.- Parameters:
responseImageFormat- the response format: ResponseImageFormat.URL or ResponseImageFormat.BASE64- Returns:
- this Builder instance for chaining
-
n
Sets the n of images to generate or the API request.- Parameters:
n- n of images to generate- Returns:
- this Builder instance for chaining
-
build
Builds and returns aMotorImageRequestinstance based on the set parameters.- Returns:
- a new
MotorImageRequest - Throws:
IllegalArgumentException- if the chatMotor is not provided.IllegalArgumentException- if the prompt is not provided.IllegalArgumentException- if n is not between 1 and 10.IllegalArgumentException- if the motorImageSize is not provided.IllegalArgumentException- if the responseImageFormat is not provided.
-