Class MotorModelsRequest

java.lang.Object
com.chatmotorapi.api.models.MotorModelsRequest

public class MotorModelsRequest
extends Object
Represents the models associated with the Chat Motor AI. This class utilizes the Builder pattern to provide a flexible and clear method of constructing instances.
  • Method Details

    • chatMotor

      public ChatMotor chatMotor()
      Retrieves the chat motor configuration.
      Returns:
      the configuration of the chat
    • builder

      public static MotorModelsRequest.Builder builder()
      Static method to obtain a new Builder instance.
      Returns:
      a new instance of Builder for creating a MotorAiModels object
    • getModels

      public MotorModelResponse getModels()
      Executes a query to retrieve models using a blocking call. This method initializes the MotorModelExecutor with the necessary parameters and performs the query synchronously.
      Returns:
      A MotorModelResponse containing either the list of models retrieved or an error if the execution fails. The response indicates success or failure through its responseOk property.
    • getModel

      public MotorModelResponse getModel​(String modelId)
      Executes a query to retrieve an unique model using a blocking call. This method initializes the MotorModelExecutor with the necessary parameters and performs the query synchronously.
      Parameters:
      modelId - the id of the model to retrieve
      Returns:
      A MotorModelResponse containing either the model retrieved or an error if the execution fails. The response indicates success or failure through its responseOk property.
    • deleteModel

      public MotorModelResponse deleteModel​(String modelId)
      Deletes a specific model identified by the model ID from OpenAI's services. This method creates an instance of MotorModelExecutor to perform the deletion and returns the response encapsulated in a MotorModelResponse object.
      Parameters:
      modelId - The unique identifier of the model to be deleted.
      Returns:
      MotorModelResponse containing details about the execution of the delete operation, including success or failure status and any relevant messages.