Class MotorModelResponse

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

public class MotorModelResponse
extends Object
Encapsulates the response from a query to OpenAI, providing a mechanism to assess the success of the operation and retrieve the resulting models or handle errors.
  • Constructor Details

    • MotorModelResponse

      public MotorModelResponse()
  • Method Details

    • isResponseOk

      public boolean isResponseOk()
      Checks whether the response from the OpenAI query was successful.
      Returns:
      true if the response was successful, false otherwise.
    • getModels

      public List<MotorModel> getModels()
      Retrieves the list of MotorModel objects if the query was successful. This list contains the models returned by OpenAI.
      Returns:
      A list of MotorModel objects, or an empty list if the response was not successful.
    • getFirstModel

      public MotorModel getFirstModel()
      Retrieves the first MotorModel object if the query was successful.
      Returns:
      The first MotorModel object, or null if the response was not successful.
    • getThrowable

      public Throwable getThrowable()
      /** Gets the throwable associated with the response.
      Returns:
      the throwable, or a MotorNoExceptionThrown instance if there is no throwable.