Class RunStep
-
- All Implemented Interfaces:
public final class RunStep
Represents a step in execution of a run.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public final class
RunStep.Builder
A builder for RunStep.
public final class
RunStep.LastError
The last error associated with this run step. Will be
null
if there are no errors.public final class
RunStep.Metadata
Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format, and querying for objects via API or the dashboard.
Keys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 512 characters.
public final class
RunStep.Status
The status of the run step, which can be either
in_progress
,cancelled
,failed
,completed
, orexpired
.public final class
RunStep.StepDetails
The details of the run step.
public final class
RunStep.Type
The type of run step, which can be either
message_creation
ortool_calls
.public final class
RunStep.Usage
Usage statistics related to the run step. This value will be
null
while the run step's status isin_progress
.
-
Method Summary
Modifier and Type Method Description final String
id()
The identifier of the run step, which can be referenced in API endpoints. final String
assistantId()
The ID of the assistant associated with the run step. final Optional<Long>
cancelledAt()
The Unix timestamp (in seconds) for when the run step was cancelled. final Optional<Long>
completedAt()
The Unix timestamp (in seconds) for when the run step completed. final Long
createdAt()
The Unix timestamp (in seconds) for when the run step was created. final Optional<Long>
expiredAt()
The Unix timestamp (in seconds) for when the run step expired. final Optional<Long>
failedAt()
The Unix timestamp (in seconds) for when the run step failed. final Optional<RunStep.LastError>
lastError()
The last error associated with this run step. final Optional<RunStep.Metadata>
metadata()
Set of 16 key-value pairs that can be attached to an object. final JsonValue
_object_()
The object type, which is always thread.run.step
.final String
runId()
The ID of the run that this run step is a part of. final RunStep.Status
status()
The status of the run step, which can be either in_progress
,cancelled
,failed
,completed
, orexpired
.final RunStep.StepDetails
stepDetails()
The details of the run step. final String
threadId()
The ID of the thread that was run. final RunStep.Type
type()
The type of run step, which can be either message_creation
ortool_calls
.final Optional<RunStep.Usage>
usage()
Usage statistics related to the run step. final JsonField<String>
_id()
Returns the raw JSON value of id. final JsonField<String>
_assistantId()
Returns the raw JSON value of assistantId. final JsonField<Long>
_cancelledAt()
Returns the raw JSON value of cancelledAt. final JsonField<Long>
_completedAt()
Returns the raw JSON value of completedAt. final JsonField<Long>
_createdAt()
Returns the raw JSON value of createdAt. final JsonField<Long>
_expiredAt()
Returns the raw JSON value of expiredAt. final JsonField<Long>
_failedAt()
Returns the raw JSON value of failedAt. final JsonField<RunStep.LastError>
_lastError()
Returns the raw JSON value of lastError. final JsonField<RunStep.Metadata>
_metadata()
Returns the raw JSON value of metadata. final JsonField<String>
_runId()
Returns the raw JSON value of runId. final JsonField<RunStep.Status>
_status()
Returns the raw JSON value of status. final JsonField<RunStep.StepDetails>
_stepDetails()
Returns the raw JSON value of stepDetails. final JsonField<String>
_threadId()
Returns the raw JSON value of threadId. final JsonField<RunStep.Type>
_type()
Returns the raw JSON value of type. final JsonField<RunStep.Usage>
_usage()
Returns the raw JSON value of usage. final Map<String, JsonValue>
_additionalProperties()
final RunStep.Builder
toBuilder()
final RunStep
validate()
final Boolean
isValid()
Boolean
equals(Object other)
Integer
hashCode()
String
toString()
final static RunStep.Builder
builder()
Returns a mutable builder for constructing an instance of RunStep. -
-
Method Detail
-
assistantId
final String assistantId()
The ID of the assistant associated with the run step.
-
cancelledAt
final Optional<Long> cancelledAt()
The Unix timestamp (in seconds) for when the run step was cancelled.
-
completedAt
final Optional<Long> completedAt()
The Unix timestamp (in seconds) for when the run step completed.
-
expiredAt
final Optional<Long> expiredAt()
The Unix timestamp (in seconds) for when the run step expired. A step is considered expired if the parent run is expired.
-
failedAt
final Optional<Long> failedAt()
The Unix timestamp (in seconds) for when the run step failed.
-
lastError
final Optional<RunStep.LastError> lastError()
The last error associated with this run step. Will be
null
if there are no errors.
-
metadata
final Optional<RunStep.Metadata> metadata()
Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format, and querying for objects via API or the dashboard.
Keys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 512 characters.
-
_object_
final JsonValue _object_()
The object type, which is always
thread.run.step
.Expected to always return the following:
JsonValue.from("thread.run.step")
However, this method can be useful for debugging and logging (e.g. if the server responded with an unexpected value).
-
status
final RunStep.Status status()
The status of the run step, which can be either
in_progress
,cancelled
,failed
,completed
, orexpired
.
-
stepDetails
final RunStep.StepDetails stepDetails()
The details of the run step.
-
type
final RunStep.Type type()
The type of run step, which can be either
message_creation
ortool_calls
.
-
usage
final Optional<RunStep.Usage> usage()
Usage statistics related to the run step. This value will be
null
while the run step's status isin_progress
.
-
_id
final JsonField<String> _id()
Returns the raw JSON value of id.
Unlike id, this method doesn't throw if the JSON field has an unexpected type.
-
_assistantId
final JsonField<String> _assistantId()
Returns the raw JSON value of assistantId.
Unlike assistantId, this method doesn't throw if the JSON field has an unexpected type.
-
_cancelledAt
final JsonField<Long> _cancelledAt()
Returns the raw JSON value of cancelledAt.
Unlike cancelledAt, this method doesn't throw if the JSON field has an unexpected type.
-
_completedAt
final JsonField<Long> _completedAt()
Returns the raw JSON value of completedAt.
Unlike completedAt, this method doesn't throw if the JSON field has an unexpected type.
-
_createdAt
final JsonField<Long> _createdAt()
Returns the raw JSON value of createdAt.
Unlike createdAt, this method doesn't throw if the JSON field has an unexpected type.
-
_expiredAt
final JsonField<Long> _expiredAt()
Returns the raw JSON value of expiredAt.
Unlike expiredAt, this method doesn't throw if the JSON field has an unexpected type.
-
_failedAt
final JsonField<Long> _failedAt()
Returns the raw JSON value of failedAt.
Unlike failedAt, this method doesn't throw if the JSON field has an unexpected type.
-
_lastError
final JsonField<RunStep.LastError> _lastError()
Returns the raw JSON value of lastError.
Unlike lastError, this method doesn't throw if the JSON field has an unexpected type.
-
_metadata
final JsonField<RunStep.Metadata> _metadata()
Returns the raw JSON value of metadata.
Unlike metadata, this method doesn't throw if the JSON field has an unexpected type.
-
_runId
final JsonField<String> _runId()
Returns the raw JSON value of runId.
Unlike runId, this method doesn't throw if the JSON field has an unexpected type.
-
_status
final JsonField<RunStep.Status> _status()
Returns the raw JSON value of status.
Unlike status, this method doesn't throw if the JSON field has an unexpected type.
-
_stepDetails
final JsonField<RunStep.StepDetails> _stepDetails()
Returns the raw JSON value of stepDetails.
Unlike stepDetails, this method doesn't throw if the JSON field has an unexpected type.
-
_threadId
final JsonField<String> _threadId()
Returns the raw JSON value of threadId.
Unlike threadId, this method doesn't throw if the JSON field has an unexpected type.
-
_type
final JsonField<RunStep.Type> _type()
Returns the raw JSON value of type.
Unlike type, this method doesn't throw if the JSON field has an unexpected type.
-
_usage
final JsonField<RunStep.Usage> _usage()
Returns the raw JSON value of usage.
Unlike usage, this method doesn't throw if the JSON field has an unexpected type.
-
_additionalProperties
final Map<String, JsonValue> _additionalProperties()
-
toBuilder
final RunStep.Builder toBuilder()
-
builder
final static RunStep.Builder builder()
Returns a mutable builder for constructing an instance of RunStep.
The following fields are required:
.id() .assistantId() .cancelledAt() .completedAt() .createdAt() .expiredAt() .failedAt() .lastError() .metadata() .runId() .status() .stepDetails() .threadId() .type() .usage()
-
-
-
-