Package com.chatmotorapi.api.functional
Class MotorSentimentResponse
java.lang.Object
com.chatmotorapi.api.functional.MotorSentimentResponse
- All Implemented Interfaces:
- MotorResponseType
public class MotorSentimentResponse extends Object implements MotorResponseType
Represents the response for a sentiment analysis request processed by the ChatMotor API.
 This class provides information about the request's success, any errors encountered,
 the sentiment analysis result, and usage details.
 
 
Implements MotorResponseType and includes methods to access the 
 sentiment result (MotorSentiment), request usage data (MotorCompletionUsage),
 and errors (OpenAiError).
 
 
Useful for checking if a request was successful, obtaining sentiment analysis details, and understanding any errors or exceptions that occurred.
In this version, for simplicity, responses are available in English only.- See Also:
- MotorSentiment,- MotorResponseType,- OpenAiError
- 
Constructor SummaryConstructors Constructor Description MotorSentimentResponse()
- 
Method SummaryModifier and Type Method Description MotorCompletionUsagegetMotorCompletionUsage()Gets the completion usage associated with the response.MotorSentimentgetMotorSentiment()Gets the sentiment analysis result 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.StringtoString()Provides a string representation of this object.
- 
Constructor Details- 
MotorSentimentResponsepublic MotorSentimentResponse()
 
- 
- 
Method Details- 
isResponseOkpublic boolean isResponseOk()says whether the response was successful or not.- Returns:
- true if the response was successful, false otherwise.
 
- 
getThrowableGets the throwable associated with the response.- Returns:
- the throwable, or a MotorNoExceptionThrown instance if there is no throwable.
 
- 
getOpenAiErrorGets the OpenAI error associated with the response.- Returns:
- the OpenAiError
 
- 
getMotorCompletionUsageGets the completion usage associated with the response.- Returns:
- the completion usage associated with the response.
 
- 
getMotorSentimentGets the sentiment analysis result associated with the response.- Returns:
- the sentiment analysis result associated with the response.
 
- 
toStringProvides a string representation of this object. The output includes the class name along with key attribute values.
 
-