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

x/openai/resources/beta/mod.ts>Threads

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

Properties

messages: MessagesAPI.Messages
runs: RunsAPI.Runs

Methods

create(body?: ThreadCreateParams, options?: Core.RequestOptions): Core.APIPromise<Thread>

Create a thread.

create(options?: Core.RequestOptions): Core.APIPromise<Thread>
createAndRun(body: ThreadCreateAndRunParamsNonStreaming, options?: Core.RequestOptions): APIPromise<RunsAPI.Run>

Create a thread and run it in one request.

createAndRun(body: ThreadCreateAndRunParamsStreaming, options?: Core.RequestOptions): APIPromise<Stream<AssistantsAPI.AssistantStreamEvent>>
createAndRun(body: ThreadCreateAndRunParamsBase, options?: Core.RequestOptions): APIPromise<Stream<AssistantsAPI.AssistantStreamEvent> | RunsAPI.Run>
createAndRunStream(body: ThreadCreateAndRunParamsBaseStream, options?: Core.RequestOptions): AssistantStream

Create a thread and stream the run back

del(threadId: string, options?: Core.RequestOptions): Core.APIPromise<ThreadDeleted>

Delete a thread.

retrieve(threadId: string, options?: Core.RequestOptions): Core.APIPromise<Thread>

Retrieves a thread.

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

Modifies a thread.