Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/openai/resources/beta/threads/runs/runs.ts>Runs

Deno build of the official Typescript library for the OpenAI API.
Extremely Popular
Go to Latest
class Runs
extends APIResource
import { Runs } from "https://deno.land/x/openai@v4.29.0/resources/beta/threads/runs/runs.ts";

Properties

steps: StepsAPI.Steps

Methods

cancel(
threadId: string,
runId: string,
options?: Core.RequestOptions,
): Core.APIPromise<Run>

Cancels a run that is in_progress.

create(
threadId: string,
options?: Core.RequestOptions,
): APIPromise<Run>

Create a run.

create(
threadId: string,
options?: Core.RequestOptions,
): APIPromise<Stream<AssistantsAPI.AssistantStreamEvent>>
create(
threadId: string,
options?: Core.RequestOptions,
): APIPromise<Stream<AssistantsAPI.AssistantStreamEvent> | Run>
createAndStream(
threadId: string,
options?: Core.RequestOptions,
): AssistantStream

Create a Run stream

list(
threadId: string,
query?: RunListParams,
options?: Core.RequestOptions,
): Core.PagePromise<RunsPage, Run>

Returns a list of runs belonging to a thread.

list(threadId: string, options?: Core.RequestOptions): Core.PagePromise<RunsPage, Run>
retrieve(
threadId: string,
runId: string,
options?: Core.RequestOptions,
): Core.APIPromise<Run>

Retrieves a run.

submitToolOutputs(
threadId: string,
runId: string,
options?: Core.RequestOptions,
): APIPromise<Run>

When a run has the status: "requires_action" and required_action.type is submit_tool_outputs, 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.

submitToolOutputs(
threadId: string,
runId: string,
options?: Core.RequestOptions,
): APIPromise<Stream<AssistantsAPI.AssistantStreamEvent>>
submitToolOutputs(
threadId: string,
runId: string,
options?: Core.RequestOptions,
): APIPromise<Stream<AssistantsAPI.AssistantStreamEvent> | Run>
submitToolOutputsStream(
threadId: string,
runId: string,
options?: Core.RequestOptions,
): AssistantStream

Submit the tool outputs from a previous run and stream the run to a terminal state.

update(
threadId: string,
runId: string,
options?: Core.RequestOptions,
): Core.APIPromise<Run>

Modifies a run.