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

x/openai/lib/AssistantStream.ts>AssistantStream

Deno build of the official Typescript library for the OpenAI API.
Extremely Popular
Go to Latest
class AssistantStream
implements AsyncIterable<AssistantStreamEvent>
extends AbstractAssistantStreamRunner<AssistantStreamEvents>
import { AssistantStream } from "https://deno.land/x/openai@v4.41.1/lib/AssistantStream.ts";

Methods

protected
_createAssistantStream(
run: Runs,
threadId: string,
params: RunCreateParamsBase,
options?: Core.RequestOptions,
): Promise<Run>
protected
_createThreadAssistantStream(
thread: Threads,
params: ThreadCreateAndRunParamsBase,
options?: Core.RequestOptions,
): Promise<Run>
protected
_createToolAssistantStream(
run: Runs,
threadId: string,
runId: string,
params: RunSubmitToolOutputsParamsStream,
options?: Core.RequestOptions,
): Promise<Run>
protected
_fromReadableStream(readableStream: ReadableStream, options?: Core.RequestOptions): Promise<Run>
currentEvent(): AssistantStreamEvent | undefined
currentMessageSnapshot(): Message | undefined
currentRun(): Run | undefined
currentRunStepSnapshot(): Runs.RunStep | undefined
finalMessages(): Promise<Message[]>
finalRun(): Promise<Run>
finalRunSteps(): Promise<Runs.RunStep[]>
[Symbol.asyncIterator](): AsyncIterator<AssistantStreamEvent>

Static Methods

accumulateDelta(acc: Record<string, any>, delta: Record<string, any>): Record<string, any>
createAssistantStream(
threadId: string,
runs: Runs,
params: RunCreateParamsBaseStream,
options?: RequestOptions,
)
createThreadAssistantStream(
body: ThreadCreateAndRunParamsBaseStream,
thread: Threads,
options?: RequestOptions,
)
createToolAssistantStream(
threadId: string,
runId: string,
runs: Runs,
body: RunSubmitToolOutputsParamsStream,
options: RequestOptions | undefined,
)
fromReadableStream(stream: ReadableStream): AssistantStream