Run

@Serializable
data class Run(    val id: RunId,     val createdAt: Int,     val threadId: ThreadId,     val assistantId: AssistantId,     val status: Status,     val requiredAction: RequiredAction? = null,     val lastError: LastError? = null,     val expiresAt: Int? = null,     val startedAt: Int? = null,     val cancelledAt: Int? = null,     val failedAt: Int? = null,     val completedAt: Int? = null,     val model: ModelId,     val instructions: String? = null,     val tools: List<AssistantTool>? = null,     val fileIds: List<String>? = null,     val metadata: Map<String, String>? = null,     val usage: Usage? = null,     val temperature: Double? = null,     val topP: Double? = null,     val maxPromptTokens: Int? = null,     val maxCompletionTokens: Int? = null)

Represents an execution run on a thread.

Constructors

Link copied to clipboard
constructor(    id: RunId,     createdAt: Int,     threadId: ThreadId,     assistantId: AssistantId,     status: Status,     requiredAction: RequiredAction? = null,     lastError: LastError? = null,     expiresAt: Int? = null,     startedAt: Int? = null,     cancelledAt: Int? = null,     failedAt: Int? = null,     completedAt: Int? = null,     model: ModelId,     instructions: String? = null,     tools: List<AssistantTool>? = null,     fileIds: List<String>? = null,     metadata: Map<String, String>? = null,     usage: Usage? = null,     temperature: Double? = null,     topP: Double? = null,     maxPromptTokens: Int? = null,     maxCompletionTokens: Int? = null)

Properties

Link copied to clipboard
@SerialName(value = "assistant_id")
val assistantId: AssistantId

The ID of the assistant used for execution of this run.

Link copied to clipboard
@SerialName(value = "cancelled_at")
val cancelledAt: Int? = null

The Unix timestamp (in seconds) for when the run was cancelled.

Link copied to clipboard
@SerialName(value = "completed_at")
val completedAt: Int? = null

The Unix timestamp (in seconds) for when the run was completed.

Link copied to clipboard
@SerialName(value = "created_at")
val createdAt: Int

The Unix timestamp (in seconds) for when the run was created.

Link copied to clipboard
@SerialName(value = "expires_at")
val expiresAt: Int? = null

The Unix timestamp (in seconds) for when the run will expire.

Link copied to clipboard
@SerialName(value = "failed_at")
val failedAt: Int? = null

The Unix timestamp (in seconds) for when the run failed.

Link copied to clipboard
@SerialName(value = "file_ids")
val fileIds: List<String>? = null

The list of File IDs the assistant used for this run.

Link copied to clipboard
@SerialName(value = "id")
val id: RunId

The identifier, which can be referenced in API endpoints.

Link copied to clipboard
@SerialName(value = "instructions")
val instructions: String? = null

The instructions that the assistant used for this run.

Link copied to clipboard
@SerialName(value = "last_error")
val lastError: LastError? = null

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

Link copied to clipboard
@SerialName(value = "max_completion_tokens")
val maxCompletionTokens: Int? = null

The maximum number of completion tokens specified to have been used over the course of the run.

Link copied to clipboard
@SerialName(value = "max_prompt_tokens")
val maxPromptTokens: Int? = null

The maximum number of prompt tokens specified to have been used over the course of the run.

Link copied to clipboard
@SerialName(value = "metadata")
val metadata: Map<String, String>? = null

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. Keys can be a maximum of 64 characters long, and values can be a maximum of 512 characters long.

Link copied to clipboard
@SerialName(value = "model")
val model: ModelId

The model that the assistant used for this run.

Link copied to clipboard
@SerialName(value = "required_action")
val requiredAction: RequiredAction? = null

Details on the action required to continue the run. Will be null if no action is required.

Link copied to clipboard
@SerialName(value = "started_at")
val startedAt: Int? = null

The Unix timestamp (in seconds) for when the run was started.

Link copied to clipboard
@SerialName(value = "status")
val status: Status
Link copied to clipboard
@SerialName(value = "temperature")
val temperature: Double? = null

The sampling temperature used for this run. If not set, defaults to 1.

Link copied to clipboard
@SerialName(value = "thread_id")
val threadId: ThreadId

The ID of the thread that was executed on as a part of this run.

Link copied to clipboard
@SerialName(value = "tools")
val tools: List<AssistantTool>? = null

The list of tools that the assistant used for this run.

Link copied to clipboard
@SerialName(value = "top_p")
val topP: Double? = null

The nucleus sampling value used for this run. If not set, defaults to 1.

Link copied to clipboard
@SerialName(value = "usage")
val usage: Usage? = null

Usage statistics related to the run. This value will be null if the run is not in a terminal state (i.e. in_progress, queued, etc.).