Package com.chatmotorapi.api
Class MotorStreamStatus
java.lang.Object
com.chatmotorapi.api.MotorStreamStatus
public class MotorStreamStatus extends Object
Represents the status of a streamed request within the ChatMotor API,
providing detailed information about the outcome of the operation. This class
captures critical aspects of the streaming process, including success status,
error details, and usage metrics that may impact the handling and
interpretation of streamed data.
Instances of
MotorStreamStatus are generated as a result of streamed
operations, primarily used to convey the success or failure of such requests.
The status includes: - A boolean indicating overall success or failure.
MotorCompletionUsagedetailing usage metrics during the stream.Throwablecapturing any exceptions that were thrown.OpenAiErrorTypeindicating the type of error, if applicable.
-
Method Summary
Modifier and Type Method Description MotorCompletionUsagegetMotorCompletionUsage()Retrieves any specific MotorCompletionUsage that occurred during the operation.OpenAiErrorgetOpenAiError()Gets the OpenAI error associated with the response.ThrowablegetThrowable()Gets the throwable associated with the response.booleanisResponseOk()Checks if the response was okay without any errors.StringtoString()Provides a string representation of this object.
-
Method Details
-
isResponseOk
public boolean isResponseOk()Checks if the response was okay without any errors.- Returns:
- true if the operation was successful, false otherwise.
-
getThrowable
Gets the throwable associated with the response.- Returns:
- the throwable, or a MotorNoExceptionThrown instance if there is no throwable.
-
getMotorCompletionUsage
Retrieves any specific MotorCompletionUsage that occurred during the operation. Maybe null for non chat requests.- Returns:
- the motorCompletionUsage, or null if none occurred.
-
getOpenAiError
Gets the OpenAI error associated with the response.- Returns:
- the OpenAiError
-
toString
Provides a string representation of this object. The output includes the class name along with key attribute values.
-