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

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

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

Interfaces

Occurs when an error occurs. This can happen due to an internal server error or a timeout.

Occurs when a new thread is created.

Occurs when a message is completed.

Occurs when a message is created.

Occurs when parts of a Message are being streamed.

Occurs when a message ends before it is completed.

Occurs when a message moves to an in_progress state.

Occurs when a run is cancelled.

Occurs when a run moves to a cancelling status.

Occurs when a run is completed.

Occurs when a new run is created.

Occurs when a run expires.

Occurs when a run fails.

Occurs when a run moves to an in_progress status.

Occurs when a run moves to a queued status.

Occurs when a run moves to a requires_action status.

Occurs when a run step is cancelled.

Occurs when a run step is completed.

Occurs when a run step is created.

Occurs when parts of a run step are being streamed.

Occurs when a run step expires.

Occurs when a run step fails.

Occurs when a run step moves to an in_progress state.

type alias AssistantStreamEvent
import { type AssistantStreamEvent } from "https://deno.land/x/openai@v4.31.0/resources/beta/mod.ts";

Represents an event emitted when streaming a Run.

Each event in a server-sent events stream has an event and data property:

event: thread.created
data: {"id": "thread_123", "object": "thread", ...}

We emit events whenever a new object is created, transitions to a new state, or is being streamed in parts (deltas). For example, we emit thread.run.created when a new run is created, thread.run.completed when a run completes, and so on. When an Assistant chooses to create a message during a run, we emit a thread.message.created event, a thread.message.in_progress event, many thread.message.delta events, and finally a thread.message.completed event.

We may add additional events over time, so we recommend handling unknown events gracefully in your code. See the Assistants API quickstart to learn how to integrate the Assistants API with streaming.