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 Details

    • Builder

      public Builder()
      Sets default values for the Request.
  • Method Details

    • chatMotor

      public MotorRequest.Builder chatMotor​(ChatMotor chatMotor)
      Sets the ChatMotor instance to be used for the request.
      Parameters:
      chatMotor - the ChatMotor instance
      Returns:
      this Builder instance for chaining
    • motorAiOptions

      public MotorRequest.Builder motorAiOptions​(MotorAiOptions aiOptions)
      Sets the MotorAiOptions instance to be used for the request.
      Parameters:
      aiOptions - the MotorAiOptions instance
      Returns:
      this Builder instance for chaining
    • aiModel

      public MotorRequest.Builder aiModel​(String 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

      public MotorRequest.Builder messages​(List<MotorMessage> messages)
      Sets the list of MotorMessages to be used for the request.
      Parameters:
      messages - the list of MotorMessages
      Returns:
      this
    • build

      public MotorRequest build()
      Builds and returns a MotorRequest 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.