RunStep

data class RunStep(val id: String, val createdAt: Int, val assistantId: String, val threadId: String, val runId: String, val type: RunStep.Type, val status: RunStatus, val stepDetails: RunStep.Details, val lastError: RunError?, val expiredAt: Int?, val cancelledAt: Int?, val failedAt: Int?, val completedAt: Int?, val metadata: Map<String, String> = emptyMap())

Each Run is broken down into steps. It is common for a Run to only have 1 step; creating a message. But with tool calls involved, an Assistant can create an arbitrary number of steps.

Constructors

Link copied to clipboard
constructor(id: String, createdAt: Int, assistantId: String, threadId: String, runId: String, type: RunStep.Type, status: RunStatus, stepDetails: RunStep.Details, lastError: RunError?, expiredAt: Int?, cancelledAt: Int?, failedAt: Int?, completedAt: Int?, metadata: Map<String, String> = emptyMap())

Types

Link copied to clipboard
sealed class Details

A sealed class that represents the details of a step.

Link copied to clipboard

An enum that holds all possible types of steps.

Properties

Link copied to clipboard

The ID of the Assistant that created this step

Link copied to clipboard

The unix timestamp for when the step was cancelled.

Link copied to clipboard

The unix timestamp for when the step completed.

Link copied to clipboard

The unix timestamp of when this step was created

Link copied to clipboard

The unix timestamp of when this step expired. This is only present if the parent run has expired.

Link copied to clipboard

The unix timestamp for when the step failed.

Link copied to clipboard
val id: String

The unique id of this step, which can be used in RunStepHandler.retrieve. Always starts with 'step_'. This is different from Run.id, which is also stored in this class as runId

Link copied to clipboard

The last error associated with this run step. Will be null if there are no errors.

Link copied to clipboard

Metadata for this step. This can be useful for storing additional information about the object.

Link copied to clipboard

The ID of the Run that this step was created in

Link copied to clipboard

The status of this step (Can be either IN_PROGRESS, CANCELLED, FAILED, COMPLETED, or EXPIRED)

Link copied to clipboard

The data generated at this step. The type of this data is determined by type. Make sure to check the type of this data before using it.

Link copied to clipboard

The ID of the Thread that this step was created in

Link copied to clipboard

The type of data stored by this step. This will match Details.type stored in stepDetails