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.
MotorCompletionUsage
detailing usage metrics during the stream.Throwable
capturing any exceptions that were thrown.OpenAiErrorType
indicating the type of error, if applicable.
-
Method Summary
Modifier and Type Method Description MotorCompletionUsage
getMotorCompletionUsage()
Retrieves any specific MotorCompletionUsage that occurred during the operation.OpenAiError
getOpenAiError()
Gets the OpenAI error associated with the response.Throwable
getThrowable()
Gets the throwable associated with the response.boolean
isResponseOk()
Checks if the response was okay without any errors.String
toString()
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.
-