Package com.chatmotorapi.api.models
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 Summary
Constructors Constructor Description MotorModelResponse()
-
Method Summary
Modifier and Type Method Description MotorModel
getFirstModel()
Retrieves the first MotorModel object if the query was successful.List<MotorModel>
getModels()
Retrieves the list of MotorModel objects if the query was successful.Throwable
getThrowable()
/** Gets the throwable associated with the response.boolean
isResponseOk()
Checks whether the response from the OpenAI query was successful.
-
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
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
Retrieves the first MotorModel object if the query was successful.- Returns:
- The first
MotorModel
object, or null if the response was not successful.
-
getThrowable
/** Gets the throwable associated with the response.- Returns:
- the throwable, or a MotorNoExceptionThrown instance if there is no throwable.
-