Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion helpers.md
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,17 @@ In many cases it will be more convenient to subscribe to a more specific set of

More information on the types of events can be found here: [Events](https://platform.openai.com/docs/api-reference/assistants-streaming/events)

Raw API event names, such as `thread.run.completed`, are exposed through the `event` listener. The
SDK-specific convenience listeners below use names such as `messageDone`, `runStepDone`, and `end`.

```ts
run.on('event', (event) => {
if (event.event === 'thread.run.completed') {
console.log('run completed', event.data);
}
});
```

```ts
.on('runStepCreated', (runStep: RunStep) => ...)
.on('runStepDelta', (delta: RunStepDelta, snapshot: RunStep) => ...)
Expand Down Expand Up @@ -251,7 +262,7 @@ More information on tools can be found here [Tools](https://platform.openai.com/
.on('end', () => ...)
```

The last event send when a stream ends.
The last event sent when a stream ends.

### Assistant Methods

Expand Down