import { Threads } from "https://deno.land/x/openai@v4.61.1/resources/beta/threads/threads.ts";
class Threads
extends APIResource
import { Threads } from "https://deno.land/x/openai@v4.61.1/resources/beta/threads/threads.ts";
Methods
create(body?: ThreadCreateParams, options?: Core.RequestOptions): Core.APIPromise<Thread>
Create a 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>
createAndRunPoll(body: ThreadCreateAndRunParamsNonStreaming, options?: Core.RequestOptions & { pollIntervalMs?: number; }): Promise<Threads.Run>
A helper to create a thread, start a run and then poll for a terminal state. More information on Run lifecycles can be found here: https://platform.openai.com/docs/assistants/how-it-works/runs-and-run-steps
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.
Retrieves a thread.