Package com.chatmotorapi.api.functional
Class MotorCategorizationResponse
java.lang.Object
com.chatmotorapi.api.functional.MotorCategorizationResponse
- All Implemented Interfaces:
MotorResponseType
public class MotorCategorizationResponse extends Object implements MotorResponseType
Represents the response for a categorization request processed by the
ChatMotor API. This class provides information about the request's success,
any errors encountered, the categorization result, and usage details.
Implements MotorResponseType and includes methods to access the
categorization result (MotorCategorization), request usage data
(MotorCompletionUsage), and errors (OpenAiError).
Useful for checking if a request was successful, obtaining the categorization details, and understanding any errors or exceptions that occurred.
* In this version, for simplicity, responses are available in English only.- See Also:
MotorCategorization,MotorResponseType,OpenAiError
-
Constructor Summary
Constructors Constructor Description MotorCategorizationResponse() -
Method Summary
Modifier and Type Method Description MotorCategorizationgetMotorCategorization()Gets the motorCategorization associated with the response.MotorCompletionUsagegetMotorCompletionUsage()Gets the completion usage associated with the response.OpenAiErrorgetOpenAiError()Gets the OpenAI error associated with the response.ThrowablegetThrowable()Gets the throwable associated with the response.booleanisResponseOk()says whether the response was successful or not.voidsetMotorCategorization(MotorCategorization motorCategorization)Sets the motorCategorization associated with the response.StringtoString()Provides a string representation of this object.
-
Constructor Details
-
MotorCategorizationResponse
public MotorCategorizationResponse()
-
-
Method Details
-
isResponseOk
public boolean isResponseOk()says whether the response was successful or not.- Returns:
- true if the response was successful, false otherwise.
-
getThrowable
Gets the throwable associated with the response.- Returns:
- the throwable, or a MotorNoExceptionThrown instance if there is no throwable.
-
getOpenAiError
Gets the OpenAI error associated with the response.- Returns:
- the OpenAiError
-
getMotorCompletionUsage
Gets the completion usage associated with the response.- Returns:
- the completionUsage
-
getMotorCategorization
Gets the motorCategorization associated with the response.- Returns:
- the motorCategorization associated with the response.
-
setMotorCategorization
Sets the motorCategorization associated with the response.- Parameters:
motorCategorization- the motorCategorization to set.
-
toString
Provides a string representation of this object. The output includes the class name along with key attribute values.
-