Runs

interface Runs

Represents an execution run on a thread.

Inheritors

Functions

Link copied to clipboard
abstract suspend fun cancel(threadId: ThreadId, runId: RunId, requestOptions: RequestOptions? = null): Run

Cancels a run that is Status.InProgress.

Link copied to clipboard
abstract suspend fun createRun(threadId: ThreadId, request: RunRequest, requestOptions: RequestOptions? = null): Run

Create a run.

Link copied to clipboard
abstract suspend fun createThreadRun(request: ThreadRunRequest, requestOptions: RequestOptions? = null): Run

Create a thread and run it in one request.

Link copied to clipboard
abstract suspend fun getRun(threadId: ThreadId, runId: RunId, requestOptions: RequestOptions? = null): Run

Retrieves a run.

Link copied to clipboard
abstract suspend fun runs(threadId: ThreadId, limit: Int? = null, order: SortOrder? = null, after: RunId? = null, before: RunId? = null, requestOptions: RequestOptions? = null): List<Run>

Returns a list of runs belonging to a thread.

Link copied to clipboard
abstract suspend fun runStep(threadId: ThreadId, runId: RunId, stepId: RunStepId, requestOptions: RequestOptions? = null): RunStep

Retrieves a run step.

Link copied to clipboard
abstract suspend fun runSteps(threadId: ThreadId, runId: RunId, limit: Int? = null, order: SortOrder? = null, after: RunStepId? = null, before: RunStepId? = null, requestOptions: RequestOptions? = null): List<RunStep>

Retrieves a run step.

Link copied to clipboard
abstract suspend fun submitToolOutput(threadId: ThreadId, runId: RunId, output: List<ToolOutput>, requestOptions: RequestOptions? = null): Run

When a run has the status: Status.RequiresAction and required action is RequiredAction.SubmitToolOutputs, this endpoint can be used to submit the outputs from the tool calls once they're all completed. All outputs must be submitted in a single request.

Link copied to clipboard
abstract suspend fun updateRun(threadId: ThreadId, runId: RunId, metadata: Map<String, String>? = null, requestOptions: RequestOptions? = null): Run

Modifies a run.